Application Development 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: 

Plz help

Former Member
0 Kudos

Hi,

I want to print the cost element group higherarchy discription from the tcode KAH3.

Can any one tell how to get the discription of the higherarchy from the database.

Point will be sure.

Mohana

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

You can use this FM to get the values:

select single * from setheader
into l_header
 where
SETNAME   = <your_costcenter_group>

concatenatel_header-SETCLASS  
l_header-SUBCLASS  
l_header-SETNAME
into l_setid.

data: gt_setvalue TYPE STANDARD TABLE OF setvalues.


        CALL FUNCTION 'G_SET_TREE_IMPORT'
          EXPORTING
           client                          = sy-mandt
           langu                           = sy-langu
           setid                           = set_id
         TABLES
           set_values                      = gt_setvalue
         EXCEPTIONS
           SET_NOT_FOUND                   = 1
           ILLEGAL_FIELD_REPLACEMENT       = 2
           ILLEGAL_TABLE_REPLACEMENT       = 3
           SET_IS_DAMAGED                  = 4
           OTHERS                          = 5.

To get the description, use the values from the GT_SETVALUE and take the description from CSKT.

Regards,

Naimesh Patel

2 REPLIES 2

JozsefSzikszai
Active Contributor
0 Kudos

start KAH3

click in the field cost element group

press F4...

naimesh_patel
Active Contributor
0 Kudos

You can use this FM to get the values:

select single * from setheader
into l_header
 where
SETNAME   = <your_costcenter_group>

concatenatel_header-SETCLASS  
l_header-SUBCLASS  
l_header-SETNAME
into l_setid.

data: gt_setvalue TYPE STANDARD TABLE OF setvalues.


        CALL FUNCTION 'G_SET_TREE_IMPORT'
          EXPORTING
           client                          = sy-mandt
           langu                           = sy-langu
           setid                           = set_id
         TABLES
           set_values                      = gt_setvalue
         EXCEPTIONS
           SET_NOT_FOUND                   = 1
           ILLEGAL_FIELD_REPLACEMENT       = 2
           ILLEGAL_TABLE_REPLACEMENT       = 3
           SET_IS_DAMAGED                  = 4
           OTHERS                          = 5.

To get the description, use the values from the GT_SETVALUE and take the description from CSKT.

Regards,

Naimesh Patel