How To Upload Hierarchy and Master Data of FS Items in SAP SEM-BCS Starting With 4.0 by Using Flexible Upload Method.
Flexible upload of master data and hierarchies of consolidation infoobjects is declared to be possible. It is stated in help information. There is even the OSS Note 607766 for Uploading master data of Hierarchies.
However, it doesn’t work properly if you create a file for upload with the proposed format. For example, for the hierarchy like this:
the proposed format of a file for upload is recommended like the following:
The document says that “Note that remarks in parentheses are only intended to relate the entry to the hierarchy drawing above, and are not a part of the file content.”
Loading the file like this creates the item hierarchy, but nodes are loaded incorrectly, just one node and several leaves.
I had to play with the file format and, finally, succeeded. The proper format of the file is provided later in this blog.
Flexible Upload Method Creation
Execute UCWB transaction or go in SEM-BCS Consolidation Workbench from SAP menu. Choose Process View and double click on Flexible Upload method.
In the open Flexible Upload frame right click on a free area and choose <Create>.
Position cursor to the new method row, click on the left part of it and type in a code of the method to be created.
In the details frame of the method type in the method name and choose <Items> row from a drop down menu for a Data Type.
After that in the <Field Catalog> tab you’ll see a predefined structure of the fields for uploading hierarchies. You can not add or delete fields here. Though, you
may change sequence of the fields within the structure by drag and drop.
From the right pane drag and drop fields into <Header> and <Data Rows> nodes of the structure.
Choosing Version, Chart of Accounts and Cons Area fields is important. If you don’t select them, you may not see uploaded data.
In the <Settings> tab choose the column width and a column separator, comment row sign, update mode and <Use Row and Data Rows> as Row Types.
Save the method.
Format of the File for Upload
Here we see the first two lines with comments explaining the rows structure. The 2nd row contains the header’s data. They allow data to arrive to the proper version, items catalog and consolidation area.
Pay attention to the fact that with <Row Type> set to “Header Row and Data Rows” in the flexible upload method definition, we need to specify in the first column the row type as following:
- 1 – for data header,
- 2 – for data rows,
- 3 – for hierarchy rows.
And below is the part of the file for hierarchy upload.
The hierarchy row starts with “3”. “BS” in the second column is the hierarchy name.
The first hierarchy node (BSROOT in our case) is a text node and created automatically. You need only to provide the node’s name.
IMPORTANT: The missing part of the file (comparing with the format recommended in help and the note shown earlier) is located in the <Node> column.
The cell in this column corresponding to the particular node should remain blank for nodes whose parent is the first text node BSROOT (i.e. for nodes of the 1st hierarchy level).
For the nodes of the lower levels specify in the corresponding cell of <Node> column just the node code (shown in the picture with a blue rectangular).
The columns shown here as <Short> and <Long>, as per help, may contain the short and long descriptions of the hierarchy to be created. However, I was not able to upload these descriptions.
The file format explained here is a prerequisite for the proper hierarchy load. And as far as I know, this important detail is missed in the SAP documents. Since you may rearrange fields in the <Hierarchy> node of the flexible upload method structure, just note that the <Node> column in the file should correspond to the <Item> field in the structure:
The Method Execution
You don’t need to assign the method to task and consolidation monitor tasks hierarchy. Execute it simply from a context menu of the method and choose the file to be uploaded.
After method finishes the import you may look at the upload log, to make sure that everything was uploaded smoothly.
To see the data loaded, double click on <Item> row.
The frame for hierarchies opens. Expand nodes and see the hierarchy structure.
Double click on any node or leaf and see that all attributes of the item has been loaded.
Do not forget to press the <Save> icon for saving uploaded data.
So, by using the flexible upload we can load texts and attributes of FS Items, and their hierarchy in one go! Though, you may load them separately, master data first, and then the hierarchy (using two different flexible upload methods and data files).
You can compare the master data of FS Item in SEM-BCS with the corresponding infoobject in SAP BW (0CS_ITEM by default) and see that the Item infoobject in BW has different master data. Flexible upload allows us to bring into BCS the proper attributes of FS Item. By using the older technique of synchronizing master data in BW and BCS (with the programs like UGMDSYNC) you may fetch into BCS only data visible in BW.