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

Function module/ Bapi to get cost center group.

Former Member
0 Likes
3,687

Hi All

Can anybody please tell me the function module/ Bapi to get cost center group when the input parameter would be cost center .

Also is there a table in which I can find the cost center group and all the cost centers which are there in that cost center group.

Thanks in advance for your help!

Regards

Ankit

2 REPLIES 2
Read only

Former Member
0 Likes
1,253

<b>Also is there a table in which I can find the cost center group and all the cost centers which are there in that cost center group.</b>

check the table SETHEADER and SETLEAF

DATA : it_kostl TYPE TABLE OF bapi1112_values WITH HEADER LINE,

it_kstar TYPE TABLE OF bapi1113_values WITH HEADER LINE,

it_nodes1 TYPE TABLE OF bapiset_hier,

it_nodes2 TYPE TABLE OF bapiset_hier,

it_messages1 LIKE bapiret2,

it_messages2 LIKE bapiret2.

IF s_kostl[] IS INITIAL AND

NOT p_ccgrp IS INITIAL.

CLEAR it_kostl.

REFRESH : it_kostl .

CALL FUNCTION 'BAPI_COSTCENTERGROUP_GETDETAIL'

EXPORTING

controllingarea = 'ERC'

groupname = p_ccgrp

IMPORTING

return = it_messages1

TABLES

hierarchynodes = it_nodes1

hierarchyvalues = it_kostl.

CLEAR it_kostl.

LOOP AT it_kostl.

s_kostl-sign = 'I'.

s_kostl-option = 'BT'.

s_kostl-low = it_kostl-valfrom.

s_kostl-high = it_kostl-valto.

APPEND s_kostl.

CLEAR s_kostl.

ENDLOOP.

ENDIF.

Message was edited by:

Chandrasekhar Jagarlamudi

Read only

Former Member
0 Likes
1,253

<i>Also is there a table in which I can find the cost center group and all the cost centers which are there in that cost center group.</i>

There is a bapi

-BAPI_COSTCENTERGROUP_GETDETAIL