Importing a File: Master Data Hierarchy

The product groups in your company are structured hierarchically:

Hierarchy representation with left sibling

You have a TXT file on your PC with the following representation of the master data hierarchy:

SHOES

LADIES_SHOES

BOOTS_LADIES

SPORT_LADIES_BOOTS

LEIS_LADIES_SPORT

MENS_SHOES_LADIES

LEATHER_MENS

HIKING_MENS_LEATHER

CHILDRENS_SHOES_MENS

SUMMER_CHILDRENS

WINTER_CHILDRENS_SUMMER

The underscore ( _) between the fields in the lines symbolizes the TAB character that separates the fields.

You want to import this data in accordance with hierarchy display 3 into aspect 001 ( Profitability Analysis ). With hierarchy display 3 you do not just transfer the characteristic value and information about the superior nodes (parent nodes), you also transfer information about the equivalent previous node (left sibling). You can find more information about the various hierarchy displays in Customizing.

The aspect contains the characteristic ARTGR ( Product group ) and all the characteristic values contained in the hierarchy.

You create a sender structure HIER. The receiver structure TKCHIEDM is fixed for the transfer of a master data hierarchy. The fields of your sender structure are transferred into the fields of the receiver structure. Because of this, the fields for the characteristic value, the parent node and the sibling node, must always be of type C. Enter the following data:

Aspect

001

Conversion

0

Field name

Ref. table

Field name

Type

Length

Dec. places

KEYID

TKCHIEDM

Char. value

C

32

0

PARNT

TKCHIEDM

Char. value

C

32

0

LEFTK

TKCHIEDM

Char. value

C

32

0

With the entry of a field name and a reference table, the other fields are automatically derived from the reference table. You generate the sender structure and then maintain the transfer rules. In addition to the characteristic values, that are maintained in the sender structure, transfer rules have to be maintained for the fields FIELD ( field name ), HVERS ( hierarchy variant ) and HSTEP ( hierarchy level ). You fill FIELD with the name of the characteristic and HVERS with the number of the desired hierarchy variant. The field HSTEP is not required with this hierarchy representation and can be filled with a constant (000). If you are also transferring text, maintain the text fields too. Enter a constant for the language.

Recv. field

Assign. rule

Sender field

Offset

Length

Constant

FIELD

SET

     

ARTGR

HVERS

SET

     

001

HSTEP

SET

     

000

KEYID

MOVE

KEYID

0

0

 

PARNT

MOVE

PARNT

0

0

 

LEFTK

MOVE

LEFTK

0

0

 

TXT_M

         

TXT_L

         

LANGU

SET

     

D

You save the transfer rules and then maintain the selection data for importing the file.

To carry out a test run of the transfer, enter the following data:

Field

Entry/Selection

Sender structure

HIER

File

Path, in which the file can be found, for example, d:\file\ablexcel\hier.txt

File system

Presentation server

Editing

Display file

Display sender record-field assignment

File type

TXT format

Number format

Type P

No editing characters

Data format

ASCII

Date format

YYYYMMDD

Then you can execute the program.

If the test data is satisfactory, you can select Data transfer and execute the program again.

Hierarchy representation with level number

You have a TXT file on your PC with the following representation of the master data hierarchy:

1_SHOES

2_LADIES

3_BOOTS

3_SPORT

3_LEIS

2_MENS

3_LEATHER

3_HIKING

2_CHILDRENS

3_SUMMER

3_WINTER

The underscore ( _) between the fields in the rows symbolizes the Tab character which separates the fields.

You want to import the data in accordance with hierarchy display 1 into aspect 001 ( Profitability Analysis ). With hierarchy representation 1 you do not just transfer the characteristic value but also information about the hierarchy level. The sequence of the characteristic values determines the position of the nodes compared to other nodes on the same level. You can find more information about the various hierarchy representations in Customizing.

In this case, the field HSTEP (hierarchy level) must be included in your sender structure and maintained in the transfer rules correspondingly. The field LEFTK (left sibling)is not required in the sender structure and can be left vacant in the transfer rules.

See also:

Importing a File