11-20-2007 4:13 PM
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
11-20-2007 4:37 PM
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
11-20-2007 4:24 PM
11-20-2007 4:37 PM
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