Loading Cost Center Hierarchy (CCH) into SAP using BAPI & LSMW
Definition – groups of cost centers in a tree structure within a controlling area that represent specific areas of cost incurrence from a Controlling perspective.
A cost center hierarchy comprises all cost centers for a given period and therefore represents the whole enterprise. This hierarchy is known as the standard hierarchy.
Cost Center hierarchies are typically defined before creating cost centers.
Usually considered as configuration objects, high volume and complexity in nesting may call for automated load methods. Here’s one way of automating creation (load) of CCH into SAP.
Define Input/Load File Structure
Since CCH is defined at CO. Area level, a “header” line is used to create CCH per Co. Area. This way, the same process/files can be reused for loading standard and alternate hierarchies under same/different controlling areas.
Columns |
Data type |
Length |
Column Description |
LNIND |
CHAR |
1 |
Line indicator – Header/Line |
VALU1 |
CHAR |
15 |
Controlling Area/Group Name |
VALU2 |
CHAR |
10 |
Hierarchy Level |
VALU3 |
CHAR |
10 |
Value Count |
VALU4 |
CHAR |
40 |
Description |
Sample Data
Header (Co. Area) |
Controlling Area |
|
Value # |
Description |
H |
1000 |
|
|
|
L |
C1000 |
0 |
0 |
IDES |
L |
C1010 |
1 |
0 |
Corporate |
L |
C1110 |
2 |
0 |
Executive Board |
L |
1234 |
3 |
0 |
test |
L |
4567 |
3 |
0 |
yress |
L |
C1120 |
1 |
0 |
Internal Services |
L |
98763 |
3 |
0 |
sdfdsfds |
L |
C1200 |
1 |
0 |
Administration & Financials |
L |
C1210 |
2 |
0 |
Administration |
L |
C1220 |
2 |
0 |
Human Resources |
L |
C1230 |
2 |
0 |
Procurement |
LSMW:
- LSMW method: BAPI – BAPI_COSTCENTERGROUP_CREATE
- Business Object: BUS1112, Cost center group
- Method: CREATE
- Message Type: COSTCENTERGROUP_CREATE
- Basic Type: COSTCENTERGROUP_CREATE01
Structures/Fields to populate:
- E1COSTCENTERGROUP_CREATE (Header segment)
- CONTROLLINGAREAIMP
Note: Populate the above field with controlling area value only for header records
- E1BPSETHIET (Interface structure for groups – Hierarchy table)
- GROUPNAME
- HIERLEVEL
- VALCOUNT
- DESCRIPT
Note: Populate the above fields only for hierarchy lines
Post-load review/reconciliation
- Execute transaction KSH3
- Input Top Node name & Display
- Validate if all nodes have been created correctly
– KP (Blogging Irregular)
Good Job.
This is extremely useful in multi company code projects, where number of cost centers / profit centers does exist. This would dramatically reduce the work of the consultant. Otherwise, consulting those nodes would be nightmare for the consultant.
Thanks for sharing.
Best Regards,
Ravi
Thank you - many more related posts to come -KP
Hi Karthik,
I could follow the steps mentioned by you above... However the following error is displayed 'Inconsistent set hierarchy '.
Can you please help ?
Regards,
Siri.
that is really useful, i created hierarchy by ksh1 before.
now i know lsmw can do it to , so next time i can do it more fast.
thanks for the dedication!
do you have a sample file for this ? i tried with the above format.... but not able to upload...
Rgds,
Siri.
does not work out giving error Document cannot be posted
Hello, and thank you for your sharing.
I followed your procedure, but when I run the Start IDoc Processing it gives me the error:
Inconsistent set hierarchy.
Message no. GS513
Diagnosis
An empty or defective hierarchy table was presented when trying to create a set hierarchy.
System Response
No set is changed or created.
Procedure
There is probably a program error when creating the set hierarchy.
Can you hel me?
Thanks in advance.
HI,
Can we use the structure E1COSTCENTERGROUP_CREATE as it is in our LSMW project?
Regards
Hello,
Do you know how to make massive assignments of profit centers (already created in the system) into profit center groups? These groups are not in the standard hierarchy, and will be used only for reporting purpose. The transaction KE52 allows to assign a profit center into one or more groups (that are not in the standard hierarchy), but is one at a time.
Regards,
Hi Karthik ,
Its Nice document thank you for sharing
Regards
Sada Bandla
Hello,
Great and so Excellent. 🙂 ➕
Thank you very much.
all the best Erwin
Hi Karthik,
Thanks for the very useful article. It will certainly help me out.
If possible, can you please share BAPI for AR, AP & GL Master Data also.
Thanks in advance
BAPI_ACC_DOCUMENT_POST can handle AR AP and GL entries.
For GL/CoA GLMAST** can be used or even RFBISA00/0010 through LSMW.
Hi,
Was asking about master data, will the same BAPI could be used.
Regards
Saurabh
Hi Karthik,
I tried to upload the hierarchy through the method suggested by you but could not process the IDOC. Can you share the IDOC relevant screens?
Thanks.
Hi M.Potharaju,
Thank you for sharing your knowledge via this blog. I tried to create the LSMW doing the same steps as you even using the same load file in my sandbox for testing prior using with real data and the idoc has created the first line but I got the same error as another one on this blog related to the inconsistent set hierarchy, message no GS513. I didn't find an answer to solved this issue. Can you please help? Thank you, Cynthia
very good! thanks for information
I have used this method to create cost center groups with cost centers assigned. When I go look a the group, the cost centers do no show their description but the message No valid master record. All the cost centers in the group are valid. Is there a way to get the cost center description to show up and not this message.
hi,
I did the same implementation but not able to modify a Cost Center group while it has nodes up and down, when it's not linked it's updated but not when having links.
thanks
Hi,
Thanks for this blog.
Important points so it works:
Regards,
Thomas