Inventory management deals with: –
When we talk about stock of material, we cannot cumulate (sum) the stock. For e.g. On 1st Jan, the stock was 100 KG and on 2nd Jan it was 90 KG, we cannot add both and say the total stock is 190 KG which would be wrong. So, by end of 2nd Jan, the total stock is 90KG. This is called non-cumulative key figure.
Therefore, when we can’t cumulate the values, we call them non-cumulative values and for non-cumulative values, we always need a time reference. E.g., If the question asked is ‘What’s the current material stock?’ then we need to ask a counter question that ‘As of what date?’. If the as of date is 1st Jan, then value is 100 and if as of date is 2nd Jan, then value would be 90. So, this time reference is used for exception aggregation.
Initial Stock: As of today, what is current total stock (Material and Plant combination). This is the data which marks the current stock qty and value in source.
Historical data: This is the historical movements before today which resulted in the initial stock. Historical data load will not impact Reference point because it has already result ed in Opening balance.
Delta: This is from today onwards what are the incoming (receipts) and outgoing (issues) movements. This will update the Reference point as it is future movement.
Reference Point:
This is the time reference for non-cumulative keyfigure.
The reference characteristic is always the most granular time characteristic in the ADSO.
Reference is the current up to date Stock Qty and Value which can be found in the ADSO.
Ex:- Initially a value came in 100 KG. and then 20KG was issued (outgoing). Pointer adjusted to 80KG (100 – 20, then 50KG was received (incoming) and 25 KG was issued (outgoing). Pointer adjusted to 105KG (80 + 50 – 25).
Reference pointer = The value of the non-cumulative KF.
This is called reference and is the first value which is used to calculate all the remaining values by traveling to the future or past.
Previous LSA Inventory Dataflow:
Old LSA Inventory Dataflow
Three Datasources in the past:
2LIS_03_BF: Movements (Historical and Delta movement). Base table MSEG and others.
2LIS_03_BX: Opening Balance (Stock Initialization) Base table MARD.
2LIS_03_UM: Revaluations (Optional). If price of material changes, then all the stocks will be re-evaluated.
*All the data is loaded into a single InfoCube.
New BW/4HANA Flow on Premise
BW/4HANA LSA++ Inventory Flow
Same three Datasource were available here also.
2LIS_03_BX: No Staging ADSO as it is a onetime full load.
2LIS_03_BF: Two Staging ADSO for Historical and Delta Movements. This will then go to three ADSO (Initial stock Quantity, Initial stock Values and Movements)
2LIS_03_UM: Revaluations only going to Material Stock Value ADSO because the revaluations do not impact the quantity, it only impacts the value.
This has simplified the design (less rule group and ABAP routine codes).
Now, SAP has replaced ABAP routines with formula in the standard content, as with the formulas we can now have HANA execution possible. Hence it is much faster now.
Record Type concept in Inventory:
Non-cumulative ADSO use the technical field ‘Record Type’ (RECORDTP). This field((RECORDTP) is not visible in TRFN and by default it will be calculated in the system in backend.
I will differentiate between the Historical movement, Delta movement and Initial Stock (Opening stock).
RECORDTP = ‘1’: Initial Stock will load with Record Type = 1. This will not go to active data table but rather go to another table. In General Properties of Datasource, it has the flag as “Opening balance”.
RECORDTP = ‘2’ Historical Movement will load with Record Type = 2 and upon activation stay as Record Type = 2. This will go to active data table.
RECORDTP = ‘0’: Delta Movement will load with Record Type = 0 and upon activation it will change to Record Type = 2.
It is very important to update the reference point every time a new delta comes in.
Also, helps in time-based archiving of a non-cumulative ADSO.
BW Modelling for Stock Flow: –
ADSO: Two types of ADSO’s can be use for modelling of Initial Stock Flow: –
Inventory ADSO Properties
We need to check the box “Inventory-Enabled” in special properties. When Inventory-Enabled checkbox is checked another tab called “Inventory” will appear for the ADSO and here we have.
We will use the non-cumulative keyfigure “0TOTALSTCK” (Total Quantity Stock), automatically two cumulative keyfigure (source of non-cumulative key figure) 0ISSTOTSTCK (Issue Stock Total Quantity) and 0RECTOTSCTK (Receipt Quantity Total Stock) will be added along with base unit of measure.
Total value is equal to total of inflow – total of outflow and this will not be calculated in ADSO layer, but it will be calculated in Query layer.
Inventory Tab: – This is specially for Inventory ADSO and appears only when we select for “Inventory-Enabled” in special properties of ADSO.
If the plant is not there on 1st Jan and comes into Picture on 1st June then the plant will only show up in the report starting from 1st June and not from 1st Jan and all the values from 1st Jan till 1st June as Zero.
The Validity Table automatically contains the “most detailed” of the selected time characteristics which is also known as reference characteristic.
Tables for Inventory ADSO
1.Inbound Table [/BIC/AADSO1]
2.Active Table [/BIC/AADSO2]
3.Change Log (not filled for Datamart ADSO) [/BIC/AADSO3]
4.Validity Table [/BIC/AADSO4]
5.Reference Point [/BIC/AADSO5]
6. Extraction View (UNION of Inbound + Active + Reference Table) [/BIC/AADSO6]
7.Reporting View (UNION of Inbound + Active + Reference Table) [/BIC/AADSO7]
8. External SQL View (Mimicking Query behaviour with Non-cumulative KYF populated [/BIC/AADSO3]
Scenario during data loading
From now onwards, delta movements, i.e., Goods issued, and Goods receipt are loaded.
Here are the initial stock, delta, and historical records to be loaded into ADSO.
Data Example
Example of Data for this Scenario
Record type journey for different data load types in Inventory
Record Type Journey
For Initial Stock
and after activation data will be deleted from here (as usual).
For Historical Movement
and after activation data will be deleted from here (as usual).
For Delta Movement
Query Result on Top of Inventory Info-Provider
Query Result
Here for Material M100 we have data from 17/09/2020 – 25/09/2020 but system has created row for 1 day before [16/09/2020] in query with [0] data.
Similarly for Material M200, It started from 21st and 300 issued on 21st, and after issuing 200 was remaining. It means on 21st what would have been the total value before the issue. Its 500 and that what system gives calculating back in time.
What system does is that if the value is not there it will add the value going back in time and it gives that this must have been the value before.
Reference
https://blogs.sap.com/2018/06/25/inventory-modeling-in-sap-bw4hana/
https://www.hanaexam.com/2018/06/inventory-management-in-sap-bw4hana.html