Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
prem_shanker
Participant
0 Kudos
Inventory management deals with: -

  • Stock (Qty and value) of material kept in a plant for a customer.

  • Movements (Incoming and outgoing) of material from one place to another. Also called ‘Receipts’(Incoming) and ‘issues’(Outgoing).


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.

  • BW/BWoH -> Opening Balance -> Markers [Markers were stored in Active table]

  • BW4HANA -> Opening Balance -> Reference Points [Markers are now called as Reference points]. Reference points are no longer stored in the active table. Reference point (Opening balance) are now stored in special table (reference point table).


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: -

  • Standard ADSO with change log: We need to make sure that the Key Figure aggregation behaviour is Summation as the datasource gives ABR.

  • Data Mart ADSO: Automatically aggregation behaviour is always summation.



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.

  • Reference Time characteristics: - By default it will take lowest granularity of time characteristics.

  • Validity Period: - Validity period defines the time since when the Keyfigure (Qty and Value) are valid from. (Here it will take 0CALDAY by default).


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

  • On 22nd July' 2020, the initial stock balance is extracted from source to B4H.This is the current operational stock (Opening balance).

  • To be able to report on stock quantities before 22nd July' 2020, we also load historical movements that happened before we extracted the initial stock balance.


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

  1. Inbound table: - The Initial stock will be loaded into Inbound table with Record Type = 1.


and after activation data will be deleted from here (as usual).

  1. Active Table: - No Involvement of Active table in this scenario.

  2. Validity table: - The Validity will be updated in CALDAY From(0CALDAY_F) and CALDAY To (0CALDAY_T) column.

  3. Reference Point: - Once the Initial Stock is activated it will go in the Reference Point table. Here it will load into Receipt as in is Initial stock and is considered as Incoming [Record Type = 1].

  4. External SQL View: - Here Non-Cumulative value will be populated and Calday/Calmonth will become end of Time 9999-31-12.


For Historical Movement

  1. Inbound table: - The delta records will be loaded into Inbound table with Record Type = 2.


and after activation data will be deleted from here (as usual).

  1. Active Table: - After activation data comes to Active table with Record Type = 2.

  2. Validity table: - The Validity table CALDAY From(0CALDAY_F) column will be updated (as Historical load is past data) from the Calday coming in historical movements.

  3. Reference Point: - Historical movement (Record Type = 2.) does not update the reference point. {As the historical movement has already updated the reference point and Initial stock balance is result of Historical movement}. No Change in Reference Point table.

  4. External SQL View: - For Record Type 2 we cannot see the non-Cumulative value but it’s the Inbound and Outbound which will be populated.


For Delta Movement

  1. Inbound table: - The delta records will be loaded into Inbound table with Record Type = 0 and after activation data will be deleted from here (as usual).

  2. Active Table: - After activation data comes to Active table with Record Type = 2.

  3. Validity table: - The Validity will be updated in CALDAY To (0CALDAY_T) with the latest date.

  4. Reference Point: - Delta movement will update the Reference Point. Record Type will still be 1 here.

  5. External SQL View: - For Delta movement also we cannot see the non-Cumulative value but it’s the Inbound and Outbound which will be populated


 

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
4 Comments
Labels in this area