Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

create a table with a hierarchy

Former Member
0 Likes
1,520

hello

Can we create a table with a hierarchy?

For example I have a profit center hierachy, and I want to have a table with diffrent field from the diferent level of my hierarchy?

Do it exist a function or another thing for create this?

Thank you

J

hello

Can we create a table with a hierarchy?

For example I have a profit center hierachy, and I want to have a table with diffrent field from the diferent level of my hierarchy?

Do it exist a function or another thing for create this?

Thank you

J

6 REPLIES 6
Read only

Former Member
0 Likes
948

Hi Jeremy,

I´m not sure if I undestood correctly, but to do hierachy on tables you would have to use as foreing key the fields you need on your new table, and add the new fields.

Another thing: I´m not sure if you can use hierachy on SAP (tables), if you kindly explain in more detail what you need...Ypu could get better help.

See ya,

Gabriel

Read only

0 Likes
948

I have a hierarchy on the profit center;

I would like create a table with this hierarchy

for example

in the first field I have the firts level

in the second field, i have the second level

...

Read only

Former Member
0 Likes
948

Hi,

To achieve your purpose you can create a table with the following tables

Hierarcy

Hierarchy level

The highest Hierarchy will have the lowest Hierarchy level value.

for example if you have a Profit Center Hierarchy

Hie 1

Hie 2

Hie 3

Hierarchy 1 is the parent and Hierarchy 3 the lowest node.

So the values in your table could be like this

Hierarchy Hierarchy level

Hie1 1

Hie2 2

hie3 3

This way you can accomodate any number of Hierarchy levels.

Regards,

vara

Read only

0 Likes
948

Ok but do you know a program or another thing for transform this hierarchy to a table

J

Read only

0 Likes
948

Hi,

there is already existing table for profit center hierarchy : setheader, setleaf, setnodes ....

and there is also the function to create a table from this hierarchy :


  call function 'K_GROUP_SELECT'
       exporting
           BUTTONS            = 'X'
           CLASS              = '0106'
*          CRUSER             = '*'
           field_name         = 'RPRCTR'
*          SEARCHFLD          = '    '
           SEARCHFLD_INPUT    = ' '
           SEARCHFLD_REQUIRED = 'X'
*           SET                = s_setnme-low
*          START_COLUMN       = 10
*          START_ROW          = 5
           TABLE              = 'GLPCT'
*          TYPELIST           = 'BS'
*          UPDUSER            = '*'
           KOKRS              = p_kokrs
           KTOPL              = 'RFR0'
      IMPORTING
*          CLASS_NAME         =
           SET_NAME           = s_setnme-low
*          SET_TITLE          =
*          TABLE_NAME         =
*           SETID              = v_groupecentre
      EXCEPTIONS
           NO_SET_PICKED      = 1
           OTHERS             = 2
           .

Rgd

Frédéric

Read only

Former Member
0 Likes
948

hi jeremy,

to understand the hierarchy of the table

goto transaction SQO2 CREATION OF INFOSETS

in here u need to give the table u want to join by table1 name AXXX

(ex profit center hierarchy )

and table name2

(ex second hierarchy )

and table name2

(ex third hierarchy )

and table name2

(ex fourth hierarchy )

so this will give u a clear picture of the tables along with fields so that the hierarchy is determined.

now if u want to create a ztable then u can use this option to understand the primary /foreign key relationship.

i hope u are trying to understand the relationship between the tables or trying to fill the gaps between them

in SQ02 just create an infoset and start analysing this table-field relationship .

hope this helps u out .

regards,

vijay.