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: 

function module to pick cost center inside cost center groups

former_member197703
Participant
0 Kudos

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

1 REPLY 1

Former Member
0 Kudos

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.