Skip to Content

Split Cost of Goods Sold

Dec 19, 2017 at 04:58 AM


avatar image

Hi Experts, I want to write a custom program in S/4 HANA 1610 to split Cost of Goods sold in different GL accounts, while posting invoice in FB01 in the default COGS account.

Any Function modules or classes I can use to do this?

10 |10000 characters needed characters left characters exceeded

What have you searched for / tried so far?

Hi Jelena,

I tried to replicate the processing of CHECK_COGS_SPLIT_RELEVANCE inside CL_FCO_COGS_RWIN, after getting the mts_split in line 823, now I am kinda lost how to go further from here.

But you can give other suggestions if possible.


* Please Login or Register to Answer, Follow or Comment.

1 Answer

Jelena Perfiljeva
Dec 20, 2017 at 04:58 PM

Not sure why you'd need a "program" (standalone program, I assume?) for that. Might want to provide more details on what you're trying to achieve exactly and provide the business requirements as well. Also add FI tag to make sure you're not reinventing the wheel for something that can be achieved with configuration.

This SAP Help was the first hit in Google search, it mentions some BADIs. Take a look, there could be further documentation for those in SPRO in your system.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Dear Jelena,

I raised this question to SAP on service marketplace via incident, they responded above link is valid only for S/41709 and later. We are on S/4 1610 SP01.

We want to achieve COGS split in Intercompany Sales when AP accounting :

During intercompany billing document creation (& resulting intercompany AR / revenue postings), IDOC is created.Via configuration and standard setup, the IDOC is passed to Finance for posting the offsetting Accounts Payable entry .

Referenced posting is per our configuration and further requirement for GL account offsets.The amount on cost of Goods Sold account (50300000) should get split into cost components based on configuration;accounts 50300300 50300230 50300220 50300210 50300130 50300120 .

This feature is not working in intercompany sales by default in1610.

That is the reason in my initial response above I was researching into those 2 classes which are called for COGs split during outbound delivery PGI, the same classes are not automatically called in Intercompany Sales on the AP side.

Now I am back to square 1 to design a custom process or post the split back in GL.

Please guide if you have more clues.


It would've been a good idea to post all this information in the original question. Going forward, please provide as much information as possible to start with, don't wait for others to ask.

Sorry, I don't know anything about S/4HANA. Based on what you're saying, it seems you need some kind of a user exit or enhancement, not a standalone report. Perhaps SAP Support can provide more information on the BADIs available in 1709, so that you could try and create something similar in your system. Although if it's very complex then it might just be not feasible at all. Then maybe just let it post as is and then do a JE or something. The FI consultant should be able to advise on other options.