We all know that SAP have given the program Z_SAP_HIERARCHY_DOWNLOAD for master data hierarchy. But the program doesnt give the column names in the flat file. Here are the easy steps by which we get the heading columns for the flatfile downloaded from the program.
Downloading Hierarchy to Flatfile
1. Execute ABAP program Z_SAP_HIERARCHY_DOWNLOAD throught tcode SE38.
2. Initial Screen looks like the following. Here Infoobject, hierarchy name, language key and file name(in desired location) are minimum required fields to be entered.
After entering the details press execute. The hierarchy downloaded message will appear.
This excel file or txt file (whichever format that we entered) will not have Column names.
Goto tcode RSA1, goto Infosource tab.
Search with the particular infoobject for which hierarchy has to be downloaded. (In our case it is 0CS_ITEM)
Double click the Infosource transfer rules. Select "Hier. Structure" button.
Now Maintenance of Hierarchy header properties and file structure window will open. This window will contain the fields and their descriptions. Copy entire descriptions using ctrl+Y.
Inserting Columns into the Flatfile
Copy and paste the descriptions in an excel sheet. Use transpose function to paste in horizontal form.
Now these will form the column headings for the Flat file downloaded. One or two blank columns might be there in Flat file which can be hidden.