08-30-2007 8:40 AM
Hi,
I have to fetch cost center related to cost center groups.
Is there any Function module to pick Cost center from Cost center group hierarchy.
Thanks and Regards,
Vaibhav
08-30-2007 9:04 AM
You can derive the Cost Centers from Cost Center group name -
1. Call function module G_SET_GET_ID_FROM_NAME, pass ur Cost Center group to parameter SHORTNAME.
CALL FUNCTION 'G_SET_GET_ID_FROM_NAME'
EXPORTING
shortname = L_COST_CENTER_GRP
IMPORTING
NEW_SETID = L_SETID.
2. Then call FM <b>G_SET_GET_ALL_VALUES</b> to get the range of Cost Centers attached to the grp.
CALL FUNCTION 'G_SET_GET_ALL_VALUES'
EXPORTING
setnr = l_setid
no_descriptions = space
TABLES
set_values = lt_setvalues
EXCEPTIONS
set_not_found = 1.
Check <b>lt_setvalues_FROM</b> and <b>lt_setvalues_TO</b> - this defines the range of cost centers for a Cost Center group.
Hope it solves ur prob.