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: 

Assigning cost center to hierarchies

kasarla_nagaraju
Explorer
0 Kudos

Hi All

I've created one cost center (using KS01) and one cost center group (using KSH1) now I want to assign this cost center to the cost center group.

manually I can do it using KSH2 transaction code but I want do this through an ABAP program so I  just looking for function modules if there are any.

Please help me with this.

thank you.

1 ACCEPTED SOLUTION

Former Member

Hi,

you can use FM BAPI_COSTCENTERGROUP_CREATE for the same. the manner in which data is provided in this BAPI is a bit tricky. Just see the documentation of the BAPI in that the diagrammatic explanation is available.

Regards

Animesh Sundriyal

4 REPLIES 4

Former Member

Hi,

you can use FM BAPI_COSTCENTERGROUP_CREATE for the same. the manner in which data is provided in this BAPI is a bit tricky. Just see the documentation of the BAPI in that the diagrammatic explanation is available.

Regards

Animesh Sundriyal

0 Kudos

Hi Animesh Sundriyal,

Thank you so much for your reply.

I've verified 'BAPI_COSTCENTERGROUP_CREATE' function module and gone through the documentation as well.

With this function module I am able to create a new cost group with some cost centers under it.

My requirement is to assign a cost center to an existing cost center group.

I've tried assigning a cost center to an existing cost center group with this function module but the problem here is  subnodes under the group are getting deleted a new hierarchy is being created with the information that I am providing..

Please let me know if you know how to handle this.

thank you

Nagaraju

former_member184569
Active Contributor
0 Kudos

Create a recording of assigning the cost center to the group through KSH2 using SHDB transaction.

Then get the BDC program from it and use it in your program.

With LSMW, refer this link.

http://scn.sap.com/community/erp/financials/blog/2012/08/10/loading-cost-center-hierarchy-cch-into-s...

0 Kudos

Hi Sushmitha,

Thanks for your reply.

I understood what you have suggested, but creating BDC is not the best alternative for my requirement.

However in the link you shared, I can see the same function module  (BAPI_COSTCENTERGROUP_CREATE) which Animesh shared.

Thank you

Nagaraju