In this blog the focus in on CO postings also called secondary postings which are generated out of COBK table from ECC systems and are replicated via SLT. Error handling is via AIF however it is important to understand relevant steps, options and how system works when the load is executed.
Below Business Transaction Types (VRGNG) are transferred with CO Secondary posting data transfer (till S/4HANA 2020)
- KAMV – Manual Cost Allocation
- KOAL – Actual Settlement of Internal Activity Allocation
- KOAO – Actual Settlement (Not for CO-PA scenario)
- KSI0 – Actual Cost Centre Split
- KSI1 – Actual Split Costs (Primary)
- KSI2 – Actual Split Costs (Secondary)
- KSI3 – Actual Split Costs Internal Activity Allocation
- KSII – Actual Price Calculation
- KZPI – Actual Overhead (Periodic)
- RKIU – Actual Overhead Assessment
- RKIV – Actual Overhead Distribution
- RKL – Actual Activity Allocation
- RKLN – Revaluation at Actual Price
- RKLT – Actual Template Allocation
- RKU1 – Repost Costs
- KZPR – Actual Overhead (Realtime)
- RKIL – Actual Inverse Activity Allocation
- RKS – Enter Statistical Key Figures
- RKLX – Predistribution of fixed costs
- KAZI – Actual cost centre accrual
- RKIB – Actual Periodic Repostings
- RKU2 – Repost revenue
- KTDA – COPA: TOP-DOWN: Actuals
- RRIU – Segment adjust.: Act. Assess.
- RRIV – Segment adjust.: Act. distrib.
- RKN – Actual non-alloc. activities
- KOLI – Collective order delivery
- RRIB – Seg. adjust.: Act.per.repost.
- RKU3 – Repost CO line items
- GPDP – Distribution Primary Costs
- GPDS – Distribution Secondary Costs
- JVIU – JV Actual assessment
- JVIV – JV Actual distribution
- JRIU – JV-Seg.adjustm.assessment
- JRIV – JV-Seg.adjustm.distribution
Any Primary CO document (referred as COIN) is transferred along with FI document in the Initial Load as well as online replication.
SAP post these documents to CFIN via below Functional Modules:
- This updates the table ACDOCA rather COEP
- The related line item tables COEPL (for actual activity type) and COEPT (for actual price) are not updated
- Cost objects supported by this FM are:
- Production Order / Product Cost Collector / Internal Order / Maintenance Order / QM Order (OR*)
- Cost Centre (KS*) / Activity Type (KL*)
- CO-PA Segment (EO* & AO*)
- For other cost objects such as Project, Sales Order etc., BAdI ES_FINS_CFIN_CO_INTERFACE can be implemented to map cost objects from source systems to cost objects in Central Finance system
In addition, it is clear that with S/4HANA SAP supports only Margin Analysis while source ECC systems might be using Cost based COPA or Account based COPA
CO Preparation Step
What happens in CO Preparation step?
- System reads the table in source system – VCFIN_SOURCE_SET
- When initial load is marked as completed system starts capturing the documents (FI & CO) for real time replication
- For FI it sends to – CFIN_ACCHD. this is not the dsicussion topic for this blog
- For CO it sends (after transformation) to CFIN_COPA with document number referring to COBK
- System converts CO-PA line items and characteristics into the key-value pair structure in the CFIN_COPA table
- System starts storing references of the original documents for the reposting documents using the RKU3 business transaction
- Systems starts modifying the CFIN_CO_ADD table, moving elements from the COKEY table into the CFIN_CO_ADD table
During this step the below tables that are updated are:
- CFIN_CO_ADD – For CO Document additional data mainly the cost object information
- CFIN_COPA – For the CO-PA data of the relevant CO Document being transferred
- CFIN_JOB_LOG_CO – For logs the CO Initial load preparation steps
- CFIN_MIG_LOG_CO – For CO Initial Load execution log
If source system is SAP S/4HANA, the table below is also populated:
- CFIN_COEP_ADD Transfer Table for CO Line Item Extended Fields
When SAP starts transferring CO data from SAP ECC system via CFIN to SAP S/4HANA the below tables are updated:
These tables are used during ongoing replication as well as the initial load. During the initial load preparation step, these tables are filled with information related to the CO document that is within the scope of the initial load, based on the set up of the company codes in VCFIN_SOURCE_SET. Once the preparation step is complete, they are used to fill the values for CO online replication document.
If in any case it is needed to undo everything done in CO Preparation step, it can be done:
Transaction – FINS_CFIN_CO_DEL_SRC
When the CO Initial Load starts via SLT system reads the CO tables – COBK, COEP, CFIN_COPA based on the filters stated in SLT and then starts sending the data. Duration of load can be split into TWO parts:
- Data read – It takes time to read the data in these tables and if the volume is in millions/billions the time can span in several hours like 12+ and if data volume is limited it can get complete in few hours
- Replication – CO documents are replicated via AIF. After data read step replication starts and duration depends on system performance and volume of data.
Skipping CO-PA related information during CO secondary posting replication
SAP gives option to skip the CO-Pa related postings when data transfer happen to CFIN but it should be a business decision and close consultation is required with business in order to take care of possible side effects. If its decided to skip the CO-PA information the SKIP_COPA method needs to be implemented in the BAdI BAdI_FIN_CFIN_DOCUMENT in the source system.
Check SAP Note – 2645712 – Skip COPA in CFIN CO Document
Clean-up of tables
During the replication their might be huge volume of data being accumulated in below tables so the periodic clean-up is important.
Execute this program – FIN_CFIN_CO_CLEANUP in source system
When clean up happens system considers below:
- Whether the relevant CO document has already been transferred – Based on the SLT log table entry for the document and
- Whether the retention period set for the relevant company code in the VCFIN_SOURCE_SET has already been passed.
Example of how CO tables store data (in ECC) with CFIN scenario:
CO Document # 301212848
Entry in COBK (01 line)
Lines items of same document in COEP (08 lines)
Entries in CFIN_COPA for same document (77 lines)