You are on page 1of 9

S17 - BW Modeling - OpenODS Views - Part 2

Inventory Mgmt in 1. Inventory concepts. 27th Sep: 8:30 AM - 10:30 AM


BW4HANA 2. System Demo
OpenODS View 1. Purpose
2. Usage
3. Types
Nav attributes 1. Where and how
CompositeProvider 1. Purpose
2. Usage
3. UNION & JOIN
4. 2.0 Enhancements
5. Navigation Attribute

Batch_2 Page 1
Q & A - Pre Session

Batch_2 Page 2
Inventory Mgmt in BW4HANA

Introduction ▪ Inventory Mgmt deals with:


• Stock (Qty and Value) of material kept in a plant for a customer.
• Movements (Incoming & Outgoing) of material from one place to another.
In business terminology, these are called 'Receipts' & 'Issues'.
▪ 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
Few important concepts to
understand for Inventory
Initial Stock Initial Stock This is the data which marks the current stock qty and value in source.
Historical BW/BWoH -> Opening Balance -> Markers
Deltas BW4HANA -> Opening Balance -> Reference Points
Historical data This is the historical movements before today which resulted in the initial stock.
Delta This is from today onwards what are the incoming (receipts) and outgoing (issues) movements

Validity Period Concept:


▪ Validity period defines the time since when the Keyfigure (Qty and Value) are valid from.
▪ E.g.
▪ Let us say your ADSO has 0calday, and it has data from 01-Jan-2020 to 31-Jan-2020.
Now, If you run a query and check stock balance per day per plant, it will calculate balances for each plant and show starting from 01-Jan-2020 onwards.
However, if you had a plant that became operational on 01-Jun-2020, you wouldn't want to see a 0 stock balance for it starting from 01-Jan-2020 but rather from the date the plant actually existed i.e. 01-Jun-2020.
In this case, if your validity table had only 0calday, your report would show 0 Stock for each day from
01-Jan-2020 to 01-Jun-2020 for this new plant, while if you defined the validity at plant level, you will see the report starting at 01-Jun-2020 while starting from 01-Jan-2020 for other plants.
The Validity Table automatically contains the “most detailed” of the selected time characteristics which is also known as reference characteristic.

Salient Points
▪ Validity table is automatically generated for non-cumulative (NCUM) ADSOs which contains time intervals for non cumulative key figures.
▪ Values in the validity tables can be changed later if required via tcode RSDV.
▪ This table is updated automatically when loading data.
▪ Validity table is based on time characteristic with combination of any other characteristic in the ADSO depending on the requirement.
▪ Validity characteristics form the key of the Validity table.
▪ If the Validity Table contains only the Time characteristic then the lower limit is defined with the data record that is first
according to the Time characteristic and upper limit with the highest value. If additional characteristics added in the
validity table then limits set by combination of characteristics.

Reference Pointer 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 upto date Stock Qty and Value which can be found in the ADSO.
E.g.
▪ Initially a value came in - 100 KG.
▪ 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 future or past.

Old vs New Inventory Data


Flow
Previous LSA Inventory
Dataflow

New BW4HANA
LSA++ Data Flow

Old vs New Inventory


transformation Logic
Previous Inventory
Transformations
older BW versions

New BW4HANA Inventory

Batch_2 Page 3
New BW4HANA Inventory
Transformations

Benefit of New model

Stnd Inventory Extractors

Inventory Data Load and


Model
Record Type Concept in
Inventory

Simple Rule to keep in mind:

1. Initial stock will load with Record type = 1. This will NOT go to Active data table but rather go to another table.
2. Historical movements will load with Record type = 2 and upon activation stay as Record type = 2. This will go to Active datatable.
3. Delta movements will load with Record type = 0 but upon activation will change to Record type = 2.

Non-cumulative Keyfigure
config in BW4HANA

Inventory ADSO Custom Inventory ADSO:


Config
Type: Datamart ADSO
Property: Inventory-enabled

Batch_2 Page 4
When we select 'Inventory-enabled' property, a new table 'Inventory' is added to the ADSO config and there we can:
▪ See the time reference most granular characteristic automatically chosen by the system.
▪ Provide validity characteristics in addition to the default time characteristic.

Tables for Inventory


ADSO

1. Inbound Table
2. Active Table
3. Change Log (not filled for Datamart ADSO)
4. Validity Table
5. Reference Point
6. Extraction View (UNION of Inbound + Active + Reference Table)
7. Reporting View (UNION of Inbound + Active + Reference Table)
8. External SQL View (Mimicking Query behaviour with Non-cumulative KYF populated)

Scenario
▪ On 22nd July' 2020, the initial stock balance is extracted from source to B4H.
This is the current operational stock (a.k.a 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:

Record type journey for Data Load Record Type in Inbound table Record Type in Active table Record Type in Reference table Record Type in Validity table Records in SQL View
different data load types in type (Before Activation) (After Activation) (After Activation) (After Activation) (ending in 8)
Inventory
Initial Stock Mat Plant Rectyp Iss Qty Rec Qty Calday N/A Mat Plant Rectyp Iss Qty Rec Qty Calday 0CALDAY_SID_F 0CALDAY_SID_T Mat Plant Rectyp Iss Qty Rec Qty Calday Non-Cum KYF
(Initial Stock doesn't go to (Tot Qty)
M100 P400 1 0 100 2020-07-22 M100 P400 1 0 100 2020-07-22 2020-07-22 2020-07-22
Active table)
M200 P400 1 0 200 2020-07-22 M200 P400 1 0 200 2020-07-22 M100 P400 1 00 00 9999-12-31 100
M200 P400 1 00 00 9999-12-31 200
Delta Mat Plant Rectyp Iss Qty Rec Qty Calday Mat Plant Rectyp Iss Qty Rec Qty Calday Mat Plant Rectyp Iss Qty Rec Qty Calday 0CALDAY_SID_F 0CALDAY_SID_T Mat Plant Rectyp Iss Qty Rec Qty Calday Non-Cum KYF
Movements (Tot Qty)
M100 P400 0 70 0 2020-07-23 M100 P400 2 70 0 2020-07-23 M100 P400 1 0 180 2020-07-22 2020-07-22 2020-07-24
M100 P400 0 0 150 2020-07-24 M100 P400 2 0 150 2020-07-24 M200 P400 1 0 100 2020-07-22 M100 P400 1 00 00 9999-12-31 180
M200 P400 0 100 0 2020-07-24 M200 P400 2 100 0 2020-07-24 M200 P400 1 00 00 9999-12-31 100
M100 P400 2 70 0 2020-07-23 00
M100 P400 2 0 150 2020-07-24 00
M200 P400 2 100 0 2020-07-24 00
Historical Mat Plant Rectyp Iss Qty Rec Qty Calday Mat Plant Rectyp Iss Qty Rec Qty Calday Mat Plant Rectyp Iss Qty Rec Qty Calday 0CALDAY_SID_F 0CALDAY_SID_T Mat Plant Rectyp Iss Qty Rec Qty Calday Non-Cum KYF
Movements (Tot Qty)
M100 P400 2 70 150 2020-07-17 M100 P400 2 70 0 2020-07-23 M100 P400 1 0 180 2020-07-22 2020-07-17 2020-07-24
M100 P400 2 50 0 2020-07-20 M100 P400 2 0 150 2020-07-24 M200 P400 1 0 100 2020-07-22 M100 P400 1 00 00 9999-12-31 180
M200 P400 2 300 0 2020-07-21 M200 P400 2 100 0 2020-07-24 M200 P400 1 00 00 9999-12-31 100
M100 P400 2 70 150 2020-07-17 M100 P400 2 70 0 2020-07-23 00
M100 P400 2 50 0 2020-07-20 M100 P400 2 0 150 2020-07-24 00
M200 P400 2 300 0 2020-07-21 M200 P400 2 100 0 2020-07-24 00
M100 P400 2 70 150 2020-07-17 00
M100 P400 2 50 0 2020-07-20 00
M200 P400 2 300 0 2020-07-21 00

Query for Inventory Record Type 1 (Reference Ponts) + Record type 0 (Non -activated delta movemetns sitting in Inbond table) - Record type 2 (Activated movements sitting in Active table)

Batch_2 Page 5
Process
September 27, 2020 9:04 AM

1. Flat file for Initial stock (Opening Bal)


2. Flat file for Historical mov
3. Flat file for Delta mov
4. Upload all the 3 files into 3 separate tables in B4H's HANA DB in an
external schema.
5. Create datasource (HANA Local schema) for all the 3 tables.
6. BW Flow (LSA++)
7. Load and test

Initial
Stock

Record type in Inbound table: 1


Record type in Active table: N/A

Table *5 will have the opening balance (Record type) - 1

Hist
Mov

Record type in Inbound table: 2


Record type in Active table: 2

Delta
Mov

Record type in Inbound table: 0


Record type in Active table: 2

Batch_2 Page 6
New Customer Requirement

1 • Load historical data in B4H HANA DB via flat file upload.


• Access that via OpenODS view first and do some data profiling.
• Add 'Material Category' from 0Material attributes.
• Once satisfied with the quality of data, persist the data in ADSO.
• Activate generic delta based on the HANA table.

2 • When combining historical data with current actuals data in CompProv, aggregate it upto the level without Sales
Order and Item details.
• When combining historical data with current actuals data in CompProv, remove any records which doesn't have
Distribution Channel as 'ZZ'.
• Create a calculated column for 'Update Date' since that's not in the historical data.
• Historical data doesn't contain Material Type and Material Group. Get that from the HANA CV for material via
JOIN.

3 • Load forecast data for 2021 in S4H HANA DB via flat file upload.
• Access that virtually ONLY via OpenODS View in B4H.
• When combining historical data with current actuals data in CompProv, remove any records which doesn't have
Distribution Channel as 'ZZ'.
• Forecast data doesn't have Fiscal Year, only Fiscal Period. In CompProv, create Fiscal Year from Fiscal period.
• Create a calculated column for 'Update Date' since that's not in the forecast data.
Notes Both the files are available in the Material folder in the sub-folder named 'Scenario - Report & Datasource fields'

Batch_2 Page 7
OpenODS View in B4H

Purpose • Virtual Access (doesn't have its own storage)


• If we want to access a DB table or view virtually without persisting it.
• If we want to access a direct access based datasource data virtually
• Initial check and then persist
• First virtual access
• Generate dataflow based on ADSOs
• Combine virtual data with persistent data using CompProv.
Features • Quick data access and validation.
• No need of Infoobjects
• So basically it offers good flexibility.
Example for Usage of • Access CDS view data without storing it in BW. Complete virtual access. Performance
OpenODS Views degrades with volume.
• Access local HANA DB table data via source system of type 'HANA local schema'.
• Access virtual source DB tables such as S4H tables.
Datasources for OpenODS • Local DB table or view
Views • DB table or view for tenant DB
• Virtual table based on remote source
• BW Datasource (this can be used, for example, with CDS view datasource)
• Transformation
• ADSO
• Big Data (based on remote source connecting to big data or existing BW source if
configured)

Modeling points • Need to define an overall type -


• Facts
• Master Data attributes
• Texts
• Need to define a field type - Characteristic or Keyfigure.
• Assign Semantics such as Unit to Quantity or Currency to Amount fields
• Assign Infoobjects to fields to get attributes
• Assign other ODS View
Generate Dataflow • Step 1: Generates and creates a Datasource on the same source system on which the
ODS View was created originally.
• Step 2: Generates ADSO, transformations and Infosource.
• Here you have to choose between data types as source or data types as B4H data
types (e.g. NVARCHAR to CHAR). Choosing BW4HANA datatypes is better for
analytic manager (reporting).
• The ADSO is created as a field-based Staging ADSO with compression.
• Transformation and DTP are automatically created and activated.

Batch_2 Page 8
Q & A - Post Session

Q
A

Batch_2 Page 9

You might also like