segunda-feira, 1 de julho de 2019

Cost Center, Profit Center & FSV Tables in S/4

Writing this blog based on my personal struggle to find out tables and how they store Cost Center, Profit Center and FSV data in S/4 HANA. This is especially more relevant for the sidecar scenario where data is replicated from S/4 HANA to HANA Enterprise for reporting purpose & we need to re-create Cost Center, Profit Center and FSV hierarchies in HANA Enterprise just like how they exist in S/4 HANA.
FSV is covered in a separate blog, you can check it here.
Let’s start with Cost Center and Profit Center hierarchies, main tables involved are SETHEADERT (stores text descriptions of nodes),  SETNODE (stores hierarchy nodes), SETLEAF (stores actual Cost Center/Profit Center numbers)
Both Cost Center and Profit Center hierarchies’ data are maintained in the same database tables, for explanation purpose I am using Cost Center however you can also retrieve Profit Center hierarchy using the same tables and steps.
As a first step, you may like to see the standard Cost Center Hierarchy in ECC or S/4 system, use tcode: OKEON/OKEN to check Cost Center hierarchy and to check Profit Center hierarchy use tcode KCH4.
Cost Center Hierarchy screenshot:

Steps to retrieve Cost Center/Profit Center hierarchies from database tables:
1. First, let’s try to get the header/main node of the CC hierarchy (Root Node), marked in green in below screenshot:

Table: SETHEADERT
  • In ‘Set Class’ pass 0101, please note for Cost Center Set Class is always 0101 and for Profit Center, it is 0106
  • In ‘Org.Unit’ enter your organization unit/controlling area, in my case, it is 2000
  • In ‘Set Name’ enter value that you see at the top of CC hierarchy in the above screenshot, it is 2000 (marked in orange)

The output of this table will give you CC Header and its description:

2. Now let’s get node under header 2000 (Level 1), marked in Green in below screenshot

Table: SETNODE
  • In Set Class pass 0101 for Cost Center Set Class is always 0101
  • In Org.Unit enter your organization unit, in my case, it is 2000
  • In Set Name enter 2000, it may be different in your case

Output field Subset ID of this table will give you items under the header node:

3.Now to get nodes under USABB or CANADA or FMOPS again use SETNODE table and pass these as Set Name (Level 2):

For node under USABB

For node under CANADA

For node under FMOPS

Output for USABB:

Now to get nodes under FMCORP or SC or PI or MRO, again use SETNODE table and pass these as Set Name (Level 3), marked in Green in below screenshot:

Table: SETNODE
  • In Set Class pass 0101 for Cost Center Set Class is always 0101
  • In Org.Unit enter your organization unit, in my case, it is 2000
  • In Set Name enter FMCORP OR PI OR SC OR MRO

Output for FMCORP:

Repeat this process until you reach to the last node or leaf node, in below example Canada does not have any node underneath it, it has a Cost Center assigned to it but no child node hence Canada is a leaf node and when you reach to the leaf node you will not find any entry in SETNODE table :

SETNODE output for Canada:

Finally, to get Cost Center numbers under leaf node (in this example, Canada) you need to use table SETLEAF:



Hopefully this blog will help you in recreating CC, PC hierarchies in your BI platform.


Source: https://blogs.sap.com/2019/06/29/cost-center-profit-center-fsv-tables-in-s4/

Nenhum comentário:

Postar um comentário