Skip to Content
avatar image
Former Member

Display Cost Center Group Text

Hi..

I'm new to abap, and I am working for abap for hr module now. My question will be...

How can I display a cost center group text in report? Is there a text table for it?

I get the cost center value from table pa0001-kostl.

I find the function BAPI_COSTCENTERGROUP_GETLIST by searching this forum. But, the parameters I can get is only for controllingareamask from pa0001-kokrs.

any help would be grateful

thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Best Answer
    Feb 01, 2005 at 01:06 PM

    Hi Yusuf,

    BAPI_COSTCENTERGROUP_GETLIST works fine .

    -> here's an example :

    SELECT SINGLE kostl kokrs FROM pa0001 INTO: (kostl, kokrs)

    WHERE pernr = '4711'.

    *

    select single khinr from csks into khinr

    WHERE kokrs = kokrs

    AND kostl = kostl

    AND datbi GE sy-datum

    AND datab LE sy-datum.

    CALL FUNCTION 'BAPI_COSTCENTERGROUP_GETLIST'

    EXPORTING

    controllingareamask = kokrs

    groupnamemask = khinr

    TABLES

    grouplist = it.

    regards Andreas

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      All the above works fine... I have tested it....

      thanks...

      new question will be

      How can I find out the top hirarchy of the cost center? example: cost center 1010256 has 101025 as costcenter group in csks table... and 101025 also has cost center group 1010...

      how can I get 1010 if I only has info for 1010256?

      here is the figure for example.

      1010 --- 101025 --- 1010256
                      |-- 1010257
           |-- 101041 --- 1010415

      Message was edited by: Yusuf Bottie Gaos

      Message was edited by: Yusuf Bottie Gaos

  • avatar image
    Former Member
    Feb 01, 2005 at 10:11 AM

    Hi...

    Welcome to group...

    What i understood is u require text for that particular cost center....

    Use table <u><i><b>CSKS</b></i></u> field name <u><i><b>KTEXT</b></i></u>.

    If this help u out give me points. I hope u know the system.

    Regards,

    Sagar

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 01, 2005 at 11:16 AM

    <b>cost center group</b> text is in <b>SETHEADERT</b>

    for Cost center Group setclass = '0101'

    subclass = <your controlling area>

    Regards

    Raja

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 02, 2005 at 08:00 AM

    Hi Yusuf,

    i'll guess you mean the standard hierarchy for the controlling aerea (1 Kokrs : 1 KHINR ).

    -> so when you've the controlling aera (pa0001-kokrs):

    select single KHINR from <b>TKA01</b> into top_hirarchy

    where kokrs = pa0001-kokrs.

    regards Andreas

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 02, 2005 at 08:46 AM

    hi Yusuf,

    You can get top hierarchy by using two SAP function modules.

    <u><b>G_SET_GET_SUPERSETS</b></u>

    <i><b>G_SET_GET_ALL_SUPERSETS</b></i>

    Using G_SET_GET_SUPERSETS function module you can get immediate parent node of the specified cost center group.

    And if you want all parent nodes for specified cost center group then use G_SET_GET_ALL_SUPERSETS function module.

    I hope this information will help you.

    And then let me know the status of it.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Durairaj Athavan Raja

      Hi All,...

      Sorry for this confusing discussion 😊 I finally realize that the answer from andreas is the one that solved my problems 😊

      thanks again.

  • avatar image
    Former Member
    Feb 03, 2005 at 05:43 AM

    Hi Yusuf,

    What input u specified for executing FM?

    I think input values are wrong.

    If you want company based on cost center...

    You have to first find one node above cost center means department in your case. then pass KHINR value in FM G_SET_GET_ID_FROM_NAME as shortname which returns SETID of the node based on its KHINR value. pass this setid to FMs metioned in my earlier reply as SETNAME. U will surely get output.

    Let me know the status after trying this.

    Add comment
    10|10000 characters needed characters exceeded