You are on page 1of 174

COGNOS(R) ENTERPRISE BUSINESS

INTELLIGENCE
C O G N O S A N A L Y T I C
A P P L I C A T I O N S
INVENTORY ANALYSIS FOR SAP
( R)
DEVELOPER GUIDE

Cognos Analytic Applications Inventory Analysis for SAP


Developer Guide
01-11-2001
e-Apps - Inventory
1.6
Type the text for the HTML TOC entry
Type the text for the HTML TOC entry
Type the text for the HTML TOC entry
Type the Title Bar text for online help
Cognos Analytic Applications Inventory Analysis for
(R)
SAP Version 1.6

Developer Guide

T H E N EX T L EVE L
TM
O F PER FO R M A N C E
Product Information
This document applies to Cognos Analytic Applications Inventory Analysis for SAP ( R ) Version 1.6 and may also apply to subsequent
releases. To check for newer versions of this document, visit the Cognos support Web site (http://support.cognos.com).

Copyright
Copyright (C) 2003 Cognos Incorporated
While every attempt has been made to ensure that the information in this document is accurate and complete, some typographical errors or
technical inaccuracies may exist. Cognos does not accept responsibility for any kind of loss resulting from the use of information contained in
this document.
This document shows the publication date. The information contained in this document is subject to change without notice. Any
improvements or changes to either the product or the document will be documented in subsequent editions.
U.S. Government Restricted Rights. The software and accompanying materials are provided with Restricted Rights. Use, duplication, or
disclosure by the Government is subject to the restrictions in subparagraph (C)(1)(ii) of the Rights in Technical Data and Computer Software
clause at DFARS 252.227-7013, or subparagraphs (C) (1) and (2) of the Commercial Computer Software - Restricted Rights at
48CFR52.227-19, as applicable. The Contractor is Cognos Corporation, 15 Wayside Road, Burlington, MA 01803.
This software/documentation contains proprietary information of Cognos Incorporated. All rights are reserved. Reverse engineering of this
software is prohibited. No part of this software/documentation may be copied, photocopied, reproduced, stored in a retrieval system,
transmitted in any form or by any means, or translated into another language without the prior written consent of Cognos Incorporated.
Cognos and the Cognos logo are trademarks of Cognos Incorporated in the United States and/or other countries. All other names are
trademarks or registered trademarks of their respective companies.
Information about Cognos Products and Accessibility can be found at www.Cognos.com
Table of Contents

Welcome 5
Chapter 1: JobStream and Build Descriptions 7
Dimensions 7
Facts 7
Build Relationships 8
JobStream Descriptions 9
All Time 9
Batch 13
Business Area 16
Customer 18
Financial Currency Conversion 24
Material 28
Material Movement Activity 31
Material Movement Document Class 34
Material Reservation 37
Material Storage 40
Physical Inventory 42
Plant 44
Re-Ranking 48
Stock Class 50
Stock Overview 54
Stock Usage Forecast 62
Stock Usage Forecast Method 64
Storage Bin 66
Unit of Measure 68
Valuation 71
Vendor 73
Chapter 2: Entity Relationship Diagrams 77
Material Movement 78
Physical Inventory 79
Material Reservation 80
Stock Overview 81
Stock Usage Forecast 82
All Dimensions (I) 83
All Dimensions (II) 84
Chapter 3: Data Mart Metadata 85
All Time 85
Batch 89
Business Area 92
Customer 93
Financial Currency Conversion 101
Material 103
Material Movement Detail 108
Material Movement Document 114
Material Movement Document Class 116
Material Reservation Detail 120
Material Reservation Document 124
Material Storage 126

Developer Guide 3
Physical Inventory Detail 129
Physical Inventory Document 133
Plant 134
Stock Class 138
Stock Opening Balance 140
Stock Overview 148
Stock Usage Forecast 154
Stock Usage Forecast Method 156
Stockout 157
Storage Bin 158
Unit of Measure 163
Unit of Measure Conversion 165
Valuation 168
Vendor 170
Index 173

4 Cognos Analytic Applications Inventory Analysis for SAP( R )


Welcome

What Is in This Document


The Developer Guide contains reference material on the data warehouse architecture and the
Cognos DecisionStream JobStreams used to deliver data to the data warehouse.
This book contains
• a description of the fact build and dimension build logic and build relationships
• entity relationship diagrams for all of the facts
• data warehouse metadata tables

Other Information
Our documentation includes user guides, reference books, and other pieces to meet the needs
of our varied audience.
The information is available in online book format (PDF). You can print selected pages, a
section, or the whole book. Cognos grants you a non-exclusive, non-transferable license to use,
copy, and reproduce the copyright materials, in printed or electronic format, solely for the
purpose of providing internal training on, operating, and maintaining the Cognos software.
The online books are available from the Windows Start menu (Cognos). You can also read the
product readme files and the installation guides directly from the Cognos product CDs.
The following documents contain related information, and may be referred to in this document.

Topic Location
How to install and configure Cognos Installation Guide
Analytic Applications.

How to use Cognos Analytic User Guide


Applications to extract and load SAP
data into a data warehouse.

How to work with Cognos Analytic Report Administration Guide


Applications reports

Because Cognos Analytic Applications works closely with Cognos DecisionStream, you may
need to consult the Cognos DecisionStream documentation as you work with the product.

Questions or Comments?
For the fastest response to questions about using Cognos Analytic Applications, contact
customer support.
For information about customer support locations and programs, visit the Cognos Support Web
site (http://support.cognos.com).

Developer Guide 5
Welcome

6 Cognos Analytic Applications Inventory Analysis for SAP( R )


Chapter 1: JobStream and Build Descriptions

Most JobStreams correspond to one or more data warehouse tables and handle the extraction,
transformation, and loading of data into the data warehouse. All data extractions have the
following features:
• There is one set of object code for the initial load and for changed data capture.
• You can run data extractions at any interval; that is, daily, weekly, or monthly.
• Using the Applications Console, you can override the start and end dates and times for
extracted data (Extract From Date/Time, Extract To Date/Time).
• Overlapping data extraction periods doesn’t compromise data integrity.

Dimensions
A JobStream for a dimension table consist of a fact build and a dimension build. A fact build is
used to extract the source data. The data is then transformed and delivered into a temporary
table in the datamart, usually called DEX table. The temporary table is used as a data source for
the dimension build. The dimension build identifies Type II fields, generates the SID (surrogate
key), and delivers the data into the waiting dimension table. All the dimension tables have a
DIM_ID field that contains the concatenated natural key used to generate the SID.

Facts
There is usually a Document dimension that accompanies the fact table. The dimension and fact
table are extracted together to reduce redundant processing. The JobStream for a fact table
consist of a number of fact builds. A fact build is used to extract the source data necessary for
both the Document and Detail tables. The data is then transformed and delivered into a
temporary table in the datamart, usually called FEX table. The temporary table is used as a data
source for subsequent fact builds.
A number of transformations are conducted in the final fact build. The fact build generates the
SID for the Document dimension, Lookup the SID for the dimensions on the fact table,
determine whether the input record has changed, and deliver the input records to the Document
dimension and fact table.
The SID is generated using the NEXT_SID(char) user-defined function. A Lookup is used to see
if the input record exists in the datamart. The Lookup joins the temporary table to the Document
dimension. If Lookup fails, that is the input record does not exist in the datamart, then it is
assigned the next SID.
The Lookup is also used to return the datamart record when the input records exist. A
Derivation is used to compare the datamart record to the input record. A Boolean value is
returned if any differences were detected. There is a separate Derivation for the Document
dimension and the fact table. The Derivations are used in the delivery process.
The Document dimension and fact each have a Relational Table Delivery for new records and
changed records. The deliveries for new records are APPEND only while the deliveries for
changed records are UPDATE only. The output filter determines if the input record should be
delivered to the datamart. Input records that are not new records and has not changed are
discarded.
There are different flavors of builds for fact tables. One such implementation uses a second data
source that replaces the Lookup. The input data from the data sources are then merged to
determine if the record exists in the datamart. Both methods accomplish the same thing.

Developer Guide 7
Chapter 1: JobStream and Build Descriptions

JobStreams can vary depending on the complexity of the data sources and its transformation.
They usually have the characteristics described above with the exception of ALL_TIME and
FINANCIAL_CURRENCY.

Build Relationships
The following table lists the JobStreams that come with the Inventory Analysis for SAP
application and the builds contained in each JobStream. The builds are listed in the order that
they appear in the corresponding JobStream.

JobStream Fact Builds Dimension Builds


ALL_TIME FISCAL_B_01
FISCAL_B_02
FISCAL_B_03
FISCAL_B_04
BATCH BATCH_B_01 BATCH_D_03
BATCH_B_02

BUSINESS_AREA BUSINESS_AREA_B_01 BUSINESS_AREA_D_02

CUSTOMER CUSTOMER_B_01 CUSTOMER_D_05


CUSTOMER_B_02 CUSTOMER_HIER_D_01
CUSTOMER_B_03
CUSTOMER_B_04
CUSTOMER_HIER_B_02

FINANCIAL_CURRENCY FINANCIAL_CURRENCY_B_01
FINANCIAL_CURRENCY_B_02
FINANCIAL_CURRENCY_B_03
FINANCIAL_CURRENCY_B_04
FINANCIAL_CURRENCY_B_05
FINANCIAL_CURRENCY_B_06
MATERIAL MATERIAL_B_01 MATERIAL_D_03
MATERIAL_B_02

MATERIAL_MOVEMENT_ACTIVITY MTRL_MVMNT_DTL_DOC_B_02
MTRL_MVMNT_DTL_DOC_INS_B_01
MTRL_MVMNT_DTL_DOC_UPDINS_B_01

MATERIAL_MOVEMENT_DOCUMENT_CLASS MOVEMENT_DOC_CLSS_B_01
MOVEMENT_DOC_CLSS_B_02
MOVEMENT_DOC_CLSS_B_03

MATERIAL_RESERVATION MTRL_RSRVTN_DTL_DOC_B_01
MTRL_RSRVTN_DTL_DOC_B_02

MATERIAL_STORAGE MATERIAL_STORAGE_B_01 MATERIAL_STORAGE_D_02

PHYSICAL_INVENTORY PHYSICAL_INV_DTL_DOC_B_01
PHYSICAL_INV_DTL_DOC_B_02

PLANT PLANT_B_01 PLANT_D_03


PLANT_B_02

RE-RANKING

STOCK_CLASS STOCK_CLASS_B_01
STOCK_CLASS_B_02

STOCK_OVERVIEW RANKING_TABLE_B
STOCKOUT_B_01
STOCK_OPENING_BAL_B
STOCK_OVERVIEW_B

STOCK_USAGE_FORECAST STOCK_USAGE_FRCST_B_01
STOCK_USAGE_FRCST_B_02

STOCK_USAGE_FORECAST_METHOD STK_USG_FRCST_MTHD_B_01 STK_USG_FRCST_MTHD_D_02


STORAGE_BIN STORAGE_BIN_B_01 STORAGE_BIN_D_02

8 Cognos Analytic Applications Inventory Analysis for SAP( R )


Chapter 1: JobStream and Build Descriptions

JobStream Fact Builds Dimension Builds


UNIT_OF_MEASURE UNIT_OF_MEASURE_B_01 UNIT_OF_MEASURE_D_02
UNIT_OF_MEASURE_CNVRSN_B
VALUATION VALUATION_B_01 VALUATION_D_02

VENDOR VENDOR_B_01 VENDOR_D_05


VENDOR_B_02 VENDOR_HIER_D_01
VENDOR_B_03
VENDOR_B_04
VENDOR_HIER_B_02

JobStream Descriptions
This section describes each JobStream in detail.

All Time
Description
The Time dimension is probably the most important dimension in a data warehouse schema,
because the majority of business questions that it supports look at historical changes in various
business measures.
The All Time dimension is a combination of the Fiscal and Time calendars. Fiscal calendars
represent the yearly period for accounting purposes within an organization. The Fiscal
dimension is important in merged or multinational companies that are required to consider
multiple fiscal calendars. This dimension is flexible enough to accommodate all fiscal calendars
in an organization.
The All Time dimension brings the two logical entities, Fiscal and Time, together into a single
super-entity using a process called denormalization. Denormalization is for faster query
processing, an important requirement in data warehousing. Such a combination is called a
cartesian product in the language of set theory. Being a cartesian, the All Time dimension
contains a row for each day of the calendar year for each fiscal calendar variation (fiscal variant)
supported. Hence, this dimension may have the same calendar day repeated multiple times,
once for each fiscal variant. Because of this repetition, you must be careful while joining the All
Time dimension to any of the fact tables in a query. You must define a fiscal variant in the query
to prevent double-counting of fact records. To avoid double-counting in the majority of queries
that do not need to look at fiscal calendars, a default fiscal variant exists in this data model to
define the regular calendar year, with 12 monthly periods and four seasonal quarters. You can
create additional fiscal variants to support financial analysis and planning for other financial
calendars.
The key (DIM_ID) is composed of the following attributes:
• FISCAL_VARIANT_CD
• TIME_SID
All_Time is a non-CDC (Changed Data Capture) table dimension but with a unique and
extremely important difference. That is, the All_Time processing only appends rows to the
dimension. Any existing rows previously loaded cannot be re-created or modified.
Loading the All_Time dimension consists of four major steps:
1. Load the Time work table using database trigger and stored procedure.
2. Extract date dependant, calendar dependant and non-year dependant fiscal information.
3. Load the Fiscal work tables.
4. Load the All_Time dimension.

Developer Guide 9
Chapter 1: JobStream and Build Descriptions

Impact of Conformed Dimension


This is a shared dimension that is common to
• Accounts Payable Analysis
• Accounts Receivable Analysis
• General Ledger Analysis
• Inventory Analysis
• Procurement Analysis
• Sales Analysis
Care must be taken when installing dimensions, particularly when there is more than one
application. Installing a newer (or same) version of this dimension over an existing one will
replace the entire table and its contents will be lost. If you wish to retain existing data, save a
copy of the data and reload it after the dimension has been upgraded.
If any other warehouse is already installed, check Installation Guide for any important
information on integration with other Analytic Application data marts. That documentation will
describe any manual intervention required.

Dependencies
None.

Configuration Parameters
• MART_BEGIN_DATE
This is the starting date of the data warehouse. It marks the earliest valid date which can be
specified within the warehouse and must be set to accommodate the earliest date required
for data extraction from the ERP. If multiple applications are being installed, this date must
be set for the earliest requirement. Any date lower than what is specified for this parameters
will be converted to the default 'low' date of 19000101.
• MART_END_DATE
This is the ending date of the data warehouse. It marks the latest valid date which can be
specified within the warehouse and should be initially set to some date 10 or 20 years in the
future. Any higher value will be converted to the default 'high' date of 99991231.

User Intervention:
• Manual Table
In the event All_Time needs to be re-executed under one (1) of the scenarios mentioned
below, the All_Time job must first be manually taken off-hold.
• Mart_Begin_Date/Mart_End_Date
To control the date range for which All_Time will be loaded, the
Mart_Begin_Date/Mart_End_Date range may be set either specifically or by limiting the
time span for which an extraction will be done.
However, note that in the event All_Time has been previously loaded the Mart_Begin_Date
will be ignored in cases where a given Fiscal_Variant_Cd already exists for the time frame
specified. New rows will be appended beginning at the end of the existing range already
loaded (determined by retrieving Maximum Time_Sid for Fiscal_Variant_Cd) and ending at
the Mart_End_Date specified.
After initial load, All_Time processing should/will only be executed under one of the following 3
scenarios:
1. A new Fiscal_Variant_Cd needs to be added to All_Time (see Manual Table above).
2. The Mart_End_Date is moved forward into the future and All_Time needs to be loaded up to
this date (see Manual Table above).
3. Sufficient time has elapsed so that the on-hold period has expired (occurs Automatically).

10 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

Job Flow:
1. ALL_TIME_J / INIT_P
• Calls function ALL_TIME_VARS_F() to set the jobflow parameters
• Truncates work-table TIME_EX1.
• Inserts a single row into Work-table TIME_TRGGR_ACT_EX1. Insertion of this row causes
a database trigger on this table to execute, which in turn executes the stored procedure
PROC_SPAN_ALL_TIME_DATE_RANGE using the Mart_Begin_Date and Mart_End_Date
specified. This procedure then loads the Work-table TIME_EX1 for the entire date range
specified. This table is then used as input during later processing.
2. ALL_TIME_J_B_01_SJ / FISCAL_B_01
• Consists of 3 data sources
T009,T009B_DATE_DEPENDANT
T009,T009B_NON_YEAR_DEPENDANT
T009_CALENDAR_DEPENDANT
• Input Properties: allow duplicate keys
• Extracts Date Dependant fiscal info from SAP tables T009 and T009B
FROM "T009B" T9B,
"T009" T9
WHERE T9B."PERIV" = T9."PERIV"
AND T9."XJABH" = 'X'
• Extracts Calendar Dependant fiscal info from SAP tables T009 and T009B
FROM "T009B" T9B,
"T009" T9
WHERE T9B."PERIV" = T9."PERIV"
AND T9."XJABH" <> 'X'
AND T9."XKALE" <> 'X'
AND T9B."BDATJ" = '0000'
• Extracts Non-Year Dependant fiscal info from SAP table T009
FROM "T009"
WHERE "XKALE" = 'X'
• Lookup Fiscal Variant name on SAP table T009T and T001. NOTE: the un-checked "include
unmatched members" check-box acts as a filter for the number of rows delivered to the
Fiscal_Ex1 table. Only FISCAL_B_01 rows where the matching Fiscal_Variant_Cd is found
by this lookup will be inserted by FISCAL_B_01.
FROM "T009T" T9,
"T001" T1
WHERE T9."SPRAS" = '{$U_LANGUAGE_CD}'
AND T9."PERIV" = T1."PERIV"
• Output is FISCAL_EX1. Delivery type is Truncate. Filter on delivery is
ToInteger(POSTING_PERIOD_NO) <=
ToInteger(POSTING_PERIOD_CNT)
• SQL-Node POPULATE_NON_YR_ROWS:
retrieves Non-Year rows from FISCAL_EX1, performs further transformations on these rows
and inserts the transformed rows into FISCAL_EX1.
• SQL-Node POPULATE_CALENDAR_YR_ROWS:
retrieves Calendar rows from FISCAL_EX1, performs further transformations on these rows
and inserts the transformed rows into FISCAL_EX1.
• SQL-Node DELETE_CALENDAR_AND_NON_YR_ROWS:
deletes all rows from FISCAL_EX1 retrieved by the two (2) SQL-Nodes above. These rows
have now been replaced by the transformed rows generated by those SQL-Nodes.
3. ALL_TIME_J_B_02_SJ / FISCAL_B_02
• Input Properties: allow duplicate keys
• Extracts the Fiscal Variant, Fiscal Month, Year Offset, Calendar Day and Posting Period info
FROM FISCAL_EX1
• Lookup Fiscal_Sid
FROM "FISCAL_EX1"
• Output is FISCAL_EX2.
Delivery type is truncate.

Developer Guide 11
Chapter 1: JobStream and Build Descriptions

4. ALL_TIME_J_B_03_SJ / FISCAL_B_03
• Input Properties: allow duplicate keys
• Extracts Fiscal, Calendar and Posting info
FROM "FISCAL_EX2"
ORDER BY
"FISCAL_VARIANT_CD",
"PST_PRD_END_DT"
• Output is FISCAL_EX3_INS.
Delivery type is truncate.
5. ALL_TIME_J_B_04_SJ / FISCAL_B_04
• Input Properties: allow duplicate keys
• Pre-Procedure: Sets local variable values
$L_LAST_FISCAL_VARIANT_CD:= '-';
$L_PREV_FISCAL_YEAR_VAL:= 0;
$L_PREV_PST_PRD_END_DT:=0;
$L_PST_PRD_STRT_DT:= 0;
FISCAL_EX3_TIME_EX1
• Extracts Fiscal, Calendar and Posting info
FROM
(FROM FISCAL_EX3 T4,
ALL_TIME T5
WHERE T4.FISCAL_VARIANT_CD = T5.FISCAL_VARIANT_CD (+)
AND T4.FISCAL_PERIOD_SID <>0
AND T4.FISCAL_PERIOD_SID <>99990101
GROUP BY T4.FISCAL_VARIANT_CD) T1,
TIME_EX1 T2, FISCAL_EX3 T3
WHERE T2.TIME_SID > T1.LAST_MAX_TIME_SID
AND T3.FISCAL_VARIANT_CD = T1.FISCAL_VARIANT_CD
AND T2.TIME_SID <> 0
AND T2.TIME_SID <> 99990101
AND T2.TIME_SID BETWEEN
T3.PST_PRD_STRT_DT AND T3.PST_PRD_END_DT
GROUP BY T2.TIME_SID,
T2.CALENDAR_YEAR_VAL,
T2.CALENDAR_QRTR_VAL,
T2.CALENDAR_MONTH_VAL,
T2.CALENDAR_WEEK_VAL,
T2.CALENDAR_DAY_VAL,
T2.CALENDAR_DT,
T2.CALENDAR_WKDY_NM,
T1.FISCAL_VARIANT_CD
ORDER BY T1.FISCAL_VARIANT_CD,
T2.TIME_SID
• Output is ALL_TIME.
Delivery type is Append.

Source Tables/Files
• T009 Fiscal year variants
• T009B Fiscal year variant periods
• T001 Company Codes

Target Tables/Files
• ALL_TIME

Work Tables
• TIME_EX1
• FISCAL_EX1
• FISCAL_EX2
• FISCAL_EX3_INS
• TIME_TRGGR_ACT_EX1

12 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

Stored Procedure
• PROC_SPAN_ALL_TIME_DATE_RANGE
Loads Time_Ex1 work-table for the full date range specified between Mart_Begin_Date and
Mart_End_Date inclusive.

Trigger
• TRIGGER_DATE_RANGE on table TIME_TRGGR_ACT_EX1
Trigger executes on Insertion of row into this table. Executes stored procedure
PROC_SPAN_ALL_TIME_DATE_RANGE (see above)

Notes/Filters
None.

Validation
1. Check Console Log Files.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check file FISCAL_B_01.REJ for records rejected; usually caused by inactive Fiscal
Variants.
4. Check the table count and zero-sid rows
SELECT COUNT(*) FROM ALL_TIME;
SELECT * FROM ALL_TIME
WHERE CLNDR_FSCL_PRD_NO = 0;
SELECT * FROM ALL_TIME
WHERE FISCAL_VARIANT_CD = '-';
5. Check the fiscal variants
SELECT DISTINCT DFLT_FSCL_VRNT_CD
FROM ALL_TIME;
SELECT DISTINCT FISCAL_VARIANT_CD
FROM ALL_TIME;
6. Check the contents of each fiscal variant
SELECT FISCAL_VARIANT_CD, PST_PRD_STRT_DT, PST_PRD_END_DT
FROM ALL_TIME
WHERE FISCAL_PERIOD_SID > 0
ORDER BY FISCAL_VARIANT_CD;
SELECT * FROM ALL_TIME
WHERE FISCAL_PERIOD_SID > 0
ORDER BY FISCAL_VARIANT_CD;

Batch
Description
This table is a grouping of material manufactured in a single production run that is managed
together. In material management terminology, this group is known as a batch or lot. Companies
use batches to identify and manage a group of materials with the same characteristics. Batch is
an Incremental table and is unique to the Inventory Analysis Application.
The Batch key (DIM_ID) is composed of the following attributes:
• BATCH_NO
• PLANT_ID
• MATERIAL_ID
This is a Type 1 (non-History Preserving) dimension. If Tracking Changes (SCD) is enabled in
the dimension delivery then, for performance reasons, a (non-unique) index is required on
column BATCH_DIM_ID.
This is a CDC (Changed Data Capture) table dimension.

Developer Guide 13
Chapter 1: JobStream and Build Descriptions

Data extraction from the ERP source, for each run, is controlled/limited by the From/To
extraction Dates as specified by the related Jobflow Properties in the Analytic Applications
Console. Only those records which are new or modified since the last extraction will be selected
for processing. Since this is an incremental dimension, the Mart Begin Date parameter should
be set (via the console) to match the ERP's beginning date while this table is initially being
loaded in order to ensure that all records are selected from the source.
Batch table is loaded using three stages.
1. Extracts combination of Batch, Plant & Material info from SAP tables MCHA and MCH1
2. Extracts Batch & Material info from SAP table MCH1. Plant is 'UNKNOWN'.
3. Loads target dimension

Impact of Conformed Dimension


None. This is unique to the Inventory Analysis application.

Dependencies
None.

Configuration Parameters:
None.

User Intervention:
User Interface
• Pre-Run
Before initially loading this table, set the Mart Begin Date back to the ERP's beginning date
in order to ensure that all source Batch records will be retrieved. In the console, set the
parameter value to the necessary early date and save. For the duration of this table's initial
load job(s), ensure that no other jobs are run.
• Post-Run
When the Batch table initial load is complete, ensure that the Mart Begin Date parameter is
properly reset to its defined configuration value.
CDC Dates
• CDC_EXTRACT_FROM_DATE
• CDC_EXTRACT_TO_DATE
To limit the volume of data retrieved from SAP, particularly during historical data loads, the
CDC_ExtractFrom/To_Date range may be set either specifically or by limiting the time span
for which an extraction will be done.

Job Flow
1. BATCH_J / INIT_P
• Calls function BATCH_VARS_F to set the jobflow parameters.
2. BATCH_J_B_01_SJ / BATCH_B_01
• Input Properties: allow duplicate keys
• Extracts Batch, Plant, and Material info from SAP tables MCHA and MCH1 for creation date
or changed date within the CDC Extract Date range:
FROM MCHA LEFT OUTER JOIN MCH1 ON (MCHA.CHARG = MCH1.CHARG) AND
(MCHA.MATNR = MCH1.MATNR)
WHERE
((MCHA.ERSDA >= date '{$S_CDC_EXTRACT_FROM_FDATE}' AND
MCHA.ERSDA <= date '{$S_CDC_EXTRACT_TO_FDATE}')
OR
(MCHA.LAEDA >= date '{$S_CDC_EXTRACT_FROM_FDATE}' AND
MCHA.LAEDA <= date '{$S_CDC_EXTRACT_TO_FDATE}'))
• Output is BATCH_DEX.
Delivery Type is Truncate

14 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

3. BATCH_J_B_02_SJ / BATCH_B_02
• Input Properties: allow duplicate keys
• Extracts Batch, Plant, and Material info from SAP table MCH1 for creation date or changed
date within the CDC Extract Date range:
FROM MCH1
WHERE
((MCH1.ERSDA >= date '{$S_CDC_EXTRACT_FROM_FDATE}' AND
MCH1.ERSDA <= date '{$S_CDC_EXTRACT_TO_FDATE}')
OR
(MCH1.LAEDA >= date '{$S_CDC_EXTRACT_FROM_FDATE}' AND
MCH1.LAEDA <= date '{$S_CDC_EXTRACT_TO_FDATE}'))
• Output is BATCH_DEX.
Delivery type is Append
4. BATCH_J_B_03_SJ / BATCH_D_03
• Loads dimension BATCH from BATCH_DEX
5. BATCH_J / END_P
• Post Procedure:
Update BATCH_SCD
(table used by stored procedures in cases where the dimension is defined as Type 2 'history
preserving')

Source Tables/Files
• MCH1 Batches (if Batch Management Cross-Plant)
• MCHA Batches

Target Tables/Files
• BATCH

Work Tables
• BATCH_DEX
• BATCH_SCD

Stored Procedure
None.

Trigger
None.

Notes/Filters
None.

Validation
1. Check Console Log Files.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check for rows with zero SIDs.
4. Check the DIM_ID field and component fields.
5. Check counts, values and ranges for each key field component.
6. Check Type 2 attributes for changes (if applicable).
7. Check row count against source table row count.
8. For selected records, review and verify the target warehouse against the source ERP data.

Developer Guide 15
Chapter 1: JobStream and Build Descriptions

Business Area
Description
This is an organizational unit within financial accounting that represents a separate area of
operations or responsibilities within an organization. Financial accounting transactions can be
allocated to a specific business area.
Business Areas permit external reporting of key performance indicators across multiple
companies by product lines and/or subsidiaries. Alternatively, business area can mean an
organizational entity for which "balance sheets" as well as "profit and loss statements" can be
created for internal reporting. Unlike the company identifier, the business area is not a legally
independent entity and is therefore not subject to the legal requirements for external reporting.
The Business Area key (DIM_ID) is composed of one attribute:
• BUSINESS_AREA_CD
Business Area is a Type 1 (non History Preserving) dimension.
This is a Type 1 (non-History Preserving) dimension. If Tracking Changes (SCD) is enabled in
the dimension delivery then, for performance reasons, a (non-unique) index is required on
column BUSINESS_AR_DIM_ID.
Since there are no CDC dates available in this table, the contents must be extracted to the data
warehouse server in order to identify and process any new/changed records.
Loading the Business Area dimension consists of two steps:
1. Extracting the business area information.
2. Loading the target dimension (creating surrogate key, created and changed dates).

Impact of Conformed Dimension


This is a conformed dimension, which is common to the following applications.
• General Ledger Analysis
• Inventory Analysis
Care must be taken when installing dimensions, particularly when there is more than one
application. Installing a newer (or same) version of this dimension over an existing one will
replace the entire table and its contents will be lost. If you wish to retain existing data, save a
copy of the data and reload it after the dimension has been upgraded.
If any other warehouse is already installed, check Installation Guide for any important
information on integration with other Analytic Application data marts. That documentation will
describe any manual intervention required.

Configuration Parameters
None.

Dependencies
None.

User Intervention
None.

Job Flow
1. BUSINESS_AREA_J / INIT_P
• Calls function BUSINESS_AREA_VARS_F() to set the job flow parameters.

16 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

2. BUSINESS_AREA_01_SJ / BUSINESS_AREA_B_01
• Extracts Business Area and Consolidation Business Area from SAP table TGSB
• Lookup BUSINESS_AREA_CD Name on SAP table TGSBT
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup CNSLDTN_BA_CD Name on SAP table TGSBT
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Output is BUSINESS_AREA_DEX Delivery type is truncate.
3. BUSINESS_AREA_01_S2 / BUSINESS_AREA_D_02
• Loads dimension BUSINESS_AREA from BUSINESS_AREA_DEX
• Output is BUSINESS_AREA.
Delivery type is update/insert.
4. BUSINESS_AREA_J / END_P
• Post Procedure: Update BUSINESS_AREA_SCD (table used by stored procedures in
cases where the dimension is defined as Type 2 'history preserving').

Source Tables/Files
• TGSB Business Areas
• TGSBT Business Areas Names
• TGSBL Text table for TGSBK

Target Tables/Files
• BUSINESS_AREA

Work Tables
• BUSINESS_AREA_DEX
• BUSINESS_AREA_SCD

Stored Procedure
None.

Trigger
None.

Notes/Filters
None.

Validation
1. Check the Console log files for errors.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check for rows with zero SIDs.
4. Check the DIM_ID field and component fields.
5. Check counts, values and ranges for each key field component.
6. Check Type 2 attributes for changes (if applicable).
7. Check row count against source table row count.
8. For selected records, review and verify the target warehouse against the source ERP data.

Developer Guide 17
Chapter 1: JobStream and Build Descriptions

Customer
Description
This describes customers, such as the ones being Sold-to, Billed-to, Shipped-to, Payers,
Buyers, etc. Customers are relevant in the context of Sales, Financial Accounting, Customer
Relationship Management, etc. A customer may be either a person or a company. Depending
on the ERP implementation, a customer can have one or multiple addresses and any one of
these addresses may be used in relation to a business transaction, such as a Sales Order.
The Customer key (DIM_ID) is composed of the following attributes:
• CUSTOMER_NO
• COMPANY_CD
• SALES_ORG_CD
• DSTR_CHNL_CD
• DIVISION_CD
This is a Type 1 (non-History Preserving) dimension. If Tracking Changes (SCD) is enabled in
the dimension delivery then, for performance reasons, a (non-unique) index is required on
column CUSTOMER _DIM_ID.
Customer is a CDC (Changed Data Capture) table dimension.
Data extraction from the ERP source, for each run, is controlled/limited by the From/To
extraction Dates as specified by the related Jobflow Properties in the Analytic Applications
Console. Only those records which are new or modified since the last extraction will be selected
for processing. Since this is an incremental dimension, the Mart Begin Date parameter should
be set (via the console) to match the ERP's beginning date while this table is initially being
loaded in order to ensure that all records are selected from the source.
Loading of the customer dimension consists of three major steps.
1. Extract the Customer Hierarchy,
2. Extract the Customer information and join it to the Customer Hierarchy.
3. Load the Customer dimension.
Because of the customer key, which contains five attributes, the extraction of customer
information is divided into three stages, based on the known/unknown component values:
1. The keys CUSTOMER NO, COMPANY CD, SALES ORG CD, DSTRBTN CNL CD,
DIVISION CD are all known values (join information of KNA1,KNVV,TVKO).
2. The keys CUSTOMER NO, COMPANY CD have known values but SALES ORG CD,
DSTRBTN CNL CD, DIVISION CD are unknown (joining of KNA1, KNB1).
3. The key CUSTOMER NO has a known value but COMPANY CD, SALES ORG CD,
DSTRBTN CNL CD, DIVISION CD are unknown (KNA1 table only).

Impact of Conformed Dimension


This is a shared dimension that is common to
• Accounts Receivable Analysis
• Inventory Analysis
• Sales Analysis
Care must be taken when installing dimensions, particularly when there is more than one
application. Installing a newer (or same) version of this dimension over an existing one will
replace the entire table and its contents will be lost. If you wish to retain existing data, save a
copy of the data and reload it after the dimension has been upgraded.
If any other warehouse is already installed, check Installation Guide for any important
information on integration with other Analytic Application data marts. That documentation will
describe any manual intervention required.

Dependencies
None.

18 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

Configuration Parameters
• COLLECTION_MANAGER_CD
This field is sourced using the SAP partner functions related to a customer. The list of
available partner functions can be found from TPAR.PARVW. You can enter one or more
values in this field. The values must be surrounded by single quotes with a comma between
each. If more than one value is returned from SAP, only the first value will be displayed in
the table field CUSTOMER.COLLECTION_MNGR_NM. You must use the language
independent code.
• CREDIT_MANAGER_CD
This field is sourced using the SAP partner functions related to a customer. The list of
available partner function codes can be found from TPAR.PARVW. You can enter one or
more values in this field. The values must be surrounded by single quotes with a comma
between each. If more than one value is returned from SAP, only the first value will be
displayed in the table field CUSTOMER.CREDIT_MANAGER_NM. You must use the
language independent code.
• CUSTOMER_HIER_TYPE
This parameter is used to determine which Customer hierarchy will be loaded into the
Customer Table. Only one hierarchy is supported. The default value is A. The list of
available values can be found in THIT.HITYP.

User Intervention
User Interface
• Pre-Run
Before initially loading this table, set the Mart Begin Date back to the ERP's beginning date
in order to ensure that all source Customer records will be retrieved. In the console, set the
parameter value to the necessary early date and save. For the duration of this table's initial
load job(s), ensure that no other jobs are run.
• Post-Run
When the Customer table initial load is complete, ensure that the Mart Begin Date
parameter is properly reset to its defined configuration value.
CDC Dates
• CDC_EXTRACT_FROM_DATE
• CDC_EXTRACT_TO_DATE
To limit the volume of data retrieved from SAP, particularly during historical data loads, the
CDC_ExtractFrom/To_Date range may be set either specifically or by limiting the time span
for which an extraction will be done.

Job Flow
1. CUSTOMER_J / INIT_P
• Calls function CUSTOMER_VARS_F() to set the jobflow parameters.
2. CUSTOMER_J_B_01_SJ / CUSTOMER_HIER_D_01
• Extracts Customer and Parent hierarchy info from SAP tables KNVH and KNA1.
FROM "KNVH", "KNA1"
WHERE "KNA1"."KUNNR" = "KNVH"."KUNNR" AND
"KNVH"."HITYP" = 'A'
• Output is CUSTOMER_HIER_DEX.
Delivery type is truncate.
3. CUSTOMER_J_B_02_SJ / CUSTOMER_HIER_B_02
• Input Properties: allow duplicate keys
• Extracts the Parent, Customer, Level number and the five levels of the hierarchy from table
CUSTOMER_HIER_DEX
• Output is CUSTOMER_HIER_AEX.
Delivery type is truncate.

Developer Guide 19
Chapter 1: JobStream and Build Descriptions

4. CUSTOMER_J_B_03_SJ / CUSTOMER_B_01
• Consists of 3 data sources
• Input Properties: merge duplicate keys
• Extracts the Customer number from SAP table KNA1
FROM "KNA1"
WHERE ("KNA1"."ERDAT" >= date
'{$S_CDC_EXTRACT_FROM_FDATE}' AND
"KNA1"."ERDAT" <= date '{$S_CDC_EXTRACT_TO_FDATE}')
• Extracts the Customer number from SAP table KNVV
FROM "KNVV"
WHERE ("KNVV"."ERDAT" >= date
'{$S_CDC_EXTRACT_FROM_FDATE}' AND
"KNVV"."ERDAT" <= date '{$S_CDC_EXTRACT_TO_FDATE}')
• Extracts the 'changed' Customer numbers from SAP table CDHDR
FROM "CDHDR"
WHERE ("CDHDR"."OBJECTCLAS" = 'DEBI') AND
("CDHDR"."UDATE" >= date '{$S_CDC_EXTRACT_FROM_FDATE}' AND
"CDHDR"."UDATE" <= date '{$S_CDC_EXTRACT_TO_FDATE}')
• Output is CUSTOMER_EX1.
Delivery type is truncate.

20 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

5. CUSTOMER_J_B_04_SJ / CUSTOMER_B_02
• Step 1 in which CUSTOMER NO, COMPANY CD, SALES ORG CD, DSTRBTN CNL CD,
DIVISION CD are all known values.
• Input Properties: allow duplicate keys
• Extracts Customer name, address, region, currency, etc. from SAP tables KNA1, KNVV and
TVKO
FROM "KNVV" INNER JOIN "KNA1" ON "KNA1"."KUNNR" = "KNVV"."KUNNR"
INNER JOIN "TVKO" ON "KNVV"."VKORG" = "TVKO"."VKORG"
• Lookup the Customer's hierarchy on table CUSTOMER_EX1.
• Lookup Dunning Level description name on SAP table KNB5
• Lookup GL Account and External Customer Reference on SAP table KNB1.
• Lookup the Customer's hierarchy level info on table CUSTOMER_HIER_AEX.
• Lookup country name on SAP table T005T.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Group name on SAP table T151T.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Customer Type name on SAP table T077X.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Customer Classification name on SAP table TKUKT.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Industry description on SAP table T016T.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Payment Terms days on SAP table T052.
• Lookup Customer Credit Limit and Risk Category on SAP table KNKK.
• Lookup Company Credit Limit and Risk Category on SAP tables KNKK and T001.
FROM "KNKK"
INNER JOIN "T001" ON "T001"."KKBER" = "KNKK"."KKBER"
• Lookup Collection Manager on SAP tables KNVP and P0002
FROM "PA0002" INNER JOIN "KNVP"
ON "PA0002"."PERNR" = "KNVP"."PERNR"
AND "KNVP"."PARVW" IN ({$U_COLLECTION_MANAGER_CD})
• Lookup Credit Manager on SAP tables KNVP and P0002
FROM "PA0002" INNER JOIN "KNVP" ON "PA0002"."PERNR" = "KNVP"."PERNR" AND
"KNVP"."PARVW" IN ({$U_CREDIT_MANAGER_CD})
• Lookup County name on SAP table T005F
FROM "T005F"
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Region name on SAP table T005FU
FROM "T005U"
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Sales District name on SAP table T171T
FROM "T171T"
WHERE "SPRAS" = '{$U_LANGUAGE_CD}
• Lookup Dunning Block Reason on SAP tables KNB5 and T040T
FROM "KNB5", "T040T"
WHERE "KNB5"."MANSP" = "T040T"."MANSP" AND
"T040T"."SPRAS" = '{$U_LANGUAGE_CD}'
• Output is CUSTOMER_EX2.
Delivery type is truncate.

Developer Guide 21
Chapter 1: JobStream and Build Descriptions

6. CUSTOMER_J_B_05_SJ / CUSTOMER_B_03
• Step 2 in which only CUSTOMER NO, COMPANY CD have known values.
• Input Properties: allow duplicate keys
• Extracts Customer name, address, region, currency, etc. from SAP tables KNA1 and KNB1.
FROM "KNA1", "KNB1"
WHERE "KNA1"."KUNNR" = "KNB1"."KUNNR"
• Lookup the Customer's hierarchy on table CUSTOMER_EX1
• Lookup Dunning Level description name on SAP table KNB5
• Lookup country name on SAP table T005T.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Customer Type name on SAP table T077X.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Customer Classification name on SAP table TKUKT.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Industry description on SAP table T016T.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Company Credit Limit and Risk Category on SAP tables KNKK and T001.
FROM "KNKK"
INNER JOIN "T001" ON "T001"."KKBER" = "KNKK"."KKBER"
• Lookup County name on SAP table T005F
FROM "T005F"
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Region name on SAP table T005FU
FROM "T005U"
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Dunning Block Reason on SAP tables KNB5 and T040T
FROM "KNB5", "T040T"
WHERE "KNB5"."MANSP" = "T040T"."MANSP" AND
"T040T"."SPRAS" = '{$U_LANGUAGE_CD}'
• Output is Append to CUSTOMER_EX2.
7. CUSTOMER_J_B_06_SJ / CUSTOMER_B_04
• Step 3 in which only CUSTOMER NO has known values.
• Input Properties: allow duplicate keys
• Extracts Customer name, address, region, currency, etc. from SAP table KNA1
• Lookup the Customer's hierarchy on table CUSTOMER_EX1.
• Lookup country name on SAP table T005T.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Customer Type name on SAP table T077X.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Customer Classification name on SAP table TKUKT.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Industry description on SAP table T016T.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup County name on SAP table T005F
FROM "T005F"
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Region name on SAP table T005FU
FROM "T005U"
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Output is Append to CUSTOMER_EX2
8. CUSTOMER_J_B_07_SJ / CUSTOMER_D_05
• Loads dimension CUSTOMER from CUSTOMER_EX2
Delivery type is update/insert.
• Post Procedure:
Update CUSTOMER_SCD
(table used by stored procedures in cases where the dimension is defined as Type 2 'history
preserving')

22 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

Source Tables/Files
• CDHDR Change document header
• CDPOS Change document items
• KNA1 General Data In Customer Master
• KNB1 Customer Master (Company Code)
• KNB5 Customer Master (Dunning Data)
• KNKK Customer Master Credit Management: Control AR
• KNVH Customer Hierarchies
• KNVP Customer Master Partner Functions
• KNVV Customer Master Sales Data
• P0002 HR Master Record: Infotype 0002 (Personal Data)
• PA0002 HR Master Record: Infotype 0002
• T001 Company Codes
• T005F County: Texts
• T005T Country names
• T005U Taxes: Region Key: Texts
• T016T Industry names
• T040T Dunning Block Reason Names
• T052 Terms of Payment
• T077X Account Group Names (Table T077d)
• T151T Customers: Customer Groups: Texts
• T171T Customers: Sales Districts: Texts
• TKUKT Customers: Customer Classification: Texts
• TVKO Organizational Unit: Sales Organizations

Target Tables/Files
• CUSTOMER

Work Tables:
• CUSTOMER_EX1
• CUSTOMER_EX2
• CUSTOMER_HIER_DEX
• CUSTOMER_HIER_AEX
• CUSTOMER_SCD

Stored Procedure
None.

Trigger
None.

Notes/Filters
None.

Validation
1. Check the Console log files for errors.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check for rows with zero SIDs.
4. Check the DIM_ID field and component fields.
5. Check counts, values and ranges for each key field component.
6. Check Type 2 attributes for changes (if applicable).
7. Check row count against source table row count.

Developer Guide 23
Chapter 1: JobStream and Build Descriptions

8. For selected records, review and verify the target warehouse against the source ERP data.

Financial Currency Conversion


Description
The Financial Currency Conversion dimension (FINANCIAL_CUR_CONV) enables conversion
of monetary values from one currency to another for reporting purposes. For companies which
have transactions in a variety of currencies, it is necessary to convert values from the
document/local currencies to a common currency for additive and comparative purposes. The
table includes a 'group' currency which identifies the common/standard currency used for overall
reporting.
The ERP source normally provides the exchange rates between currencies. In those cases
where an exchange rate is not provided, a 'base' currency is used as a central point to convert
from the 'From' currency to 'base' and then from the 'base' to the 'To' currency. If this alternate
method cannot be used either, the exchange rate is defaulted to '1'.
Each currency exchange rate is defined within a specific Fiscal Period which, in turn, is
composed of a calendar date and a Fiscal Variant.
The Financial Currency Conversion table is not a true dimension; it does not have a DIM_ID
column.
The key is composed of the following attributes:
• FROM_CURRENCY_CD
• TO_CURRENCY_CD
• FISCAL_PERIOD_SID
This is a Type 1 (non History Preserving) dimension.
FINANCIAL_CUR_CONV is a CDC (Changed Data Capture) table dimension.
Data extraction from the ERP source, for each run, is controlled/limited by the From/To
extraction Dates as specified by the related Jobflow Properties in the Analytic Applications
Console.
Loading the Financial Currency dimension consists of six major steps:
1. Extract the currency rates for all currencies which the user has identified as requiring
conversion.
2. Extract the currency codes for all currencies which the user has identified as requiring
conversion.
3. Extract the local currencies and their corresponding base currency.
4. Join Currency_Codes and Local_Currencies to All_Time (using cartesian product) and load
the dimension.
5. Re-calculate the currency conversion rates.
6. Re-calculate the forward currency conversion rates based on the results of step 5.

Impact of Conformed Dimension


This is a shared dimension that is common to
• Accounts Payable Analysis
• Accounts Receivable Analysis
• General Ledger Analysis
• Inventory Analysis
• Procurement Analysis
• Sales Analysis

24 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

Configuration Parameters
• EXCHANGE_RATE_TYPE
Default exchange rate type used for all financial currency conversions in the warehouse.
• MART_BEGIN_DATE
This is the starting date of the data warehouse
• MART_END_DATE
This is the ending date of the data warehouse
• REPORT_CURRENCY_CD
Reporting currency codes. The currency codes for which you are going to want to do
business currency analysis. At a minimum, you typically would want specify all your local
currencies. You must include the group currency in the list of reporting currencies.

User Intervention
None.

Job Flow
1. FINANCIAL_CURRENCY_J / INIT_P
• Calls function FINANCIAL_CURRENCY_VARS_F() to set the jobflow parameters.
2. FINANCIAL_CURRENCY_J_B_01_SJ / FINANCIAL_CURRENCY_B_01
• Input Properties: allow duplicate keys
• Extracts Currency Rate info from SAP table TCURR
WHERE GDATU is within the CDC Extract Date range
FROM "TCURR" T
WHERE T."KURST" = '{$U_EXCHANGE_RATE_TYPE}'
AND (CAST(T. "GDATU" AS INTEGER) - 99999999) * -1
>= CAST({$S_CDC_EXTRACT_FROM_DATE} AS INTEGER)
AND (CAST(T. "GDATU" AS INTEGER) - 99999999) * -1
<= CAST({$S_CDC_EXTRACT_TO_DATE} AS INTEGER)
AND T."TCURR" IN ({$U_REPORT_CURRENCY_CD})
• Output is CURRENCY_RATE.
Delivery type is Update/Insert.
3. FINANCIAL_CURRENCY_J_B_02_SJ / FINANCIAL_CURRENCY_B_02
• Input Properties: allow duplicate keys
• Extracts Currency Codes info from SAP table TCURC
• Lookup Currency Scaling Factor info on SAP table TCURX
• Lookup Currency Codes on SAP table TCURC which are found in the list of currencies
(Include For Conversion) specified by the user
FROM "TCURC"
WHERE "WAERS" IN ({$U_REPORT_CURRENCY_CD})
• Lookup Currency name on SAP table TCURT
FROM "TCURT"
WHERE "SPRAS" = '{$U_LANGUAGE_CD}
• Output is CURRENCY_LOOKUP. Delivery type is Truncate.
• Filter on delivery is CURRENCY_INCL_FOR_CONV_LKP.CODE IS NOT NULL
• Output is CURRENCY_SCAL_FCTR.
Delivery type is Truncate.

Developer Guide 25
Chapter 1: JobStream and Build Descriptions

4. FINANCIAL_CURRENCY_J_B_03_SJ / FINANCIAL_CURRENCY_B_03
• Input Properties: allow duplicate keys
• Extracts Local Currencies and their corresponding Base Currency from SAP tables T001
and TCURV
FROM "T001" T1,
"TCURV" TC
WHERE TC."KURST" = '{$U_EXCHANGE_RATE_TYPE}'
• Lookup Currency name on SAP table TCURT
FROM "TCURT"
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Output is LOCAL_CURRENCIES.
Delivery type is Truncate.
5. FINANCIAL_CURRENCY_J_B_04_SJ / FINANCIAL_CURRENCY_B_04
• Input Properties: allow duplicate keys
• Joins tables Currency_Codes and Local_Currencies to All_Time (using Cartesian product).
• Lookup Country ISO code from target
• Lookup Currency Codes on SAP table TCURC which are found in the list of currencies
(Include For Conversion) specified by the user
• Lookup Currency name from target for Base Currency and Group Currency
• Output is FINANCIAL_CUR_CONV
Delivery type is Update/Insert.
6. FINANCIAL_CURRENCY_J_B_05_SJ / FINANCIAL_CURRENCY_B_05
• Input Properties: allow duplicate keys
• FINANCIAL_CUR_CONV calculates the current exchange rates based on the effective
dates and the exchange rate type
FROM CURRENCY_RATE T1 …
FROM FINANCIAL_CUR_CONV FCC
WHERE FCC.PST_PRD_END_DT BETWEEN
{$L_EXTRACT_FROM_DATE_STR} AND {$L_PUBLISH_UNTIL_DATE_STR}
AND FCC.RATE_PUBLISHED_DT = {$L_DEFAULT_DATE_STR}
AND FCC.FROM_CURRENCY_CD <> FCC.TO_CURRENCY_CD
• Output is FINANCIAL_CUR_CONV.
Delivery type is Update.
• Filter on delivery is 'if exchange rates changed':
RATE_PUBLISHED_DT <> I_RATE_PUBLISHED_DT OR
TO_TO_BASE_EXCH_RT <> I_TO_TO_BASE_EXCH_RT OR
BASE_TO_TO_EXCH_RT <> I_BASE_TO_TO_EXCH_RT OR
FROM_TO_BS_EXCH_RT <> I_FROM_TO_BS_EXCH_RT OR
BS_TO_FRM_EXCH_RT <> I_BS_TO_FRM_EXCH_RT OR
EXCHANGE_RT <> I_EXCHANGE_RT

26 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

7. FINANCIAL_CURRENCY_J_B_06_SJ / FINANCIAL_CURRENCY_B_06
• Input Properties: allow duplicate keys
• Pre_procedure: Determines the minimum Effective Date
$SQL_STRING:= CONCAT('SELECT
MIN(EFFECTIVE_DT) FROM CURRENCY_RATE WHERE EFFECTIVE_DT
BETWEEN ',$L_EXTRACT_FROM_DATE_STR);
$SQL_STRING:= CONCAT($SQL_STRING, ' AND ');
$SQL_STRING:= CONCAT($SQL_STRING,$L_PUBLISH_UNTIL_DATE_STR);
$L_MIN_RATES_CHANGED_DATE
:= LOOKUP('TARGET',$SQL_STRING);
$L_MIN_RATES_CHANGED_DATE_STR
:=TOCHAR($L_MIN_RATES_CHANGED_DATE);
• Conditional Run: IF_MIN_EFFECTIVE_DT_IS_NULL
• FINANCIAL_CUR_CONV calculates the forward date exchange rates based on the
changes made in the previous build.
FROM CURRENCY_RATE T1 …
FROM FINANCIAL_CUR_CONV FCC
WHERE FCC.PST_PRD_END_DT <= {$L_PUBLISH_UNTIL_DATE_STR}
AND FCC.PST_PRD_END_DT >=
{$L_MIN_RATES_CHANGED_DATE_STR}
AND FCC.FROM_CURRENCY_CD <> FCC.TO_CURRENCY_CD
• Output is FINANCIAL_CUR_CONV.
Delivery type is Update.
• Filter on delivery is 'if exchange rates changed':
RATE_PUBLISHED_DT <> I_RATE_PUBLISHED_DT OR
TO_TO_BASE_EXCH_RT <> I_TO_TO_BASE_EXCH_RT OR
BASE_TO_TO_EXCH_RT <> I_BASE_TO_TO_EXCH_RT OR
FROM_TO_BS_EXCH_RT <> I_FROM_TO_BS_EXCH_RT OR
BS_TO_FRM_EXCH_RT <> I_BS_TO_FRM_EXCH_RT OR
EXCHANGE_RT <> I_EXCHANGE_RT

Source Tables/Files
• TCURR Exchange Rates
• TCURC Currency Codes
• TCURT Currency Code Names
• T001 Company Codes
• TCURX Decimal Places in Currencies

Target Tables/Files
• FINANCIAL_CUR_CONV

Work Tables
• CURRENCY_RATE
• CURRENCY_LOOKUP
• CURRENCY_SCAL_FCTR
• LOCAL_CURRENCIES
• COUNTRY_ISO

Stored Procedure
None.

Trigger
None.

Notes/Filters
None.

Developer Guide 27
Chapter 1: JobStream and Build Descriptions

Validation
1. Check the Console log files for errors.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check for rows with zero SIDs.
4. Check the DIM_ID field and component fields.
5. Check counts, values and ranges for each key field component.
6. Check Type 2 attributes for changes (if applicable).
7. Check row count against source table row count.
8. For selected records, review and verify the target warehouse against the source ERP data.

Material
Description:
The Material dimension, an important component of Supply Chain Management, describes the
products that a company manufactures and sells, allowing one to analyze Sales or Inventory
across Material Types, Groups, etc. For example, the two most basic Inventory Management
questions are - "what have I got?" and "where is it?". The Material Dimension tells us what we
have.
The key (DIM_ID) is composed of the following attribute.
• MATERIAL_ID
This is a Type 1 (non-History Preserving) dimension. If Tracking Changes (SCD) is enabled in
the dimension delivery then, for performance reasons, a (non-unique) index is required on
column MATERIAL_DIM_ID.
Material is a CDC (Changed Data Capture) table dimension.
Data extraction from the ERP source, for each run, is controlled/limited by the From/To
extraction Dates as specified by the related Jobflow Properties in the Analytic Applications
Console. Only those records which are new or modified since the last extraction will be selected
for processing.
Since this is an incremental dimension, the Mart Begin Date parameter should be set (via the
console) to match the ERP's beginning date while this table is initially being loaded in order to
ensure that all records are selected from the source.
Loading this dimension consists of:
1. Extracting general material data.
2. Extracting material groups.
3. Loading dimension table.

Impact of Conformed Dimension


This is a shared dimension that is common to
• Inventory Analysis
• Procurement Analysis
• Sales Analysis
Care must be taken when installing dimensions, particularly when there is more than one
application. Installing a newer (or same) version of this dimension over an existing one will
replace the entire table and its contents will be lost. If you wish to retain existing data, save a
copy of the data and reload it after the dimension has been upgraded.
If any other warehouse is already installed, check Installation Guide for any important
information on integration with other Analytic Application data marts. That documentation will
describe any manual intervention required.

28 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

Dependencies
None.

Configuration Parameters
• MATERIAL_CAT_DOMNAME
This parameter determines the material category codes and descriptions from the SAP
fixed value domain table. This value, 'ATTYP', should not be changed.
• MTRL_LEVEL1_LENGTH
Number of characters allowed for denoting the level 1 characteristic within the material
product hierarchy
• MTRL_LEVEL2_LENGTH
Number of characters allowed for denoting the level 2 characteristic within the material
product hierarchy
• MTRL_LEVEL3_LENGTH
Number of characters allowed for denoting the level 3 characteristic within the material
product hierarchy
• MTRL_LEVEL4_LENGTH
• Number of characters allowed for denoting the level 4 characteristic within the material
product hierarchy
• MTRL_LEVEL5_LENGTH
Number of characters allowed for denoting the level 5 characteristic within the material
product hierarchy

User Intervention
User Interface
• Pre-Run
Before initially loading this table, set the Mart Begin Date back to the ERP's beginning date
in order to ensure that all source Material records will be retrieved. In the console, set the
parameter value to the necessary early date and save. For the duration of this table's initial
load job(s), ensure that no other jobs are run.
• Post-Run
When the Material table initial load is complete, ensure that the Mart Begin Date parameter
is properly reset to its defined configuration value.
• CDC Dates
CDC_EXTRACT_FROM_DATE
CDC_EXTRACT_TO_DATE
To limit the volume of data retrieved from SAP, particularly during historical data loads, the
CDC_ExtractFrom/To_Date range may be set either specifically or by limiting the time span
for which an extraction will be done.

Job Flow
1. MATERIAL_J / INIT_P
• Calls function MATERIAL_VARS_F() to set the jobflow parameters.

Developer Guide 29
Chapter 1: JobStream and Build Descriptions

2. MATERIAL_J_B_01_SJ / MATERIAL_B_01
• Input Properties: allow duplicate keys
• Extracts general Material info from SAP table MARA where ERSDA or LAEDA is within the
CDC Extract Date range
FROM "MARA"
WHERE (("MARA"."ERSDA" >= date '{$S_CDC_EXTRACT_FROM_FDATE}' AND
"MARA"."ERSDA" <= date '{$S_CDC_EXTRACT_TO_FDATE}')
OR
("MARA"."LAEDA" >= date '{$S_CDC_EXTRACT_FROM_FDATE}' AND
"MARA"."LAEDA" <= date '{$S_CDC_EXTRACT_TO_FDATE}'))
• Lookup Material description on SAP table MAKT
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Material Division name on SAP table TSPAT
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Material Industry Sector description on SAP table T137T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Material Category description on SAP table DD07T
WHERE "DDLANGUAGE" = '{$U_LANGUAGE_CD}' AND
"DOMNAME" = 'ATTYP'
• Lookup Material Group description name on SAP table T023T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Material Type description on SAP table T134T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Material Price Band Category description on SAP table TWPTT
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• For each hierarchy level 1 - 5, Lookup Material Level name on SAP table T179T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Material Vendor name on SAP table LFA1
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Output is MATERIAL_DEX.
Delivery type is Truncate.
3. MATERIAL_J_B_02_SJ / MATERIAL_B_02
• Input Properties: allow duplicate keys
• Extracts Material Groups info from SAP table T023
• Lookup Material Group description on SAP table T023T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Output to MATERIAL_DEX.
Delivery type is Append.
4. MATERIAL_J_B_03_SJ / MATERIAL_D_03
• Loads dimension MATERIAL from MATERIAL_DEX
5. MATERIAL_J / END_P
• Post Procedure:
Update MATERIAL_SCD (table used by stored procedures in cases where the dimension is
defined as Type 2 'history preserving').

30 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

Source Tables/Files
• MARA General Material Data
• MAKT Material Descriptions
• TSPAT Organizational Unit: Sales Divisions: Texts
• T137T Industry Descriptions
• DD07T DD: Texts for Domain Fixed Values (Language-Dependent)
• T023T Material Group Descriptions
• T134T Material Type Descriptions
• TWPTT Text: price band category
• T179T Materials: Product hierarchies: Texts
• LFA1 Vendor Master (General Section)
• T023 Material Groups

Target Tables/Files
• MATERIAL

Work Tables
• MATERIAL_DEX
• MATERIAL_SCD

Stored Procedure
None.

Trigger
None.

Notes/Filters
None.

Validation
1. Check the Console log files for errors.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check for rows with zero SIDs.
4. Check the DIM_ID field and component fields.
5. Check counts, values and ranges for each key field component.
6. Check Type 2 attributes for changes (if applicable).
7. Check row count against source table row count.
8. For selected records, review and verify the target warehouse against the source ERP data.

Material Movement Activity


Description
This fact contains information required for management queries relating to material movements.
Material movements are the most basic type of actions that need to be tracked while managing
inventory. Examples of such movements are receipts, issues or transfers of materials across
plants. Each time a material movement occurs, the information pertaining to it is stored in a
document created in the source system.
The document contains information such as the quantity of materials moved, the date when the
movement occurred, the material that moved, the plant it moved from or to, etc. The metric
information from the document is stored here.

Developer Guide 31
Chapter 1: JobStream and Build Descriptions

Notes: The material movement fact is designed for high performance management queries and
high performance load of summary fact tables. For this reason, it only contains foreign key
columns and measures. Textual attributes that are part of the movement document are kept
separate in the Movement Document entity. Related to the Material Movement entity are
summary entities such as Stock Overview that also contain metrics that are derived from goods
movement transactions.
This fact is composed of two tables.
1. MATERIAL_MVMNT_DOC contains the key components (DIM_ID), the related SID and
descriptive/textual information. The DIM_ID is composed of the following attributes:
• DOCUMENT_NO
• DOCUMENT_YEAR_VAL
• DOCUMENT_ITEM_NO
2. MATERIAL_MVMNT_DTL contains the Document related SID, the dimensional SIDs and
the fact measures.
Material Movement is a CDC (Changed Data Capture) fact table.
Data extraction from the ERP source, for each run, is controlled/limited by the from/to extraction
dates as specified by the related Jobflow Properties in the Analytic Applications Console. The
jobsteam is also controlled by MTRL_MVMNT_UPD_FLAG parameter which is used to
determine whether you would like to process updates.
The job consists of two major steps:
1. Data retrieval from the SAP Material header and detail tables.
2. Loading of the 'doc' and 'detail' tables which comprise this fact.

Configuration Parameters
• MTRL_MVMNT_UPD_FLAG
This parameter is used to determine whether you would like to process updates to the
material movement fact. Processing updates will impact the performance as more overhead
is generated while determining if an update or insert should be done and while performing
the actual updates. To process updates, choose Y, otherwise choose N.

User Intervention
• User Interface
None.
• CDC Dates
CDC_EXTRACT_FROM_DATE
CDC_EXTRACT_TO_DATE
To limit the volume of data retrieved from SAP, particularly during historical data loads, the
CDC_ExtractFrom/To_Date range may be set either specifically or by limiting the time span
for which an extraction will be done.
• Installing a newer (or same) version of this component over an existing one will replace the
entire table and its contents will be lost. If you wish to keep existing data, save a copy of the
data and reload it after the upgrade has been completed.

Job Flow
1. MTRL_MVMNT_DTL_DOC_J / INIT_P
• Calls function MATERIAL_MVMNT_VARS_F () to set the jobflow parameters.

32 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

2. MTRL_MVMNT_DTL_DOC_J_INS_01_SJ / MTRL_MVMNT_DTL_DOC_INS_B_01
• If MTRL_MVMNT_UPD_FLAG parameter is set to 'N' (Not to process updates)
• input properties: allow duplicate keys

FROM "MKPF" INNER JOIN "MSEG" ON


("MKPF"."MJAHR" = "MSEG"."MJAHR") AND
("MKPF"."MBLNR" = "MSEG"."MBLNR")
WHERE
("MKPF"."CPUDT" >= date '{$S_CDC_EXTRACT_FROM_FDATE}' AND
"MKPF"."CPUDT" <= date '{$S_CDC_EXTRACT_TO_FDATE}')
3. MTRL_MVMNT_DTL_DOC_J_UPDIN_01_SJ/MTRL_MVMNT_DTL_DOC_UPDINS_B_01
• If MTRL_MVMNT_UPD_FLAG parameter is set to 'Y' (Process of updates is required).
• input properties: allow duplicate keys
• Extracts Material movement info from SAP tables MKPF and MSEG for rows whose
accounting document entry date or create date is within the CDC extract date range.
FROM "MKPF" INNER JOIN "MSEG" ON ("MKPF"."MJAHR" = "MSEG"."MJAHR") AND
("MKPF"."MBLNR" = "MSEG"."MBLNR")
WHERE
(("MKPF"."CPUDT" >= date '{$S_CDC_EXTRACT_FROM_FDATE}' AND
"MKPF"."CPUDT" <= date '{$S_CDC_EXTRACT_TO_FDATE}')
OR
("MKPF"."AEDAT" >= date '{$S_CDC_EXTRACT_FROM_FDATE}' AND
"MKPF"."AEDAT" <= date '{$S_CDC_EXTRACT_TO_FDATE}'))
• Lookup Batch date on SAP table MCHA.
• Lookup material number on SAP table EKPO.
• Lookup Valuation area code on SAP table T001W.
• Lookup Local Currency code and Fiscal Variant on SAP table T001.
• Output is MATERIAL_MVMNT_FEX.
Delivery Type is Truncate.
4. MTRL_MVMNT_DTL_DOC_J_B_02_SJ / MTRL_MVMNT_DTL_DOC_B_02
• Pre Procedure
Determines the 'As At Date' from the Stock Opening Balance.
Since Material Movement is one of the data sources for Stock Overview, there is a
constraint on processing prior (historical) periods after the Stock Opening Balance and
Stock Overview processes have begun. This 'As At' value is used to determine if and when
the Stock Opening Balance was run in order to permit or deny processing of prior periods.
• Retrieves the Header/Doc and Detail info from work table MATERIAL_MVMNT_FEX and
calculates the Stock Accuracy Percentages.
• Lookup on the existing 'doc' and 'detail' records to determine if the incoming rows are new,
existing or changed.
FROM "MATERIAL_MVMNT_DOC" DOC,
"MATERIAL_MVMNT_DTL" DTL,
"MATERIAL_MVMNT_FEX" FEX
WHERE FEX."DOCUMENT_NO" = DOC."DOCUMENT_NO" AND
FEX."DOCUMENT_ITEM_NO" = DOC."DOCUMENT_ITEM_NO" AND
FEX."DOCUMENT_YEAR_VAL" = DOC."DOCUMENT_YEAR_VAL" AND
DOC."MTRL_MVMNT_DOC_SID" = DTL."MTRL_MVMNT_DOC_SID"
• Lookup the Local Currency's Scaling Factor on table CURRENCY_SCAL_FCTR.
• Output is MATERIAL_MVMNT_DOC
Delivery Type is Update/Insert.
• Output is MATERIAL_MVMNT_DTL
Delivery Type is Update/Insert.

Source Tables/Files
• EKPO Purchasing Document Item
• MCHA Batches
• MKPF Header: Material Document.
• MSEG Document Segment
• T001 Company Codes
• T001W Valuation area

Developer Guide 33
Chapter 1: JobStream and Build Descriptions

Target Tables/Files
• MATERIAL_MVMNT_DTL
• MATERIAL_MVMNT_DOC

Work Tables
• MATERIAL_MVMNT_FEX

Stored Procedure
None.

Trigger
None.

Notes/Filters
None.

Validation
1. Check the Console log files for errors.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check for rows with zero SIDs.
4. Check the DIM_ID field and component fields.
5. Check counts, values and ranges for each key field component.
6. Check Type 2 attributes for changes (if applicable).
7. Check row count against source table row count.
8. For selected records, review and verify the target warehouse against the source ERP data.

Material Movement Document Class


Description
This contains combinations of attributes that classify material documents. Such attributes
describe the nature of the goods movement. At the highest level of classification, a goods
movement is either an "issue" or a "receipt". At a lower level, the movement class describes the
exact nature of the movement (e.g. goods issue to production) and the reason for movement.
Such classifications are used in the calculation of stock level and stock usage.
For example, "goods issue for transfer to another plant" is not considered as usage whereas
"goods issue to production" is. Typically, a source system has many such classifiers, such as
Document Category, Document Type, Document Line Type, etc. This dimension combines every
one of them into a single entity. This is done primarily for technical reasons, such as improving
the performance of queries and minimizing the storage space required (a single link between
the Class and the Fact is sufficient to answer queries that look at metrics across document
classifiers).
However, in certain cases, it makes business sense to do so as well. For example, combinations
of classifiers may be meaningful to a business. If so, new attributes may be added that represent
such meaningful combinations. This also contains a number of multipliers. Multipliers are used
to calculate metrics and have values of 1 or 0. The derived metric is calculated by multiplying the
multiplier with the existing metric. Multipliers are defined by the ETL program based on certain
source system classifiers.

34 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

The key (DIM_ID) is composed of the following attributes:


• DOCUMENT_TYPE_CD
• DOCUMENT_LN_TYP_CD
• SPECIAL_STOCK_CD
• INTTNG_DOC_TYP_CD
• RECEIPT_TYP_CD
• CNSMPTN_PSTNG_CD
This is a Type 1 (non-History Preserving) dimension. If Tracking Changes (SCD) is enabled in
the dimension delivery then, for performance reasons, a (non-unique) index is required on
column MV_DOC_CLSS_DIM_ID.
MOVEMENT_DOC_CLSS is a non-CDC (Changed Data Capture) table dimension.
Since there are no CDC dates available in this table, the contents must be extracted to the data
warehouse server in order to identify and process any new/changed records.
Loading of this dimension consists of three major steps:
1. Extract the Document Types and Document Line Types.
2. Extract the Document Line Types.
3. Load the dimension.
Two passes are used to retrieve the Document Type and Line Type combinations:
1. Defined/existing combinations of the Doc Type & Doc Line Types.
2. Defined/existing Document Line Types only; the Doc Type is 'unknown'.

Impact of Conformed Dimension


None. Material Movement Document Class is unique to the Inventory Analysis Application.

Configuration Parameters
• GOODS_ISSUE_DOC_TYPE
This parameter is used to determine which document types are considered "Goods Issue"
material movements. The available list of values can be found in T003.BLART. This list
allows multiple values. The values should be surrounded by single quotes and separated by
a comma. This parameter is also used to determine the SIGN reversal multiplier.
Documents that are "Goods Issue" types are recorded with negative values and quantities
as they are a withdrawal from inventory.
• GOODS_RECEIPT_DOC_TYPE
This parameter is used to determine which document types are used for "Goods Receipt"
material movements. The available list of values can be found in T003.BLART. This list
allows multiple values. The values should be surrounded by single quotes and separated by
a comma. This parameter is used to determine the document types that are loaded into this
table, as well as the SIGN reversal multiplier. Documents that are "Goods Receipt" types
are recorded with positive values and quantities as they are an addition to inventory.
• IA_INTTNG_DOC_TYP_DOMNAME
This parameter determines the initiating document type code and description for movement
transactions from the SAP fixed value domain table. This value should not be changed.
• IA_RECEIPT_TYP_DOMNAME
This parameter determines the receipt type code and description for movement transactions
from the SAP fixed value domain table. This value should not be changed.
• UNPLANNED_USG_MULT_CD
This parameter is used to determine which Inventory goods Issues were unplanned, i.e. to
set the UNPLANNED_USG_MULT. The list of available values can be found from
DD07T.DOMVALUE_L where DOMNAME = 'KZVBU' and SPRAS = "Language Code" (e.g.
E).
• USAGE_MULT_CD
This parameter is used to determine which inventory movements affect consumption. The
list of available values can be found from DD07T.DOMVALUE_L where DOMNAME =
'KZVBU' and SPRAS = "Language Code" (e.g. E).

Developer Guide 35
Chapter 1: JobStream and Build Descriptions

User Intervention
• User Interface
Post-run
From the Console 'Tools', run 'Movement Document Class Multipliers' to review and update
the Multipliers for the various Doc Class combinations. This is the responsibility of the
business user who is familiar with the SAP Inventory Module as implemented. See the User
Guide for detailed explanation and instructions.

Job Flow
1. MOVEMENT_DOC_CLSS_J / INIT_P
• Calls function MOVEMENT_DOC_CLSS_VARS_F() to set the jobflow parameters
2. MOVEMENT_DOC_CLSS_J_B_01_SJ / MOVEMENT_DOC_CLSS_B_01
• Extracts Doc Type, Line Type, Receipt Type, etc. and the multipliers from SAP tables T003,
T156 and T156T. Selection is limited by the configuration parameters.
FROM "T003", "T156" INNER JOIN "T156T" ON "T156"."BWART" = "T156T"."BWART"
WHERE T003.BLART
IN ({$U_GOODS_RECEIPT_DOC_TYPE}, {$U_GOODS_ISSUE_DOC_TYPE})
AND T156T.SPRAS = '{$U_LANGUAGE_CD}'
• Input Properties: merge duplicate keys
• Lookup Special Stock description on SAP table T148T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Movement Indicator description (INTTNG_DOC_TYP) on SAP table DD07T
WHERE "DDLANGUAGE" = '{$U_LANGUAGE_CD}'
AND "DOMNAME" = '{$U_IA_INTTNG_DOC_TYP_DOMNAME}'
• Lookup Receipt Type description on SAP table DD07T
WHERE "DDLANGUAGE" = '{$U_LANGUAGE_CD}'
AND "DOMNAME" = 'KZZUG'
• Lookup Doc Type on SAP table T003T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Output is MOVEMENT_DOC_C_DEX.
Delivery type is truncate.
3. MOVEMENT_DOC_CLSS_J_B_02_SJ / MOVEMENT_DOC_CLSS_B_02
• Input Properties: merge duplicate keys
• Extracts Document Line Type, Receipt Type, etc. and the multipliers from SAP tables T156
and T156T. The Document Type is set to 'unknown'.
FROM "T156", "T156T"
WHERE "T156"."BWART" = "T156T"."BWART"
AND "T156T"."SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Doc Type description on SAP table T156T
WHERE TRIM("SPRAS") = '{$U_LANGUAGE_CD}'
AND "SOBKZ" = ' '
• Output is Append to MOVEMENT_DOC_C_DEX
4. MOVEMENT_DOC_CLSS_J_B_03_SJ / MOVEMENT_DOC_CLSS_B_03
• Loads dimension MOVEMENT_DOC_CLSS_UPD from MOVEMENT_DOC_C_DEX
Delivery type is update/insert.
5. MOVEMENT_DOC_CLSS_J / INIT_P
• Post Procedure:
Update MVMNT_DOC_CLSS_SCD
(table used by stored procedures in cases where the dimension is defined as Type 2 'history
preserving')

36 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

Source Tables/Files
• DD07T DD: Texts for domain fixed values (language-dependent)
• T003 Document types
• T003T Document type texts
• T148T Special Stock Descriptions
• T156 Movement Type
• T156T Movement Type Text

Target Tables/Files
• MOVEMENT_DOC_CLSS

Work Tables
• MOVEMENT_DOC_C_DEX
• MVMNT_DOC_CLSS_SCD

Stored Procedure
None.

Trigger
None.

Notes/Filters
None.

Validation
1. Check the Console log files for errors.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check for rows with zero SIDs.
4. Check the DIM_ID field and component fields.
5. Check counts, values and ranges for each key field component.
6. Check Type 2 attributes for changes (if applicable).
7. Check row count against source table row count.
8. For selected records, review and verify the target warehouse against the source ERP data.

Material Reservation
Description
This fact contains information related to material reservations at a specific plant or storage
location. Each time a material reservation occurs, the information pertaining to it is stored in a
document created in the source system. The document contains information such as the
quantity of materials reserved, the date when the reservation occurred, the material reserved,
the plant at which the reservation was made, etc. The metric information from the document is
stored here.
This fact is composed of two tables:
1. MTRL_RSRVTN_DOC contains the key components (DIM_ID), the related SID and
descriptive/textual information. The DIM_ID is composed of the following attributes:
• DOCUMENT_NO
• RECORD_TYPE_CD
• DOCUMENT_ITEM_NO

Developer Guide 37
Chapter 1: JobStream and Build Descriptions

2. MTRL_RSRVTN_DTL contains the Document related SID, the dimensional SIDs and the
fact measures.
Material Reservation is a CDC (Changed Data Capture) fact table.
Initial Run will load all the reservation rows. Data extraction for the incremental loads will be
controlled by the Extract From Date, which can be set to the desired starting point and could be
set to 0. Subsequent Runs will extract data constrained by the Material Reservation Extract
Days parameter. For example, if the parameter is set to 60 (days) the ETL will extract
Reservations with a Required Date that is greater than the (Extract From Date less 60 days).The
job consists of two major steps.
1. Data retrieval from the SAP Material header and detail tables.
2. Loading of the 'doc' and 'detail' tables, which comprise this fact.

Configuration Parameters
• MTRL_RSRVTN_ETR_DYS
This parameter determines the number of days of history that should be loaded into material
reservation after initial load. For example, if the value is set to 60, and today is December 1,
2002, the reservation job will extract all reservations where the request date is <=
2002/12/01 - 60 days i.e. 2002/10/02. This parameter should be set to a) reduce the volume
of data extracted from the system for update purposes and b) Ensure that open reservations
are updated and closed. If it typically takes one month to close a reservation, the value
should be set for 30 days + buffer for reservations open longer than 30 days.

User Intervention
• User Interface
None.
• CDC Dates
CDC_EXTRACT_FROM_DATE
CDC_EXTRACT_TO_DATE
To limit the volume of data retrieved from SAP, particularly during historical data loads, the
CDC_ExtractFrom/To_Date range may be set either specifically or by limiting the time span
for which an extraction will be done.
• Installing a newer (or same) version of this component over an existing one will replace the
entire table and its contents will be lost. If you wish to keep existing data, save a copy of the
data and reload it after the upgrade has been completed.

Job Flow
1. MTRL_RSRVTN_DTL_DOC_J / INIT_P
• Calls function MTRL_RSRVTN_DTL_DOC_VARS_F() to set the jobflow parameters
2. MTRL_RSRVTN_DTL_DOC_J_B_01_SJ / MTRL_RSRVTN_DTL_DOC_B_01
• input properties: allow duplicate keys
• Extracts Material reservations from SAP tables RESB, RKPF.
FROM "RKPF", "RESB"
WHERE "RKPF"."RSNUM" = "RESB"."RSNUM"
AND "RESB"."BDTER" >= date '{$S_CDC_EXTRACT_FROM_FDATE}'
• Lookup Fiscal Variant on SAP table T001
FROM "T001" INNER JOIN "T001K" ON "T001K"."BUKRS" = "T001"."BUKRS" INNER JOIN "T001W"
ON "T001W"."BWKEY" = "T001K"."BWKEY"
• Output is MTRL_RSRVTN_FEX.
Delivery Type is Truncate.

38 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

3. MTRL_RSRVTN_DTL_DOC_J_B_02_SJ / MTRL_RSRVTN_DTL_DOC_B_02
• Input properties: allow duplicate keys
• Extracts the Header/Doc and Detail info from work table MTRL_RSRVTN_FEX and
calculates the Stock Accuracy Percentages.
• Lookup on the existing 'doc' and 'detail' records to determine if the incoming rows are new,
existing or changed.
FROM "MTRL_RSRVTN_DOC" DOC,
"MTRL_RSRVTN_DTL" DTL,
"MTRL_RSRVTN_FEX" FEX
WHERE DOC."MTRL_RSRV_DOC_SID" = DTL."MTRL_RSRV_DOC_SID" AND
FEX."DOCUMENT_NO" = DOC."DOCUMENT_NO" AND
FEX."DOCUMENT_ITEM_NO" = DOC."DOCUMENT_ITEM_NO" AND
FEX."RECORD_TYPE_CD" = DOC."RECORD_TYPE_CD"
• Lookup the Local Currency's Scaling Factor on table CURRENCY_SCAL_FCTR.
• Output is MTRL_RSRVTN_DTL
Delivery Type is Update/Insert.
• Output is MTRL_RSRVTN_DOC
Delivery Type is Update/Insert.

Source Tables/Files
• RESB Reservation/dependent requirements
• RKPF Document Header: Reservation

Target Tables/Files
• MTRL_RSRVTN_DTL
• MTRL_RSRVTN_DOC

Work Tables:
• MTRL_RSRVTN_FEX

Stored Procedure
None.

Trigger
None.

Notes/Filters
None.

Validation
1. Check the Console log files for errors.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check for rows with zero SIDs.
4. Check the DIM_ID field and component fields.
5. Check counts, values and ranges for each key field component.
6. Check Type 2 attributes for changes (if applicable).
7. Check row count against source table row count.
8. For selected records, review and verify the target warehouse against the source ERP data.

Developer Guide 39
Chapter 1: JobStream and Build Descriptions

Material Storage
Description
This table contains material information that is specific to the plant in which it is stored. For
example, it contains the plant-specific attributes of a material, such as the maximum and
minimum size a batch is allowed to have in a plant, or the maximum stock level that is allowed. It
also has material planning information (such as procurement planning or inventory planning)
specific to a plant, such as the MRP group in charge of planning for the material, the purchasing
group responsible for procuring the material, etc.
The Material Storage key (DIM_ID) is composed of the following attributes:
• MATERIAL_ID
• PLANT_ID
This is a Type 1 (non-History Preserving) dimension. If Tracking Changes (SCD) is enabled in
the dimension delivery then, for performance reasons, a (non-unique) index is required on
column MTRL_STRG_DIM_ID.
Material Storage is a non-CDC (Changed Data Capture) table dimension.
Since there are no CDC dates available in this table, the contents must be extracted to the data
warehouse server in order to identify and process any new/changed records.
Loading of this table consists of two steps.
1. Extract the storage data from SAP.
2. Load the Material Storage table.

Impact of Conformed Dimension


None. Material Storage is unique to the Inventory Analysis Application.

Dependencies
None.

Configuration Parameters
• MATERIAL_STORAGE_PRCRMT_TYP_CD
Potential name: MTRL_STRG_PRCRMT_TYP_DOMNAME = 'BESKZ'
This parameter determines the plant specific special procurement types from the SAP fixed
value domain table. This value should not be changed.

User Intervention
None.

Job Flow
1. MATERIAL_STORAGE_J / INIT_P
• Calls function MATERIAL_STORAGE_VARS_F() to set the jobflow parameters.

40 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

2. MATERIAL_STORAGE_J_B_01_SJ / MATERIAL_STORAGE_B_01
• Extracts Material Storage ABC code, MRP info, Purchasing info, Procurement info,
Valuation Category and the quantity control values from SAP table MARC.
• Input properties: allow duplicate keys
• Lookup MRP Type description on SAP table T438T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Purchasing Group description on SAP table T024
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Procurement Type description on SAP table DD07T
WHERE "DDLANGUAGE" = '{$U_LANGUAGE_CD}'
AND "DOMNAME" = '{$U_MTRL_STRG_PRCRMT_TYP_DOMNAME}
• Lookup Valuation Category description on SAP table T149T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup MRP Controller name on SAP table T024D
• Lookup Special Procurement Type description on SAP table T460T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Output is MATERIAL_STORA_DEX.
Delivery type is truncate.
3. MATERIAL_STORAGE_J_B_02_SJ / MATERIAL_STORAGE_D_02
• Loads dimension MATERIAL_STORAGE from MATERIAL_STORA_DEX.
Delivery type is update/insert.
4. MATERIAL_STORAGE_J / END_P
• Post Procedure:
Update MATERIAL_STRG_SCD
(table used by stored procedures in cases where the dimension is defined as Type 2 'history
preserving')

Source Tables/Files
• MARC Material Master: C Segment
• DD07T DD: Texts for domain fixed values (language-dependent)
• T024 Purchasing Groups
• T024D MRP
• T149T Global valuation category descriptions
• T438T MRP description
• T460T Texts for special procurement keys

Target Tables/Files
• MATERIAL_STORAGE
• MATERIAL_STRG_SCD

Work Tables
• MATERIAL_STORA_DEX

Stored Procedure
None.

Trigger
None.

Notes/Filters
None.

Validation
1. Check the Console log files for errors.
2. Check the DecisionStream job log file, build log files, and reject file.

Developer Guide 41
Chapter 1: JobStream and Build Descriptions

3. Check for rows with zero SIDs.


4. Check the DIM_ID field and component fields.
5. Check counts, values and ranges for each key field component.
6. Check Type 2 attributes for changes (if applicable).
7. Check row count against source table row count.
8. For selected records, review and verify the target warehouse against the source ERP data.

Physical Inventory
Description
This fact compares the expected quantity of a material (or the book quantity) against the actual
quantity based on the physical count of material in the storage location. This activity is done to
determine the accuracy of the stock balance in the inventory books. An over- or
under-estimation of the stock balance is measured as a percentage of the actual stock. One of
two indicators of accuracy may be used - the absolute stock accuracy, which treats both positive
and negative deviations from the actual as the same, and the relative stock accuracy, which
makes a distinction between positive and negative deviations.
This fact is composed of two tables.
1. PHYSICAL_INV_DOC contains the key components (DIM_ID), the related SID and
descriptive/textual information. The DIM_ID is composed of the following attributes:
• DOCUMENT_NO
• FISCAL_YEAR_VAL
• DOCUMENT_ITEM_NO
2. PHYSICAL_INV_DTL contains the Document related SID, the dimensional SIDs and the
fact measures.
Physical Inventory is a CDC (Changed Data Capture) fact table.
Data extraction from the ERP source, for each run, is controlled/limited by the From/To
extraction Dates as specified by the related Jobflow Properties in the Analytic Applications
Console.
The job consists of two major steps.
1. Data retrieval from the SAP Physical Inventory header and detail tables.
2. Loading of the 'doc' and 'detail' tables which comprise this fact.

Impact of Conformed Dimension


None. Physical Inventory is a fact and is unique to the Inventory Analysis Application.

Configuration Parameters
None.

42 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

User Intervention
• User Interface
None.
• CDC Dates
CDC_EXTRACT_FROM_DATE
CDC_EXTRACT_TO_DATE
To limit the volume of data retrieved from SAP, particularly during historical data loads, the
CDC_ExtractFrom/To_Date range may be set either specifically or by limiting the time span
for which an extraction will be done.
• Installing a newer (or same) version of this component over an existing one will replace the
entire table and its contents will be lost. If you wish to keep existing data, save a copy of the
data and reload it after the upgrade has been completed.

Job Flow
1. PHYSICAL_INV_DTL_DOC_J / INIT_P
• Calls function PHYSICAL_INV_DTL_DOC_VARS_F() to set the jobflow parameters.
2. PHYSICAL_INV_DTL_DOC_J_B_01_SJ / PHYSICAL_INV_DTL_DOC_B_01
• input properties: allow duplicate keys
• Extracts Material, Storage Location, Fiscal Year, Counts, Quantities, Amounts, etc. from
SAP tables IKPF and ISEG.
The Last Count Date, ZLDAT, is used in the CDC Date range filter.
FROM "IKPF" INNER JOIN "ISEG" ON
"IKPF"."IBLNR" = "ISEG"."IBLNR"
AND "IKPF"."GJAHR" = "ISEG"."GJAHR"
AND ("IKPF"."DSTAT" = 'X' OR "IKPF"."DSTAT" = 'A')
AND "ISEG"."XDIFF" = 'X'
AND "ISEG"."XZAEL" = 'X'
AND "ISEG"."XLOEK" <> 'X'
WHERE ("IKPF"."ZLDAT" >= date '{$S_CDC_EXTRACT_FROM_FDATE}' AND
"IKPF"."ZLDAT" <= date '{$S_CDC_EXTRACT_TO_FDATE}')
• Lookup the Plant's Fiscal Variant code on SAP tables T001, T001K and T001W
FROM "T001" INNER JOIN "T001K" ON "T001K"."BUKRS" = "T001"."BUKRS"
INNER JOIN "T001W" ON "T001W"."BWKEY" = "T001K"."BWKEY"
• Lookup the Plant's Valuation Area on SAP table T001W
• Output is PHYSICAL_INV_FEX.
Delivery Type is Truncate.
3. PHYSICAL_INV_DTL_DOC_J_B_02_SJ / PHYSICAL_INV_DTL_DOC_B_02
• Pre Procedure
Determines the 'As At Date' from the Stock Opening Balance.
Since Physical Inventory is one of the data sources for Stock Overview, there is a constraint
on processing prior (historical) periods after the Stock Opening Balance and Stock
Overview processes have begun. This 'As At' value is used to determine if and when the
Stock Opening Balance was run in order to permit or deny processing of prior periods.
• Extracts the Header/Doc and Detail info from work table PHYSICAL_INV_FEX and
calculates the Stock Accuracy Percentages.
• Lookup on the existing 'doc' and 'detail' records to determine if the incoming rows are new,
existing or changed.
FROM "PHYSICAL_INV_DOC" DOC, "PHYSICAL_INV_DTL" DTL, "PHYSICAL_INV_FEX" FEX
WHERE DOC."PHYS_INV_DOC_SID" = DTL."PHYS_INV_DOC_SID" AND
FEX."DOCUMENT_NO" = DOC."DOCUMENT_NO" AND
FEX."DOCUMENT_ITEM_NO" = DOC."DOCUMENT_ITEM_NO" AND
FEX."FISCAL_YEAR_VAL" = DOC."FISCAL_YEAR_VAL"
• Lookup the Local Currency's Scaling Factor on table CURRENCY_SCAL_FCTR
• Output is PHYSICAL_INV_DTL
Delivery Type is Update/Insert.
• Output is PHYSICAL_INV_DOC
Delivery Type is Update/Insert.

Developer Guide 43
Chapter 1: JobStream and Build Descriptions

Source Tables/Files
• IKPF Header: Physical Inventory Document
• ISEG Physical Inventory Document Items
• T001 Company Codes
• T001K Valuation area
• T001W Plants/Branches

Target Tables/Files
• PHYSICAL_INV_DTL
• PHYSICAL_INV_DOC

Work Tables
• PHYSICAL_INV_FEX
• CURRENCY_SCAL_FCTR

Stored Procedure
None.

Trigger
None.

Notes/Filters
None.

Validation
1. Check the Console log files for errors.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check for rows with zero SIDs.
4. Check the DIM_ID field and component fields.
5. Check counts, values and ranges for each key field component.
6. Check Type 2 attributes for changes (if applicable).
7. Check row count against source table row count.
8. For selected records, review and verify the target warehouse against the source ERP data.

Plant
Description
This dimension is used to describe the plants of an organization. The most basic inventory
management questions are - "what have I got?" and "where is it?". This helps us answer the
"where is it?" question. In the context of Inventory Analysis, plants refer to warehouses. The
plant or warehouse makes merchandise available for production, distribution and sale. A plant
may be subdivided into storage locations, allowing stocks of materials to be broken down
according to predefined criteria (e.g., location and materials planning aspects).
The key (DIM_ID) is composed of the following attributes:
• PLANT_ID
• STORAGE_LCTN_CD
This is a Type 1 (non-History Preserving) dimension. If Tracking Changes (SCD) is enabled in
the dimension delivery then, for performance reasons, a (non-unique) index is required on
column PLANT_DIM_ID.
Plant is a non-CDC (Changed Data Capture) table dimension.

44 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

Since there are no CDC dates available in this table, the contents must be extracted to the data
warehouse server in order to identify and process any new/changed records.
Loading the Plant table consists of:
1. Extracting plants.
2. Extracting plants and storage locations.
3. Loading the dimension table.
Because the key contains 2 attributes, two passes are required to create the combinations for:
1. PLANT_ID and blank/unknown STORAGE_LCTN_CD
2. PLANT_ID with STORAGE_LCTN_CD value

Impact of Conformed Dimension


This is a shared dimension that is common to
• Inventory Analysis
• Procurement Analysis
• Sales Analysis
Care must be taken when installing dimensions, particularly when there is more than one
application. Installing a newer (or same) version of this dimension over an existing one will
replace the entire table and its contents will be lost. If you wish to retain existing data, save a
copy of the data and reload it after the dimension has been upgraded.
If any other warehouse is already installed, check Installation Guide for any important
information on integration with other Analytic Application data marts. That documentation will
describe any manual intervention required.

Dependencies
None.

Configuration Parameters
• PLANT_CAT_DOMNAME
This parameter determines the plant category codes and descriptions from the SAP fixed
value domain table. Default is 'VLFKZ'. This value should not be changed.
• MRP_AT_STRG_LCTN_DOMNAME
This parameter determines the "Storage Location MRP types" from the SAP fixed value
domain table. Default is 'DISKZ'. Warning: Please do not change this value.

User Intervention
None.

Job Flow
1. PLANT_J / INIT_P
• Calls function PLANT_VARS_F() to set the jobflow parameters.

Developer Guide 45
Chapter 1: JobStream and Build Descriptions

2. MATERIAL_J_B_01_SJ / PLANT_B_01
• Input Properties: allow duplicate keys
• Extracts Plant info from SAP tables T001W
• Lookup Plant Company info on SAP tables T001 and T001K
FROM "T001" INNER JOIN "T001K" ON "T001"."BUKRS" = "T001K"."BUKRS
• Lookup Plant Group Currency code on SAP tables T000, T001 and T001K
FROM "T001" INNER JOIN "T001K" ON "T001"."BUKRS" = "T001K"."BUKRS"
INNER JOIN "T000" ON "T001"."MANDT" = "T000"."MANDT
• Lookup Plant County name on SAP table T005F
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Plant Country name on SAP table T005T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Plant Category name on SAP table DD07T
WHERE "DDLANGUAGE" = '{$U_LANGUAGE_CD}'
AND "DOMNAME" = 'VLFKZ'
• Lookup Plant Region name on SAP table T005U
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Plant Supply Region name on SAP table TZONT
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Plant Division name on SAP table TSPAT
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Plant Negative Stock Indicator on SAP table T001K
• Lookup Plant Unloading Point name on SAP table KNVA
WHERE "DEFAB" = 'X'
• Output is PLANT_DEX.
Delivery type is Truncate.
3. MATERIAL_J_B_02_SJ / PLANT_B_02
• Input Properties: allow duplicate keys
• Extracts Plant and Storage Location info from SAP tables T001W and T001L
FROM "T001W" INNER JOIN "T001L" ON "T001W"."WERKS" = "T001L"."WERKS"
• Lookup Plant Company info on SAP tables T001 and T001K
FROM "T001" INNER JOIN "T001K" ON "T001"."BUKRS" = "T001K"."BUKRS
• Lookup Plant Group Currency code on SAP tables T000, T001 and T001K
FROM "T001" INNER JOIN "T001K" ON "T001"."BUKRS" = "T001K"."BUKRS"
INNER JOIN "T000" ON "T001"."MANDT" = "T000"."MANDT
• Lookup Plant County name on SAP table T005F
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Plant Country name on SAP table T005T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Plant Category name on SAP table DD07T
WHERE "DDLANGUAGE" = '{$U_LANGUAGE_CD}'
AND "DOMNAME" = '{$U_ PLANT_CAT_DOMNAME}'
• Lookup Plant Region name on SAP table T005U
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Plant Supply Region name on SAP table TZONT
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Plant Division name on SAP table TSPAT
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Plant Negative Stock Indicator on SAP table T001K
• Lookup Plant MRP Storage Location description on SAP table DD07T
WHERE "DDLANGUAGE" = '{$U_LANGUAGE_CD}'
AND "DOMNAME" = 'DISKZ'
• Lookup Plant Unloading Point name on SAP table KNVA
WHERE "DEFAB" = 'X'
• Output is Append to PLANT_DEX.

46 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

4. MATERIAL_J_B_03_SJ / PLANT_D_03
• Loads dimension PLANT from PLANT_DEX
• Post Procedure:
Update PLANT_SCD (table used by stored procedures in cases where the dimension is
defined as Type 2 'history preserving').

Source Tables/Files
• T001 Company Codes
• T001K Valuation area
• T001L Storage Locations
• T001W Plants/Branches
• T005F County: Texts
• T005T Country Names
• DD07T DD: Texts for Domain Fixed Values (Language-Dependent)
• T005U Taxes: Region Key: Texts
• TZONT Customers: Regional Zone Texts
• TSPAT Organizational Unit: Sales Divisions: Texts
• KNVA Customer Master Loading Points

Target Tables/Files
• PLANT

Work Tables
• PLANT_DEX
• PLANT_SCD

Stored Procedure
None.

Trigger
None.

Notes/Filters
None.

Validation
1. Check the Console log files for errors.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check for rows with zero SIDs.
4. Check the DIM_ID field and component fields.
5. Check counts, values and ranges for each key field component.
6. Check Type 2 attributes for changes (if applicable).
7. Check row count against source table row count.
8. For selected records, review and verify the target warehouse against the source ERP data.

Developer Guide 47
Chapter 1: JobStream and Build Descriptions

Re-Ranking
Description
Re-Ranking is used by Stock Overview business concept to rank or re-rank the inventory items.
Re-Ranking process also uses INVENTORY_RANK_PARM table, which is defined by the user
and represents the ranks for "plant-specific" and "non-plant-specific" ranges. Ranks are defined
from 0% to 100% for all plants or range of plants. Rank 1is the highest velocity item, Rank 5 is
the lowest. The Rank '9999' or the highest rank number always will be the last record in the
ranking table. This rank will be used to represent the 'dead' items (items with no usage). The
table allows for the inclusion of any number of inventory rank numbers. The ranking parameters
may differ by plant or may be the same for all plants. The table also allows user to specify the
Overstock_months and Required_months.
Ranking or Re-Ranking is performed once a month at the start of the month. Perform ranking is
part of the carry forward procedure and will be done during the forward process.

Ranking Rules
The calculation of ranks are base on a Pareto Analysis in order to prioritize and focus resources
where they are most needed, using the following rules.
1. The COGS calculation (Usage_Qty * Unit_Value) is based on the data from the
STOCK_OVERVIEW table. The extracting date range is determined by the ReRank From/To
Date configuration parameters.
2. The COGS per item is accumulated (COGS_ACUM) and the results ordered by Plant_id
and COGS_ACUM in descending order. All items are listed in order of magnitude, starting
with the largest.
3. The COGS% is calculated based on the COGS ACUM divided by the COGS by Plant_id.
4. The COGS% and the Plant_id are used to determine the Rank_no and the Overstock and
Required Months from the INVENTORY_RNK_PARM table.

Calculations
1. Sum usage by plant id and material id over trailing InventoryRankMonths (12 or 24 previous
months) ("IUTTM"). Read this from Stock Overview.
2. Calculate COG$item by multiplying IUTTM by item cost (group currency)
3. Calculate COG$plant as the sum of COG$item for each plant.
4. Sort item detail by Plant, COG$item (descending).
5. Calculate COG$cum for each succeeding item (COG$cum = COG$item +
COG$cum(previous)).
6. Calculate COG$cum% for each succeeding item (COG$cum% = COG$cum / COG$plant).
7. Assign rank based on rank cutoff using the values from INVENTORY_RNK_PARM (e.g
Rank = 1 if COG$cum% <= Rank1, Rank = 2 if COG$cum% <= Rank2 and > Rank1, etc.).
Item with QtyOH >0 and COG$item = 0 is assigned rank = 0.

Calculation of OVER_USAGE_QTY & REQ_USAGE_QTY


For each item in the list above:
1. Get periods of supply values for overstock (i.e., PSover1=1, PSover2=2, PSover3=3,
PSover4=4, PSover5=6, PSover9=0) from the INVENTORY_RANK_PARM table.
2. Retrieve number of periods as specified by PSoverN from STOCK_USAGE_FORECAST. If
null, retrieve previous year/same month historical usage for each period (i.e., if most current
month of history is MAY, and PS = 3, retrieve forecasts for JUN-JUL-AUG, or history from
previous year for JUN-JUL-AUG).
3. Summarize usage over period of supply frame ("UTover").
4. Get periods of supply cutoff values for required investment (i.e., PSreq1=.25, PSreq2=.50,
PSreq3=1, PSreq4=2, PSreq5=2, PSreq9=0).

48 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

5. Retrieve number of periods as specified by PSreqN from STOCK_USAGE_FORECAST. If


null, retrieve previous year/same month historical usage for each period. If PS value is < 1,
retrieve one forecast value only.
6. Summarize usage over period of supply time frame ("UTreq" -- extend by PSreq value, if
PSreq < 1).

Calculate OVERSTOCK_QTY & REQUIRED_QTY


Computation of Overstock and Required Qty is performed once at the start of the month and
optionally each time that Stock Overview is updated.
1. Calculate over stock units for each item (OSUitem = close stock level - UTover;
if UTover < 0, set UTover = 0).
2. Calculate required units for each item (RQUitem = UTreq - close stock level;
if UTreq < 0, set UTreq = 0).
When inserting into Stock Overview,
• RANK_NO = Rank
• OVER_USAGE_QTY= round to nearest whole number (UTover)
• REQ_USAGE_QTY= round to nearest whole number (UTreq)

Update Stock Overview


Each time the closing stock level changes, if UpdateFrequencyForOverAndReq = "Continuous",
re-calculate OVERSTOCK_QTY & REQUIRED_QTY using the method described above. This
process will be done by the SO_UPD procedure. There is no need to recalculate or update
RANK_NO, OVER_USAGE_QTY, REQ_USAGE_QTY during the update process. The 5
measures will be recalculated monthly by the CARRY_FORWARD process.

Insert Stock Overview


When inserting into stock overview as part of the Update Stock Overview Procedure, set
• RANK_NO = null
• OVER_USAGE_QTY= null
• REQ_USAGE_QTY= null
• OVERSTOCK_QTY= null
• REQUIRED_QTY= null

Notes on the grain of Stock Overview


Stock Overview is summarized at the level of Plant, Material, Calendar_Month in all cases.
There is no difference between the grain of Overstock and Required Quantity and the rest of the
measures, so no special processing is required.

ETL Control of the Ranking Process


Ranking is intensive process and may take considerable time to execute. Ranks are not volatile,
so there is no need to always re-rank every month. Ranking is under ETL Control (as a
refreshed dummy table), so that it can be manually Run or Held.

Configuration Parameters:
• RERANK_FROM_DT
Extract from date for the ranking process.
• RERANK_TO_DT
Extract to date for the ranking process.

User Intervention
• Pre-run
From the Console 'Tools', run 'Inventory Ranking' to review and update the parameters used
for ranking of inventory items. This is the responsibility of the business user who is familiar
with the SAP Inventory Module as implemented. See the User Guide for detailed
explanation and instructions.

Developer Guide 49
Chapter 1: JobStream and Build Descriptions

Job Flow
1. RERANK_UPDATE_J / INIT_P
• No job specific variables set for this job
2. RERANK_UPDATE_J_B_01_SJ / RERANK_UPDATE_01_P
• Calls the store procedure for Ranking/Re-ranking process.
$SQL_STRING:= CONCAT('BEGIN RE_RANK(',
ToChar($RERANK_FROM_DT),',',
ToChar($RERANK_TO_DT), '); END;');

Source Tables/Files:
None.

Target Tables/Files:
• Stock Overview

Work Tables
• INVENTORY_RANK_PARM

Stored Procedure
RE-RANK

Trigger
None.

Notes/Filters
None.

Validation
1. Check Console Log Files.

Stock Class
Description
This table is used to classify the stock items in inventory. The most basic inventory management
questions are "what have I got?" and "where is it?". Stock Class helps to clarify the "what have I
got?" question by describing fitness for use. For example, there are 100 widgets in stock, but 10
are unavailable as they are going through "quality inspection", 20 are "blocked" for an
unspecified reason, and 30 are "reserved". This implies that only 80 of the 100 widgets in stock
are available for "unrestricted use", and 30 of these 80 have been "reserved" for use in a specific
production process. This dimension contains combinations of attributes that are stock
classifiers.
Typically, a source system has many such classifiers, such as Stock Type. This combines every
one of these classifiers into a single entity. This is done primarily for technical reasons, such as
improving the performance of queries and minimizing the storage space required (a single link
between the stock class and the fact is sufficient to answer queries that look at metrics across
document classifiers). However, in certain cases, it makes business sense to add combinations
of classifiers may be meaningful to a business.
This dimension also contains a number of multipliers which are used for calculating derived
metrics from existing ones, and have values of 1 or 0. The derived metric is calculated by
multiplying the multiplier with the existing metric. Multipliers are defined by the ETL program
based on certain source system classifiers.

50 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

SAP defines three variations of stock type:


1. MM-IM values are defined in DD07T within domain name MB_INSMK.
2. MM-WM values are defined in DD07T within domain name BESTQ.
3. Physical Inventory values are defined in T064A.
The key (DIM_ID) is composed of the following attributes:
• STOCK_TYPE_CD
• SPECIAL_STOCK_CD.
This is a Type 1 (non-History Preserving) dimension. If Tracking Changes (SCD) is enabled in
the dimension delivery then, for performance reasons, a (non-unique) index is required on
column STOCK_CLSS_DIM_ID.
This is a non-CDC (Changed Data Capture) table dimension.
Since there are no CDC dates available in this table, the contents must be extracted to the data
warehouse server in order to identify and process any new/changed records.
The load of Stock Class dimension consists of combinations of different stock types and the
special stocks:
Step 1
1. Cartesian between DD07T and T148, filtered by the domain name and language
parameters.
2. Stock type is sourced from DD07T and SPECIAL_STOCK_CD is unknown.
3. Cartesian between T064A, T064B and T148, for Physical Inventory.
4. Join of T064A, T064B. Stock type is sourced from T064A and SPECIAL_STOCK_CD is
unknown.
Step 2
• Load of target dimension; check of the multipliers changes using PEX table.

Impact of Conformed Dimension


None. Stock Class is unique to the Inventory Analysis Application.

Developer Guide 51
Chapter 1: JobStream and Build Descriptions

Configuration Parameters
• BLOCKED_STOCK_TYPE
This parameter indicates which stock types are considered blocked. It is used to set the
BLOCKED_MULT in the STOCK_CLASS table. The list of available values can be retrieved
from two sources. The first is DD07T.DOMVALUE_L where DOMNAME = parm
'STOCK_TYPE_DOMNAME' and SPRAS = 'Language Code (e.g. E). The second is
T064A.BSTAR. Data sourced from DD07T is relevant to regular inventory movements. Data
sourced from T064A is only used for Physical Inventory documents.
• CUST_CONS_SPECIAL_STOCK
This parameter indicates which stock values are considered in customer consignment. It is
used to set the CUSTOMER_CONS_MULT in the STOCK_CLASS table. The list of
available values can be retrieved T148.SOBKZ.
• QLTY_INSPCTN_STOCK_TYPE
This parameter indicates which stock types are considered in quality inspection. It is used to
set the QLTY_INSPCTN_MULT in the STOCK_CLASS table. The list of available values can
be retrieved from two sources. The first is DD07T.DOMVALUE_L where DOMNAME = parm
'STOCK_TYPE_DOMNAME' and SPRAS = 'Language Code (e.g. E). The second is
T064A.BSTAR. Data sourced from DD07T is relevant to regular inventory movements. Data
sourced from T064A is only used for Physical Inventory documents
• STOCK_TYPE_DOMNAME
This parameter determines the stock type codes and descriptions from the SAP fixed value
domain table. This value should not be changed. Values in 'MB_INSMK', 'BESTQ'.
• UNRESTRICTED_STOCK_TYPE
This parameter indicates which stock types are considered unrestricted. It is used to set the
UNRESTRICTED_MULT in the STOCK_CLASS table. The list of available values can be
retrieved from two sources. The first is DD07T.DOMVALUE_L where DOMNAME = parm
'STOCK_TYPE_DOMNAME' and SPRAS = 'Language Code (e.g. E). The second is
T064A.BSTAR. Data sourced from DD07T is relevant to regular inventory movements. Data
sourced from T064A is only used for Physical Inventory documents
• VENDOR_CONS_SPECIAL_STOCK
This parameter indicates which stock values are considered in vendor consignment. It is
used to set the VENDOR_CONS_MULT in the STOCK_CLASS table. The list of available
values can be retrieved T148.SOBKZ.

User Intervention
• Post-run
From the Console Tools, run Stock Class Multipliers to review and update the Multipliers
for the various combinations. This is the responsibility of the business user who is familiar
with the SAP Procurement/Inventory Management Module as implemented. See the User
Guide for a detailed explanation and instructions.

Dependencies
None.

Job Flow
1. STOCK_CLASS_J / INIT_P
• Calls function STOCK_CLASS_VARS_F() to set the jobflow parameters.

52 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

2. STOCK_CLASS_J_B_01_SJ / STOCK_CLASS_B_01
• Consists of 4 data sources.
• Input property - merge.
• Extracts the Special Stock Code and Stock Type from SAP tables T148 and DD07T
WHERE DD07T.DOMNAME = 'MB_INSMK' AND DDLANGUAGE = '{$U_LANGUAGE_CD}'
• Extracts Special Stock Code and Stock Type from SAP table DD07T
WHERE DD07T.DOMNAME = 'MB_INSMK' AND DDLANGUAGE = '{$U_LANGUAGE_CD}'
• Extracts Special Stock Code and Type from SAP tables T148, T064A and T064B
WHERE T064B.SPRAS = '{$U_LANGUAGE_CD}'
• Extracts Special Stock Code and Type from SAP tables T064A and T064B
WHERE T064B.SPRAS = '{$U_LANGUAGE_CD}'
• Lookup Special Stock description on SAP table T148T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Output is STOCK_CLASS_DEX.
Delivery type is truncate.
3. STOCK_CLASS_J_B_02_SJ / STOCK_CLASS_B_02
• Loads dimension STOCK_CLASS from STOCK_CLASS_DEX. Checks the multipliers
changes using PEX table.
• Output is STOCK_CLASS.
Delivery type is update/insert.
4. STOCK_CLASS_J / END_P
• Post Procedure:
Update STOCK_CLASS_SCD SCD
(table used by stored procedures in cases where the dimension is defined as Type 2 'history
preserving')

Source Tables/Files
• DD07T (DOMAIN NAME = 'MB_INSMK')
• T064A Stock Types for Physical Inventory
• T148 special stock)
• T148T Special Stock Descriptions
• T064 Stock Types and Texts for Physical Inventory

Target Tables/Files
• STOCK_CLASS

Work Tables
• STOCK_CLASS_DEX
• STOCK_CLASS_SCD

Stored Procedure
None.

Trigger
None.

Notes/Filters
None.

Validation
1. Check the Console log files for errors.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check for rows with zero SIDs.
4. Check the DIM_ID field and component fields.

Developer Guide 53
Chapter 1: JobStream and Build Descriptions

5. Check counts, values and ranges for each key field component.
6. Check Type 2 attributes for changes (if applicable).
7. Check row count against source table row count.
8. For selected records, review and verify the target warehouse against the source ERP data.

Stock Overview
Description
STOCK_OVERVIEW is a summary of the primary inventory management measures, calculated
by period. It includes Open Stock Level, Close Stock Level, Average Stock Level, Usage
Quantity, etc. for all stock items and for unrestricted (i.e. not blocked or being held for quality
inspection) stock items.
The two primary sources used to construct the overview are Material Movement and Valuation.
The material movements are a record of goods received, transferred internally, consumed
internally and shipped out. Valuing the items, in a common currency, provides a method of
evaluating and comparing inventory because the physical items are variously quantified by
quantity/number, weight, volume, linear measure, etc. which are non-additive attributes.
Stock Overview also incorporates information from three additional sources: Physical Inventory,
Stockout, and Stock Usage Forecast. These three components are optional; Stock Overview
can run without them but if they are to be included in the calculations, they must be run before
the overview process.
Loading Stock Overview for the first time requires a window of time during which there must be
no material movement activity. SAP maintains a dynamic 'current' picture of inventory; it is
constantly changing as new material movements occur. In order to initialize Stock Overview, it is
necessary to freeze any activity, to take a snapshot of current inventory (Opening Balance) and
to combine that information with a record of the material movements which have occurred
between the beginning of the current period and the moment of the snapshot. From the
snapshot and the related movements, the current period's opening balances are calculated.
These values then serve as the starting point for calculating (backwards) historical periods of
stock overview by subtracting the material movements and for maintaining a 'current' stock
overview on an ongoing basis by adding subsequent movements.
When running backwards to determine the historical Stock Overview, Material Movement
records are selected by Document Date, based on the period being processed; the process
walks back through the periods until reaching the specified Stock Overview Start Date. During
normal (current) processing, the Movements are selected on a 'records added since the last run'
basis and then processed by period from oldest to current.
The Document Date, not the Posting Date, is used to determine the fiscal period in this
'inventory' environment. The latter is a Financial posting date and is not used here.
Each row in Stock Overview is uniquely identified by:
• MATERIAL_STRG_SID
• MATERIAL_SID
• PLANT_SID
• VALUATION_SID
• UOM_SID
• FISCAL_PERIOD_SID
The job consists of five major steps:
1. Retrieve the Stockout information from a 'csv' file.
2. Retrieve the Ranking values and percentages from a 'text' file.
3. Extract the Stock Opening Balances from SAP if the table has not already been loaded.
4. Load Stock Overview if the table is empty. Initializes the current/first period with the Stock
Opening Balances.

54 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

5. Run the Stock Overview stored procedure.

Dependencies
• MATERIAL_MOVEMENT_ACTIVITY
• MATERIAL_RESERVATION
• PHYSICAL_INVENTORY
• STOCK_USAGE_FORECAST
• VALUATION

Developer Guide 55
Chapter 1: JobStream and Build Descriptions

Configuration Parameters
• COMPUTE_OVER_REQ
If set to 'Y', ranking will be computed. If set to 'N', no ranking will happen and the following
parameters will not be calculated: RANK_NO, OVER_USAGE_QTY, REQ_USAGE_QTY,
OVERSTOCK_QTY, REQUIRED_QTY.
• DFLT_BLOCKED_STOCK_TYPE
The SAP system code(s) used to identify the Stock of type Blocked. Since SAP has multiple
source values, you must choose one to be displayed in the target tables.
• DFLT_IN_TRANSIT_STOCK_TYPE
The default code you want used in the Data Warehouse to identify Stock of type In Transit.
Since SAP has multiple source values, you must choose one to be displayed in the target
tables.
• DFLT_QLTY_INSPCTN_STOCK_TYPE
This code identifies the Stock of type Quality Inspection. Since SAP has multiple source
values, you must choose one to be displayed in the target tables.
• DFLT_RESTRICTED_STOCK_TYPE
The default code you want used in the Data Warehouse to identify Stock of type Restricted.
Since SAP has multiple source values, you must choose one to be displayed in the target
tables.
• DFLT_RETURNS_STOCK_TYPE
The default Code you want used in the Data Warehouse to identify Stock of type Returns.
Since SAP has multiple source values, you must choose one to be displayed in the target
tables.
• DFLT_UNRESTRICTED_STOCK_TYPE
The code used to identify the Stock of type Unrestricted. Since SAP has multiple source
values, you must choose one to be displayed in the target tables.
• IA_INITIAL_LOAD_END_DATE
This parameter serves to identify the demarcation point between historical and current data
in order to determine whether the 'normal' or 'initial load' mode processing should be
invoked. If this parameter is set to 0, then the initial load end date is set equal to the system
date that is passed to the control procedure. This value should not be changed.
• INVENTORY_RANK_PERIODS
Number of periods used in the inventory rank model for historical data. In other words, the
number of periods of history that will be used for the overstock and required quantities.
• PERIODS_TO_KEEP_ZERO_OV
Number of Fiscal Periods to keep Plant/ Material combinations with a Closing Balance of 0
in Stock Overview. You typically don't want to keep Plant/Material entries in Stock Overview
with a 0 Balance for long periods of time as they cause the Fact to grow and can slow Query
performance.
• STK_OVRVW_SPCL_STK_FLG
Use this flag to include Material Movements of type Special Stock in Stock Overview
(Vendor/Customer Consignment, Subcontracting, Sales Order stock, etc.)
• STK_OVRVW_STRG_LCN_FLG
The flag indicates: Y - storage location is part of the grain for stock overview, N - otherwise.
• STOCK_LEVEL_AVG_METHOD
Possible values are S and D.
If you set this parameter to S, the Average Stock Level will be calculated as follows:
(Open Stock level + Close Stock Level)/2.
If you set this parameter to D, the Average Stock Level will be calculated as follows:
Average taken daily weighted against how many days have passed and how many days are
left to go in the Period.
• STOCK_OVERVIEW_START_DATE
This is the Date from which you want your Stock Overview Fact loaded. By specifying a
Date in the past, the Stock Overview procedure will roll back to this date one Fiscal Period
at a time. Note: In order to properly re-create Stock Balances, you must have all the
corresponding Material Movement Transactions in your Material Movement Fact.

56 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

• UNRESTRICTED_STOCK_TYPE
Indicates which stock types are considered in unrestricted.
• UPD_FRCY_OVER_REQ
Sets the update rate for overstock. Possible values are MONTHLY and DAILY.
• VENDOR_CONS_SPECIAL_STOCK
Indicates which special stock codes are considered to be vendor consignment.
• ZERO_KPI_IND
Possible values are U (for unrestricted) and T (for total). Indicates if zero stocks will reflect
the unrestricted or the total values.

User Intervention
• User Interface
"Pre-run
From the Console Tools menu, run Stock Class Multipliers to review and update the
Multipliers for the various combinations. This is the responsibility of the business user who is
familiar with the SAP Procurement/Inventory Management Module as implemented. See the
User Guide for detailed explanation and instructions. In particular, the multiplier 'Incl in
Stock Overview' must be set correctly.
• CDC Dates
CDC_EXTRACT_FROM_DATE
CDC_EXTRACT_TO_DATE
To limit the volume of data retrieved from SAP, particularly during historical data loads, the
CDC_ExtractFrom/To_Date range may be set either specifically or by limiting the time span
for which an extraction will be done.

Job Flow
1. STOCK_OVERVIEW_J / INIT_P
• Calls function STOCK_OVERVIEW_VARS_F() to set the jobflow parameters.
2. STOCK_OVERVIEW_J_B_01_SJ / STOCKOUT_B_01
• Pre Procedure: Determines, if applicable, the date on which the Stock Opening Balance
was run.
'ORACLE': $SQL_STRING:= CONCAT('SELECT
NVL(SUBSTR(MAX(TO_CHAR(OPN_BAL_EXTRCT_DT)),1,8),
TO_CHAR(TO_DATE(''',$S_CDATE,''',''YYYY-MM-DD HH24:MI:SS''), ''YYYYMMDD'')) FROM
STOCK_OPEN_BAL_PEX');
END;
$AS_AT_DATE:= Lookup('TARGET', $SQL_STRING, FALSE);
• Input properties: allow duplicate keys
• Extracts Plant, Material, Stockout Count and Date, etc. from file STOCKOUT.CSV
• Lookup to determine Update/Insert for table Stockout
• Output is STOCKOUT.
Delivery type is update/insert.
• Post Procedure:
Updates stock overview's work table of calendar and fiscal dates.
Sql('TARGET', 'BEGIN POP_SO_ALL_TIME_WT; END;');
3. STOCK_OVERVIEW_J_B_02_SJ / RANKING_TABLE_B
• Input properties: allow duplicate keys.
• Extracts the Rank number, plants, period values and usage percentages from file
RANKING_TABLE.txt
• Output is INVENTORY_RNK_PARM.
Delivery type is truncate.

Developer Guide 57
Chapter 1: JobStream and Build Descriptions

4. STOCK_OVERVIEW_J_B_03_SJ / STOCK_OPENING_BAL_B
• This runs only if the Stock Opening Balance table is empty.
• Consists of 6 data sources
• Input properties: merge duplicate keys
• Extracts six stock quantities, Plant, Material, Special Stock Code, Batch No, etc. from SAP
tables MCHB and MARD (for Storage Location stock).
FROM MCHB RIGHT JOIN MARD ON (MARD.MATNR = MCHB.MATNR)
AND (MARD.WERKS = MCHB.WERKS)
AND (MARD.LGORT = MCHB.LGORT)
LEFT OUTER JOIN MCHA ON ("MCHB"."MATNR" = "MCHA"."MATNR")
AND ("MCHB"."WERKS" = "MCHA"."WERKS")
AND ("MCHB"."CHARG" = "MCHA"."CHARG")
• Extracts three stock quantities, Plant, Material, Special Stock Code, Batch No, etc. from
SAP table MSPR (for Project stock).
FROM MSPR LEFT OUTER JOIN MCHA ON
"MSPR"."MATNR" = "MCHA"."MATNR"
AND "MSPR"."WERKS" = "MCHA"."WERKS"
AND "MSPR"."CHARG" = "MCHA"."CHARG"
• Extracts three stock quantities, Plant, Material, Special Stock Code, Batch No, etc. from
SAP table MSKA (for Sales Order stock).
FROM MSKA LEFT OUTER JOIN MCHA ON
"MSKA"."MATNR" = "MCHA"."MATNR"
AND "MSKA"."WERKS" = "MCHA"."WERKS"
AND "MSKA"."CHARG" = "MCHA"."CHARG"
• Extracts four stock quantities, Plant, Material, Special Stock Code, Batch No, etc. from SAP
table MKOL (for special stock - from vendor consignments).
FROM MKOL LEFT OUTER JOIN MCHA ON
"MKOL"."MATNR" = "MCHA"."MATNR"
AND "MKOL"."WERKS" = "MCHA"."WERKS"
AND "MKOL"."CHARG" = "MCHA"."CHARG"
• Extracts three stock quantities, Plant, Material, Special Stock Code, Batch No, etc. from
SAP table MSKU (for special stock - customer consignments).
FROM MSKU LEFT OUTER JOIN MCHA ON
"MSKU"."MATNR" = "MCHA"."MATNR"
AND "MSKU"."WERKS" = "MCHA"."WERKS"
AND "MSKU"."CHARG" = "MCHA"."CHARG"
• Extracts three stock quantities, Plant, Material, Special Stock Code, Batch No, etc. from
SAP table MSLB (for special stock - with vendor sub-contracts).
FROM MSLB LEFT OUTER JOIN MCHA ON
"MSLB"."MATNR" = "MCHA"."MATNR"
AND "MSLB"."WERKS" = "MCHA"."WERKS"
AND "MSLB"."CHARG" = "MCHA"."CHARG"
• Extracts one stock quantity, Plant, Material, Special Stock Code, Batch No, etc. from SAP
table MARC (for in-transit stock). NOTE: Since in-transit stocks are not currently supported,
this datastream is disabled!
FROM MARC
WHERE MARC.UMLMC > 0
• Lookup Plant's Valuation Area, Company, Local Currency and Fiscal Variant on SAP tables
T001W, T001K and T001.
FROM T001W INNER JOIN T001K ON T001W.BWKEY = T001K.BWKEY
INNER JOIN T001 ON T001K.BUKRS = T001.BUKRS
• Output is STOCK_OPEN_BAL_PEX.
Delivery type is truncate.
• Output is limited to non-zero stock quantities.

58 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

5. STOCK_OVERVIEW_J_B_04_SJ / STOCK_OVERVIEW_B
• This runs only if the Stock Overview table is empty. It loads the Stock Opening Balances into
the Stock Overview table.
• Consists of 2 data sources
• Input properties: merge duplicate keys
• Retrieves the Plant, Material, Stock Level Quantity, etc., for all stock, from tables
STOCK_OPEN_BAL_PEX and MATERIAL
FROM STOCK_OPEN_BAL_PEX PEX, MATERIAL MTRL
WHERE + PEX.MATERIAL_ID = MTRL.MATERIAL_ID
• Retrieves the Plant, Material, Stock Level Quantity, etc., for only the unrestricted stock, from
tables STOCK_OPEN_BAL_PEX and MATERIAL
FROM STOCK_OPEN_BAL_PEX PEX, MATERIAL MTRL
WHERE + PEX.MATERIAL_ID = MTRL.MATERIAL_ID
AND STOCK_TYPE_CD IN ('{$U_DFLT_UNRESTRICTED_STOCK_TYPE}')
• SID Lookups
• Output is STOCK_OVERVIEW.
Delivery type is truncate.
• Output is filtered by:
If TOINTEGER(MATERIAL_SID) <> 0 AND TOINTEGER(MATERIAL_STRG_SID) <> 0 AND
TOINTEGER(PLANT_SID) <> 0 AND TOINTEGER(UOM_SID) <> 0 AND
TOINTEGER(VALUATION_SID) <> 0 AND TOINTEGER(FISCAL_PERIOD_SID) <> 0
6. STOCK_OVERVIEW_SP
• This calls the General Control Procedure to run the Stock Overview process.
Sql ('TARGET', CONCAT('DECLARE BEGIN GENERAL_CONTROL_P (',
TODOUBLE($S_CDC_EXTRACT_FROM_DATETIME),', ',
TODOUBLE($S_CDC_EXTRACT_TO_DATETIME),', ',
TODOUBLE($S_SRC_SYSTEM_DATETIME),', ',
'''STOCK_OVERVIEW''',', ',
'''MONTHLY''',', ',
$S_JOB_ID,
'); RETURN; END;'));
• The behavior of the procedure will depend on the status of the Stock Overview table. Table
SP_PERIOD_WORK is used to log the status and parameters necessary to determine and
control the processes. The following three kinds of processes will be run, in the order
presented:
• If the Stock Overview table has just been initialized, the current/first period Opening
Balances are calculated as Closing Balance minus Material Movement. These Material
Movements must constitute those movements which have occurred between the beginning
of the current/first period and the moment of the Stock Opening Balance snapshot. This
step will run once only.
• If Stock Overview is in the Initial Load & Backward mode, the 'current' period Opening
Balances are transferred to the prior period Closing Balances and that period's Opening
Balances are then calculated as Closing Balance minus Material Movement. This step
repeats until the first period, as specified by the IA_PERIOD_START_DT, has been
processed.
• After all the history has been processed, the procedure operates in 'normal' day-to-day
mode.

Source Tables/Files
• MARD Material Master: Storage Location/Ba
• MCHB Batch Stocks
• MKOL Special Stocks from Vendor
• MSKA Sales Order Stock
• MSKU Special Stocks with Customer
• MSLB Special Stocks with Vendor
• MSPR Project Stock
• T001 Company Codes
• T001K Valuation area
• T001W Plants/Branches

Developer Guide 59
Chapter 1: JobStream and Build Descriptions

Target Tables/Files
• STOCK_OVERVIEW

Work Tables
• INVENTORY_RNK_PARM
• MATERIAL
• MATERIAL_MVMNT_DTL
• RANKING_TABLE.txt
• SP_PERIOD_WORK
• STOCK_OPEN_BAL_PEX
• STOCKOUT
• STOCKOUT.CSV

Stored Procedure
• GENERAL_CONTROL_P
The General Control procedure determines the type of load. If there is no entry in
SP_PERIOD_WORK for STOCK_OVERVIEW, one is created and the
INITIAL_LOAD_END_DATE is set to the value of input parm Src_System_DateTime unless
otherwise specified. If the From/To Date range is greater than the Initial Load End Date, the
procedure runs in Normal Mode; otherwise, Initial Mode is used. The date range cannot
straddle the Initial Load End Date.
The General Control procedure determines the Fiscal Variants and for each variant,
determines the Fiscal Periods encompassed by the From/To Dates. For each Variant/Period
combination, the Update and Carry Forward procedures are called. The General Control
procedure passes a parameter to the Update process to indicate whether it is to operate in
Initial or Normal Load mode.
In Normal Load mode:
• The Material Movements are retrieved from table MATERIAL_MVMNT_DTL based on
CREATED_DT values within the From/To Date range. This effectively retrieves them as
'those added since the last run'.
• Prior period movements are processed first and the impact is rippled forward to the
current period. Future period postings are processed as belonging to the current period.
• In Initial Load mode:
• Records are retrieved from table MATERIAL_MVMNT_DTL based on DOCUMENT_DT
values within the From/To Date range.
• The selected records are processed by fiscal period, from oldest to latest, for each
Fiscal Variant. This called procedures are automatically cycled through each of the
periods.
• SO_UPD and SO_UPD_BACKDATED
• For the specified fiscal period/date range, retrieves the Movements based on the type of
load.
• Calculates new values for Opening or Closing Balances, new Min, Max and Avg, new
Usage Quantities, etc. for both Un-restricted and for all items. Existing records are
update; new records are inserted into the table.
• CARRY_FORWARD_SO
• Rolls Forward the Closing Balances of a Fiscal Variant/Period into the Opening &
Closing Balances of the next. When rippling forward the impact of a prior period posting,
the adjustment value is added to both the Opening and Closing Balances of the next
period. New records are inserted as necessary.
• During the historical loads, this process works in reverse; moving from Opening
Balance to the prior Closing.

Trigger
None.

60 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

Notes/Filters
Loading Data
The following steps are recommended when loading data for a new application
1. Load the dimensions, observing the order required for related dependencies.
Note the date on which this loading begins.
2. Update the related Multipliers via the Console - Tools. This step requires action by the
Business Users.
3. Load the historical MATERIAL_MVMNT_DTL data up to the day preceding the beginning of
the dimension loads as noted in step 01.
4. Run an update job for the application to include the dimensions and the Movements in order
to make the data warehouse current.
5. The Stock Opening Balances must be retrieved from the source during a period of
zero-activity in the Material Movements. This is normally scheduled for a quiet time, such as
a Saturday night. In order to determine how long the lock-out window should be, run the
Stock Overview job with STOCK_OVERVIEW_SP disabled/excluded from processing. The
Stockout and Ranking Builds can/should also be disabled as their output is used only during
normal mode, not during the loading or processing of historical data. Do not specify the
From/To dates for this run as the defaults will satisfy the necessary requirements. The
crucial window includes the loading of the related dimensions, the material movements and
the stock opening balances. Subsequent processes within Stock Overview do not require
restricted access to the source.
6. Set the date/time window for extracting the Stock Opening Balances. The business user will
make the decision and will be responsible for policing their users.
7. Truncate Stock Overview and the Stock Opening Balance PEX table. Delete the Stock
Overview entry from SP_PERIOD_WORK.
8. At this point, there are two options
• Re-enable component STOCK_OVERVIEW_SP in the Stock Overview job so that it will be
included in the job
• Leave STOCK_OVERVIEW_SP disabled during the Opening Balance load so that the
process will stop after the Balances and the first period of Stock Overview are loaded. This
will provide an opportunity to do a backup of the two tables and the SP_PERIOD_WORK
entry so that in the event of a future problem, it will not be necessary to require another
closed window run.
9. Run the dimensions and Material Movements just prior to the snapshot window run in order
to minimize the volume of data during the window.
10. Run the jobs: dimensions, Material Movements and Stock Overview. Do not specify the
From/To dates for this run as the defaults will satisfy the necessary requirements. If the job
is to include processing of the historical periods, ensure that the trailing window does not
include backups or any lan or server down-time that might jeopardize the completion of the
job.
11. Verify that the appropriate periods have been loaded and that the SP_PERIOD_WORK
entry is accurate.
12. If STOCK_OVERVIEW_SP was disabled, re-enable it.
13. If there is a problem which prevents the historical periods from completing, you may run the
job in stages, specifying a From/To date range corresponding to the Fiscal Periods to be
processed. Note that the To-Date can not exceed the Initial Load End Date. If there are
multiple Fiscal Variants, there may be some over-lap generated as the result of different
period start/end dates.
After the history has been loaded up to the Initial Load End Date, the process will operate in
Normal mode in which the criteria for selecting Activity facts will be 'since the last run'.
14. If applicable, ensure that the Stockout and Ranking Builds in the Stock Overview job have
been re-enabled.
15. Generate the related Powerplay cubes and run the reports.
Re-loading the Balances

Developer Guide 61
Chapter 1: JobStream and Build Descriptions

If you wish to re-load the balances from scratch, it must appear to the system as though the
process had never been run. Truncate the STOCK_OPEN_BAL_PEX and STOCK_OVERVIEW
tables and delete the entry from SP_PERIOD_WORK. You must also ensure that the Initial Load
End Date parameter is also set to zero.
Re-loading Stock Overview
If you wish to re-load the overview from scratch, it must appear to the system as though the
process had never been run. Truncate the STOCK_OVERVIEW table and delete its entry from
SP_PERIOD_WORK. You must also ensure that the Initial Load End Date parameter is also set
to zero.

Validation
1. Check Console Log Files.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check for existence of zero-sid rows.
4. For selected MATERIAL_STRG_SID, MATERIAL_SID, PLANT_SID, VALUATION_SID and
UOM_SID combinations, verify the calculated values against the related movements by
fiscal period.

Stock Usage Forecast


Description
This table contains the predicted usage quantities (Stock Usage Forecasts) for a material in a
given period based on a forecast version. Forecast Versions are used to predict stock usage.
Each version may be based on any one of a number of forecasting models supported in the
source system. A forecasting model is defined by a set of parameters that is used to calculate
the predicted usage quantity. A version thus represents a set of values assigned to the
parameters of the model.
Predicted usage quantities are stored in the Stock Usage Forecast entity. Stock Usage refers to
the utilization of stock in sales or in production. Transfers between plants, or the removal of stock
for quality inspection, reservations, etc. is not considered usage. Predicted usage quantities in
the Stock Usage Forecast entity are used to calculate an overall Stock Usage Forecast number
in the Stock Overview entity. The overall Stock Usage Forecast number may be based on an
average of the predicted usage quantity of multiple versions.
Only the latest forecast is extracted each time the job is run. Although multiple forecasts may
have been created since the last run, only the most current is extracted from SAP and loaded
into the warehouse.
Each row is uniquely identified by
• MATERIAL_SID
• PLANT_SID
• FORECAST_MTHD_SID
• FORECAST_PRDC_CD
• FORECAST_PRD_CNT
• FORECAST_RUN_DT
• FORECAST_START_DT
• FRCST_PRD_STRT_DT
Stock Usage Frcst is a non-CDC (Changed Data Capture) fact table.
Since there are no CDC dates available in this table, the contents must be extracted to the data
warehouse server in order to identify and process any new/changed records.
The job consists of two major steps.
1. Data retrieval of the Forecast values based on Material, Plant and the Forecast parameters.
2. Loading of the Stock Usage Frcst fact table.

62 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

Dependencies
Stock Usage Forecast Method

Configuration Parameters
None.

User Intervention
None.

Job Flow
1. STOCK_USAGE_FRCST_J / INIT_P
• Calls function STOCK_USAGE_FRCST_VARS_F() to set the jobflow parameters.
2. STOCK_USAGE_FRCST_J_B_01_SJ / STOCK_USAGE_FRCST_B_01
• input properties: allow duplicate keys
• Extracts Material, Plant, Forecast Method, Quantities, etc. from SAP tables MAPR, PROP
and PROW
FROM "MAPR" INNER JOIN "PROP" ON "MAPR"."PNUM1" = "PROP"."PNUM1"
INNER JOIN "PROW" ON "PROP"."PNUM2" = "PROW"."PNUM2"
WHERE "PROP"."HSNUM" = '00'
• Lookup the Material Unit of Measure on SAP tables MAPR and MARA
FROM "MAPR"
INNER JOIN "MARA" ON "MAPR"."MATNR" = "MARA"."MATNR"
• Lookup the Plant and it's Valuation Area plus the Company's Local Currency and Fiscal
Variant on SAP tables T001W, T001K and T001.
FROM T001W INNER JOIN T001K ON T001W.BWKEY = T001K.BWKEY
INNER JOIN T001 ON T001K.BUKRS = T001.BUKRS
• Output is STOCK_USAGE_FR_FEX.
Delivery type is truncate.
3. STOCK_USAGE_FRCST_J_B_02_SJ / STOCK_USAGE_FRCST_B_02
• input properties: allow duplicate keys
• Retrieve the Forecast Usage data from table STOCK_USAGE_FR_FEX
• Lookup to determine Update/Insert
FROM "STOCK_USAGE_FR_FEX" "FEX",
"STOCK_USAGE_FRCST" "STF",
"MATERIAL" "MAT",
"PLANT" "PLA",
"STK_USG_FRCST_MTHD" "SFM"
WHERE "STF"."FORECAST_PRDC_CD" = "FEX"."FORECAST_PRDC_CD"
AND "STF"."FORECAST_PRD_CNT" = "FEX"."FORECAST_PRD_CNT"
AND "STF"."FORECAST_RUN_DT" = "FEX"."FORECAST_RUN_DT"
AND "STF"."FORECAST_START_DT" = "FEX"."FORECAST_START_DT"
AND "STF"."FRCST_PRD_STRT_DT" = "FEX"."FRCST_PRD_STRT_DT"
AND "MAT"."MATERIAL_DIM_ID" = "FEX"."MATERIAL_DIM_ID"
AND "STF"."MATERIAL_SID" = "MAT"."MATERIAL_SID"
AND "PLA"."PLANT_DIM_ID" = "FEX"."PLANT_DIM_ID"
AND "STF"."PLANT_SID" = "PLA"."PLANT_SID"
AND "SFM"."FRCST_MTHD_DIM_ID" = "FEX"."FRCST_MTHD_DIM_ID"
AND "STF"."FORECAST_MTHD_SID" = "SFM"."FORECAS
T_MTHD_SID"
• Output is STOCK_USAGE_FRCST.
Delivery type is update/insert.
4. STOCK_USAGE_FRCST_J / END_P
• Post Procedure:
Runs SQL to reset the value of OFFCL_FRCST_MULT to zero for previously existing entries
of each Material/Plant combination which was added/updated during the current run.

Developer Guide 63
Chapter 1: JobStream and Build Descriptions

Source Tables/Files
• MAPR Material Index for Forecast
• MARA Material Master: General Data
• PROP Forecast parameters
• PROW Forecast Values
• T001 Company Codes
• T001K Valuation area
• T001W Plants/Branches

Target Tables/Files
• STOCK_USAGE_FRCST

Work Tables
• MATERIAL
• PLANT
• STK_USG_FRCST_MTHD
• STOCK_USAGE_FR_FEX

Stored Procedure
None.

Trigger
None.

Notes/Filters
None.

Validation
1. Check the Console log files for errors.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check for rows with zero SIDs.
4. Check DIM_ID field and the component fields of fact header (DOC table).
5. Ensure that row counts match for related Doc & Detail tables
6. Check row count against source table row count.
7. For selected records, review and verify the target warehouse against the source ERP data.

Stock Usage Forecast Method


Description
This table contains details of versions of forecasts used to predict stock usage. Each version
may be based on any one of a number of forecasting models supported in the source system. A
forecasting model is defined by a set of parameters that is used to calculate the predicted usage
quantity. A version thus represents a set of values assigned to the parameters of the model.
Predicted usage quantities are stored in the Stock Usage Forecast entity
Stock Usage refers to the utilization of stock in sales or in production. Transfers between plants,
or the removal of stock for quality inspection, reservations, etc. is not considered usage.
Predicted usage quantities in the Stock Usage Forecast entity are used to calculate an overall
Stock Usage Forecast number in the Stock Overview entity. The overall Stock Usage Forecast
number may be based on an average of the predicted usage quantity of multiple versions. The
Include in Overview Indicator indicates which versions are to be used in the average.

64 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

The key (DIM_ID) is composed of the following attribute:


• FORECAST_METHOD_CD
This is a Type 1 (non-History Preserving) dimension. If Tracking Changes (SCD) is enabled in
the dimension delivery then, for performance reasons, a (non-unique) index is required on
column FRCST_MTHD_DIM_ID.
This is a non-CDC (Changed Data Capture) table dimension.
Since there are no CDC dates available in this table, the contents must be extracted to the data
warehouse server in order to identify and process any new/changed records.
The load of Stock Usage Forecast Method dimension consists of the following steps.
1. Extract the Forecast Methods (table DD07T).
2. Load the dimension.

Impact of Conformed Dimension


None. Stock Usage Forecast Method is unique to the Inventory Analysis Application.
Care must be taken when installing dimensions, particularly when there is more than one
application. Installing a newer (or same) version of this dimension over an existing one will
replace the entire table and its contents will be lost. If you wish to retain existing data, save a
copy of the data and reload it after the dimension has been upgraded.
If any other warehouse is already installed, check Installation Guide for any important
information on integration with other Analytic Application data marts. That documentation will
describe any manual intervention required.

Configuration Parameters
• FORECAST_METHOD_DOMNAME
This parameter determines the forecast method codes and descriptions from the SAP fixed
value domain table. This value should not be changed. Default value is 'PRMOD'.

User Intervention
None.

Dependencies
None.

Job Flow
1. STK_USG_FRCST_MTHD_J / INIT_P
• Calls function STK_USG_FRCST_MTHD_VARS_F() to set the jobflow parameters.
2. STK_USG_FRCST_MTHD_J_B_01_SJ / STK_USG_FRCST_MTHD_B_01
• Extracts the Forecast Method code and name from SAP table DD07T
WHERE DOMNAME = 'PRMOD' AND DDLANGUAGE = '{$U_LANGUAGE_CD}'
• Output is STK_USG_FRCS_M_DEX.
Delivery type is truncate.
3. STK_USG_FRCST_MTHD_J_B_02_SJ / STK_USG_FRCST_MTHD_D_02
• Loads dimension STK_USG_FRCST_MTHD from STK_USG_FRCS_M_DEX
Delivery type is update/insert.

Source Tables/Files
• DD07T (DOMAIN NAME = 'PRMOD').

Target Tables/Files
• STK_USG_FRCST_MTHD

Work Tables
• STK_USG_FRCS_M_DEX

Developer Guide 65
Chapter 1: JobStream and Build Descriptions

Stored Procedure
None.

Trigger
None.

Notes/Filters
None.

Validation
1. Check the Console log files for errors.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check for rows with zero SIDs.
4. Check the DIM_ID field and component fields.
5. Check counts, values and ranges for each key field component.
6. Check Type 2 attributes for changes (if applicable).
7. Check row count against source table row count.
8. For selected records, review and verify the target warehouse against the source ERP data.

Storage Bin
Description
This table describes the physical location where the material is stored in a warehouse. In the
context of Inventory Analysis, a warehouse is synonymous with a plant.
The key (DIM_ID) is composed of the following attributes:
• WAREHOUSE_NO
• STORAGE_TYPE_CD
• STORAGE_BIN_ID
This is a Type 1 (non-History Preserving) dimension. If Tracking Changes (SCD) is enabled in
the dimension delivery then, for performance reasons, a (non-unique) index is required on
column STORAGE_BIN_DIM_ID.
Storage Bin is a non-CDC (Changed Data Capture) table dimension.
Since there are no CDC dates available in this table, the contents must be extracted to the data
warehouse server in order to identify and process any new/changed records.
Loading of the customer dimension consists of two major steps.
1. Extract the Storage Bins, Storage Types and Warehouse Numbers
2. Load the dimension table.

Impact of Conformed Dimension


None. Storage_Bin is unique to the Inventory Analysis Application.
Care must be taken when installing dimensions, particularly when there is more than one
application. Installing a newer (or same) version of this dimension over an existing one will
replace the entire table and its contents will be lost. If you wish to retain existing data, save a
copy of the data and reload it after the dimension has been upgraded.
If any other warehouse is already installed, check Installation Guide for any important
information on integration with other Analytic Application data marts. That documentation will
describe any manual intervention required.

66 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

Dependencies
None.

Configuration Parameters
• STRG_BIN_INV_MTHD_DOMNAME
This parameter determines storage bin inventory methods from the SAP fixed value domain
table. This value should not be changed. Default is 'LVS_KZINV'.

User Intervention
None.

Job Flow
1. STORAGE_BIN_J / INIT_P
• Calls function STORAGE_BIN_VARS_F() to set the jobflow parameters.
2. STORAGE_BIN_J_B_01_SJ / STORAGE_BIN_B_01
• Input Properties: allow duplicate keys
• Consists of 3 data sources
• LAGP (Storage Bin: warehouse#, storage-type and bin-id are all known)
Extracts Storage Bin info from SAP table LAGP
• T301 (Storage Type: warehouse# & storage-type are known; bin-id is unknown)
Extracts Storage Type info from SAP table T301
• T300 (Warehouse Number: only the warehouse# is known)
Extracts Warehouse Number info from SAP table T300
• Lookup Warehouse name on SAP table T300T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Storage Type description on SAP table T301T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Storage Section description on SAP table T302T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Inventory Method description on SAP table DD07T
WHERE DOMNAME = 'LVS_KZINV'
AND DDLANGUAGE = '{$U_LANGUAGE_CD}'
• Lookup Bin Type description on SAP table T303T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup Block Reason description on SAP table T330T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Output is STORAGE_BIN_DEX.
Delivery type is truncate.
3. STORAGE_BIN_J_B_02_SJ / STORAGE_BIN_D_02
• Loads dimension STORAGE_BIN from STORAGE_BIN_DEX.
Delivery type is update/insert.
4. STORAGE_BIN_J / END_P
• Post Procedure:
Update STORAGE_BIN_SCD
(table used by stored procedures in cases where the dimension is defined as Type 2 'history
preserving')

Developer Guide 67
Chapter 1: JobStream and Build Descriptions

Source Tables/Files
• DD07T DD: Texts for Domain Fixed Values (Language-Dependent)
• LAGP Storage bins
• T300 WM Warehouse Numbers
• T300T Warehouse Number Descriptions
• T301 WM Storage Types
• T301T Storage Type Descriptions
• T302T Storage Section Names
• T303T WM Names of Storage Bin Types
• T330T Text for Blocking Reason

Target Tables/Files
• STORAGE_BIN

Work Tables:
• STORAGE_BIN_DEX
• STORAGE_BIN_SCD

Stored Procedure
None.

Trigger
None.

Notes/Filters
None.

Validation
1. Check the Console log files for errors.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check for rows with zero SIDs.
4. Check the DIM_ID field and component fields.
5. Check counts, values and ranges for each key field component.
6. Check Type 2 attributes for changes (if applicable).
7. Check row count against source table row count.
8. For selected records, review and verify the target warehouse against the source ERP data.

Unit of Measure
Description
The Unit of Measure (UOM) dimension contains a list of the units of measure in which the
quantifying measures in the data warehouse are held.
Additionally, the Unit of Measure processing also loads the Unit of Measure Conversion
(UOM_CONVERSION) dimension based on the entries in the Unit of Measure dimension.
The UNIT_OF_MEASURE key (DIM_ID) is composed of the following attribute:
• UNIT_OF_MEASURE_CD
The UOM_CONVERSION key is composed of the following attributes:
• FROM_UOM_SID
• TO_UOM_SID

68 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

This is a Type 1 (non-History Preserving) dimension. If Tracking Changes (SCD) is enabled in


the dimension delivery then, for performance reasons, a (non-unique) index is required on
column UOM_DIM_ID.
UNIT_OF_MEASURE is a non-CDC (Changed Data Capture) table dimension.
Since there are no CDC dates available in this table, the contents must be extracted to the data
warehouse server in order to identify and process any new/changed records.
UOM_CONVERSION is a non-CDC (Changed Data Capture) table dimension.
Since there are no CDC dates available in this table, the contents must be extracted to the data
warehouse server in order to identify and process any new/changed records.
Loading the Unit of Measure dimension consists of two major steps:
1. Extract Unit_of_Measure information.
2. Load the dimension.
Loading the Unit of Measure Conversion dimension consists of two major steps:
1. Extract Unit_of_Measure Conversion information.
2. Load the dimension.

Impact of Conformed Dimension


This is a shared dimension that is common to
• General Ledger Analysis
• Inventory Analysis
• Procurement Analysis
• Sales Analysis
Care must be taken when installing dimensions, particularly when there is more than one
application. Installing a newer (or same) version of this dimension over an existing one will
replace the entire table and its contents will be lost. If you wish to retain existing data, save a
copy of the data and reload it after the dimension has been upgraded.
If any other warehouse is already installed, check Installation Guide for any important
information on integration with other Analytic Application data marts. That documentation will
describe any manual intervention required.

Dependencies
None.

Configuration Parameters
None.

User Intervention
None.

Job Flow
1. UNIT_OF_MEASURE_J / INIT_P
• Calls function UNIT_OF_MEASURE_VARS_F () to set the jobflow parameters.
2. UNIT_OF_MEASURE_J_B_01_SJ / UNIT_OF_MEASURE_B_01
• Input Properties: allow duplicate keys
• Extracts UOM info from T006
• Lookup UOM description and External UOM description from SAP table T006A
WHERE SPRAS = '{$U_LANGUAGE_CD}'
• Lookup UOM Dim description from SAP table T006T
WHERE SPRAS = '{$U_LANGUAGE_CD}'
• Lookup UOM ISO Description from SAP table T006J
WHERE "LANGU" = '{$U_LANGUAGE_CD}'
• Output is UNIT_MEASUR_DEX.
Delivery type is truncate.

Developer Guide 69
Chapter 1: JobStream and Build Descriptions

3. UNIT_OF_MEASURE_J_B_02_SJ / UNIT_OF_MEASURE _D_02


• Input Properties: allow duplicate keys
• Loads dimension UNIT_OF_MEASURE from UNIT_MEASUR_DEX.
Delivery type is update/insert.
4. UNIT_OF_MEASURE_J_B_03_SJ / UNIT_OF_MEASURE_CNVRSN_B
• Input Properties: allow duplicate keys
• Extracts the From & To units plus the conversion factors from SAP table T006 and T006D
FROM "T006" CFROM INNER JOIN "T006" CTO ON CFROM."DIMID" = CTO."DIMID"
INNER JOIN "T006D" CBASE ON CFROM."DIMID" = CBASE."DIMID"
AND CFROM."MSEHI" <> CTO."MSEHI"
AND CBASE."MSSIE" <> ' '
• Lookup UOM Dim Id from Target table Unit_Of_Measure
FROM "UNIT_OF_MEASURE"
ORDER BY "UOM_SID"
• Lookup UOM Conversion Dim description from SAP table T006T
FROM "T006T"
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup UOM Conversion Base values from SAP tables T006 and T006D
FROM "T006" T6, "T006D" T6D
WHERE T6."MSEHI" = T6D."MSSIE"
• Loads dimension UOM_CONVERSION.
Delivery type is truncate.
• Filter on delivery is DIMENSION_CD IS NOT NULL

Source Tables/Files
• T006 Units of Measurement
• T006A Assign Internal to Language-Dependent Unit
• T006J ISO Codes for Unit of Measure Texts
• T006D Dimensions
• T006T Dimension Texts

Target Tables/Files
• UNIT_OF_MEASURE
• UOM_CONVERSION

Work Tables
• UNIT_MEASURE_DEX

Stored Procedure
None.

Trigger
None.

Notes/Filters
None.

Validation
1. Check the Console log files for errors.
2. Check DS Job log, DS Build logs and DS Reject File.
3. Check for zero-sid rows.
4. Check DIM_ID field and the component fields.
5. Check counts, values and ranges for each key field component.
6. Check Type 2 attributes for changes (if applicable).
7. Check row count against source table row count.

70 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

8. For selected records, review and verify the target warehouse against the source ERP data.

Valuation
Description
This table contains information on the financial value of inventory. The "value of inventory"
(valuation) is an important measure - not just for accounting purposes, but because unlike the
measure "stock quantity," it can be rolled up across materials.
The current value of each material is based on the valuation area and valuation type. The
valuation area is a grouping of plants for valuation purposes. The valuation type is used to
handle split valuation of materials. Materials with the same material number may be valued
differently. For example, if one has new and refurbished motors in stock (both types of motors
have the same material number), the new motors may be valued at $500 each while the
refurbished ones are valued at $350 if they are assigned to different valuation types.
The key (DIM_ID) is composed of the following attributes:
• MATERIAL_ID
• VALUATION_AREA_CD
• VALUATION_TYPE_CD
This is a Type 2, History Preserving, dimension based on the price. For performance reasons, a
(non-unique) index is required on column VALUATION_DIM_ID.
Valuation is a non-CDC (Changed Data Capture) table dimension.
Since there are no CDC dates available in this table, the contents must be extracted to the data
warehouse server in order to identify and process any new/changed records.
Loading of the Valuation dimension consists of two major steps.
1. Extract the Material Valuation.
2. Load the dimension (inserts new rows with changed valuation).

Impact of Conformed Dimension


None. Valuation is unique to the Inventory Analysis Application.

Dependencies
None. However, Stock Overview is dependant upon Valuation so the latter must be
current/up-to-date to ensure that the Overview values are accurate.

Configuration Parameters
• VALUATION_PRICE_CNTRL_DOMNAME = 'VPRSV'
This parameter determines the allowed price control types for materials (e.g. standard vs.
moving price).

User Intervention
None.

Job Flow
1. VALUATION_J / INIT_P
• Calls function VALUATION_VARS_F() to set the jobflow parameters.

Developer Guide 71
Chapter 1: JobStream and Build Descriptions

2. VALUATION_J_B_01_SJ / VALUATION_B_01
• Input Properties: allow duplicate keys
• Extracts Material Valuation info from SAP table MBEW
• Lookup Valuation Price Control description on SAP table DD07T
FROM DD07T
WHERE DOMNAME = '{$U_VALUATION_PRICE_CNTRL_DOMNAME}'
AND DDLANGUAGE = '{$U_LANGUAGE_CD}
• Output is VALUATION_DEX.
Delivery type is truncate.
3. VALUATION_J_B_02_SJ / VALUATION_D_02
• Loads dimension VALUATION from VALUATION_DEX.
Delivery type is update/insert.
4. VALUATION_J / END_P
• Post Procedure:
Update VALUATION_SCD
(table used by stored procedures in cases where the dimension is defined as Type 2 'history
preserving')

Source Tables/Files
• DD07T DD: Texts for Domain Fixed Values (Language-Dependent)
• MBEW Material Valuation
• T001 Company Codes
• T001K Valuation area

Target Tables/Files
• VALUATION

Work Tables
• VALUATION_DEX
• VALUATION_SCD

Stored Procedure
None.

Trigger
None.

Notes/Filters
Truncating the Valuation table will result in the loss of historical values as SAP does not store
price change history.

Validation
1. Check the Console log files for errors.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check for rows with zero SIDs.
4. Check the DIM_ID field and component fields.
5. Check counts, values and ranges for each key field component.
6. Check Type 2 attributes for changes (if applicable).
7. Check row count against source table row count.
8. For selected records, review and verify the target warehouse against the source ERP data.

72 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

Vendor
Description
This is a supplier of materials and/or services to an organization. In Accounts Payable, the
vendor represents an entity that a payment may be made to including expense payments to
employees. In procurement, the vendor identifies the supplier from whom a material is acquired.
In inventory, it identifies the supplier which owns a 'vendor consignment' material.
The key (DIM_ID) is composed of the following attributes:
• COMPANY_CD
• PURCHASE_ORG_CD
• VENDOR_ACCOUNT_NO
This is a Type 1 (non-History Preserving) dimension. If Tracking Changes (SCD) is enabled in
the dimension delivery then, for performance reasons, a (non-unique) index is required on
column VENDOR_DIM_ID.
This is a non-CDC (Changed Data Capture) table dimension.
Since there are no CDC dates available in this table, the contents must be extracted to the data
warehouse server in order to identify and process any new/changed records.
Loading the vendor dimension consists of three major steps:
1. Extract the Vendor Hierarchy.
2. Extract the Vendor information and join to the Vendor Hierarchy.
3. Load the Vendor dimension.
Because of the customer key, which contains three attributes, the extraction of vendor
information is divided into four stages, based on the known/unknown component values:
1. The key VENDOR_ACCOUNT_NO, COMPANY_CD, PURCHSING_ORG_CD are all known
values (join information of LFA1,LFB1, LFM1).
2. VENDOR_ACCOUNT_NO has known values but COMPANY_CD, PURCHSING_ORG_CD
are unknown (LFA1 only). These values are used for IA lookups (generally for consignment
vendors).
3. The key VENDOR_ACCOUNT_NO, COMPANY_CD have known value but
PURCHSING_ORG_CD is unknown (LFA1, LFB1). These values are used in Accounts
Payable.
4. The key VENDOR_ACCOUNT_NO, PURCHSING_ORG_CD have known value but
COMPANY_CD is unknown (LFA1, LFM1). These values are used in Procurement.

Impact of Conformed Dimension


This is a shared dimension that is common to
• Accounts Payable Analysis
• Inventory Analysis
• Procurement Analysis
Care must be taken when installing dimensions, particularly when there is more than one
application. Installing a newer (or same) version of this dimension over an existing one will
replace the entire table and its contents will be lost. If you wish to retain existing data, save a
copy of the data and reload it after the dimension has been upgraded.
If any other warehouse is already installed, check Installation Guide for any important
information on integration with other Analytic Application data marts. That documentation will
describe any manual intervention required.

Dependencies
None.

Developer Guide 73
Chapter 1: JobStream and Build Descriptions

Configuration Parameters
• VENDOR_HIER_TYPE
This parameter is used to determine which vendor hierarchy will be loaded into the Vendor
Table. Only one hierarchy is supported. The default value is A. The list of available values
can be found in "LFMH"."HITYP".

User Intervention
None.

Job Flow
1. VENDOR_J / INIT_P
• Calls function VENDOR_VARS_F() to set the jobflow parameters.
2. VENDOR_J_B_01_SJ / VENDOR_HIER_D_01
• Extracts Vendor and Parent hierarchy info from SAP tables LFMH and LFA1.
FROM "LFMH", "LFA1"
WHERE "LFA1"."LIFNR" = "LFMH"."LIFNR"
AND "LFMH"."HITYP" = '{$U_VENDOR_HIER_TYPE}'
• Output is VENDOR_HIER_DEX.
Delivery type is truncate.
3. VENDOR_J_B_02_SJ / VENDOR_HIER_B_02
• Input Properties: allow duplicate keys
• Extracts the Parent, Customer, Level number and the five levels of the hierarchy from table
VENDOR_HIER_DEX.
• Output is VENDOR_HIER_AEX.
Delivery type is truncate.
4. VENDOR_J_B_03_SJ / VENDOR_B_01
• Input Properties: allow duplicate keys
• Extracts joined into from VENDOR, VENDOR COMPANY and PURCHASING ORG. tables
LFA1,LFB1, LFM1.
FROM "LFA1" INNER JOIN "LFB1" ON "LFA1"."LIFNR" = "LFB1"."LIFNR"
INNER JOIN "LFM1" ON "LFA1"."LIFNR" = "LFM1"."LIFNR"
• Lookup plan group description on SAP table T035T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup vendor type on SAP table T077Y.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup the vendor's hierarchy level info on table VENDOR_HIER_AEX.
• Lookup country name on SAP table T005T.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup industry on SAP table T016T.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup region name on SAP table T005U.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Output is VENDOR_DEX.
Delivery type is truncate.

74 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 1: JobStream and Build Descriptions

5. VENDOR_J_B_04_SJ / VENDOR_B_02
• Input Properties: allow duplicate keys
• Extracts VENDOR info, VENDOR COMPANY and PURCHASING ORG are unknown. table
LFA1.
FROM "LFA1" INNER JOIN "LFB1" ON "LFA1"."LIFNR" = "LFB1"."LIFNR"
• Lookup plan group description on SAP table T035T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup vendor type on SAP table T077Y.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup the vendor's hierarchy level info on table VENDOR_HIER_AEX.
• Lookup country name on SAP table T005T.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup industry on SAP table T016T.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup region name on SAP table T005U.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Output is VENDOR_DEX.
Delivery type is append.
6. VENDOR_J_B_05_SJ / VENDOR_B_03
• Input Properties: allow duplicate keys
• Extracts joined into from VENDOR, VENDOR COMPANY. PURCHASING ORG is unknown.
SAP tables LFA1,LFB1.
• Lookup plan group description on SAP table T035T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup vendor type on SAP table T077Y.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup the vendor's hierarchy level info on table VENDOR_HIER_AEX.
• Lookup country name on SAP table T005T.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup industry on SAP table T016T.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup region name on SAP table T005U.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Output is VENDOR_DEX.
Delivery type is append.
7. VENDOR_J_B_06_SJ / VENDOR_B_04
• Input Properties: allow duplicate keys
• Extracts joined into from VENDOR, PURCHASING ORG. VENDOR COMPANY is
unknown. SAP tables LFA1, LFM1.
FROM "LFA1" INNER JOIN "LFM1" ON "LFA1"."LIFNR" = "LFM1"."LIFNR"
• Lookup plan group description on SAP table T035T
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup vendor type on SAP table T077Y.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup the vendor's hierarchy level info on table VENDOR_HIER_AEX.
• Lookup country name on SAP table T005T.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup industry on SAP table T016T.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Lookup region name on SAP table T005U.
WHERE "SPRAS" = '{$U_LANGUAGE_CD}'
• Output is Append to VENDOR_DEX.
Delivery type is append.

Developer Guide 75
Chapter 1: JobStream and Build Descriptions

8. VENDOR_J_B_07_SJ / VENDOR_D_05
• Loads dimension VENDOR from VENDOR_DEX.
Delivery type is update/insert.
• VENDOR_J / END_P
• Post Procedure: Update VENDOR_SCD
(table used by stored procedures in cases where the dimension is defined as Type 2 'history
preserving')

Source Tables/Files
• LFB1 Vendor Master (Company Code)
• LFA1 Vendor Master (General)
• LFM1 Vendor Master Record Purchasing Organization Section)
• T016T Industry Names
• T005T Country Names
• T005U Taxes: Region Key: Texts
• T035T Planning Group Texts
• T077Y Account Group Names
• LFMH Vendor hierarchy

Target Tables/Files
• VENDOR

Work Tables
• VENDOR_DEX
• VENDOR_HIER_DEX
• VENDOR_HIER_AEX
• VENDOR_SCD

Stored Procedure
None.

Trigger
None.

Notes/Filters
None.

Validation
1. Check the Console log files for errors.
2. Check the DecisionStream job log file, build log files, and reject file.
3. Check for rows with zero SIDs.
4. Check the DIM_ID field and component fields.
5. Check counts, values and ranges for each key field component.
6. Check Type 2 attributes for changes (if applicable).
7. Check row count against source table row count.
8. For selected records, review and verify the target warehouse against the source ERP data.

76 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 2: Entity Relationship Diagrams

The Inventory Analysis for SAP Application data warehouse contains a number of fact and
dimension tables. Each fact table is presented in an entity relationship diagram with the
dimensions that draw data from it, followed by a list of all dimensions.
Note: These diagrams are the property of Cognos Incorporated. Copyright (C) Cognos
Incorporated 1999-2003. All rights reserved. Design Patent Pending.

Legend
In each entity, the column names are preceded by symbols that describe the column’s
properties.

Symbol Column Property


# Primary key

* Mandatory

o Optional

789 Numeric

A Character

Date
31

For more information about each table in the Inventory Analysis data warehouse, see "Data
Mart Metadata" (p. 85).

Developer Guide 77
Chapter 2: Entity Relationship Diagrams

Material Movement

78 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 2: Entity Relationship Diagrams

Physical Inventory

Developer Guide 79
Chapter 2: Entity Relationship Diagrams

Material Reservation

80 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 2: Entity Relationship Diagrams

Stock Overview

Developer Guide 81
Chapter 2: Entity Relationship Diagrams

Stock Usage Forecast

82 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 2: Entity Relationship Diagrams

All Dimensions (I)

Developer Guide 83
Chapter 2: Entity Relationship Diagrams

All Dimensions (II)

84 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

The data mart created for the Inventory Analysis for SAP Application is composed of the
following tables.
Note: The Inventory Analysis for SAP data warehouse model is the property of Cognos
Incorporated. Copyright (C) Cognos Incorporated 1999-2003. All rights reserved. Design Patent
Pending.

All Time
Target table name: ALL_TIME
Table type: Conformed dimension
Description: The All Time dimension is a combination of the Fiscal and Time calendars. Fiscal
calendars represent the yearly period for accounting purposes within an organization. The
Fiscal dimension is important in merged or multinational companies that are required to
consider multiple fiscal calendars. This dimension is flexible enough to accommodate all fiscal
calendars in an organization.
Each fiscal calendar is represented by a fiscal variant code that defines the number of posting
periods in a given fiscal year, as well as their start and end dates in terms of the calendar year.
The posting periods within a fiscal year may belong to fiscal quarters. The default fiscal variant
is defined as the calendar year, which starts on January 1 and ends on December 31, and
includes 12 periods corresponding to the months, and four calendar quarters. The lowest level
of detail in this calendar is a fiscal day. For example, 2001001001 represents January 1, 2001.
Time calendars represent calendar time, with years starting on January 1, ending on December
31, and containing 12 months. The lowest level of detail in this calendar is a day. For example,
20010101 represents January 1, 2001.
The Time dimension is probably the most important dimension in a data warehouse schema,
because the majority of business questions that it supports look at historical changes in various
business measures. The All Time dimension brings the two logical entities, Fiscal and Time,
together into a single super-entity using a process called denormalization. Denormalization is
for faster query processing, an important requirement in data warehousing. Such a combination
is called a cartesian product in the language of set theory. Being a cartesian, the All Time
dimension contains a row for each day of the calendar year for each fiscal calendar variation
(fiscal variant) supported. Hence, this dimension may have the same calendar day repeated
multiple times, once for each fiscal variant. Because of this repetition, you must be careful while
joining the All Time dimension to any of the fact tables in a query. You must define a fiscal
variant in the query to prevent double-counting of fact records. To avoid double-counting in the
majority of queries that do not need to look at fiscal calendars, a default fiscal variant exists in
this data model to define the regular calendar year, with 12 monthly periods and four seasonal
quarters. You can create additional fiscal variants to support financial analysis and planning for
other financial calendar(s).
Column mapping

Column name Datatype Description Derivation or source mapping


CALENDAR_DAY NUMBER(2,0) This is the day of the month that the
_VAL calendar date corresponds to (1, 2,..., 31).

CALENDAR_DT DATE This is the calendar date (e.g., The 1st of


January 2000).

CALENDAR_MO NUMBER(2,0) This represents the month of the year that


NTH_VAL the calendar date falls in (e.g., 1, 2,..., 12).

Developer Guide 85
Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


CALENDAR_QRT NUMBER(1,0) This is the calendar quarter that the This is the quarter within which the calendar
R_VAL calendar date falls in (e.g., 1-4). date exists. There are 4 possible values for
this with the following date ranges:
Calendar Quarter 1 is from January 1 to
March 31
Calendar Quarter 2 is from April 1 to June
30
Calendar Quarter 3 is from July 1 to
September 30
Calendar Quarter 4 is from October 1 to
December 31.

CALENDAR_WEE NUMBER(2,0) The week number in the calendar that the


K_VAL date falls in. The range of values is from 1 to
53.
CALENDAR_WK VARCHAR(10) This is the day of the week the calendar
DY_NM date corresponds to
(e.g.,’MONDAY’,’TUESDAY’, etc.).

CALENDAR_YEA NUMBER(4,0) This is the calendar year formatted as YYYY This is the year component of the calendar
R_VAL (e.g., 2000). date. The default range of values are 1980
to 2020.

CHANGED_DT DATE This represents the date and time of update ETL generated. This is set to the Created
of the warehouse record. This field is Date when the row is inserted.
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

CLNDR_FSCL_P INTEGER This is the fiscal period that the calendar


RD_NO date corresponds to, depending on the fiscal
variant used. The Fiscal Variant is used to
define the fiscal calendars within an
organization. An organization may be
composed of multiple companies (e.g., if
mergers took place), and may have to deal
with multiple fiscal calendars. Each fiscal
calendar is represented by a fiscal variant.
The fiscal variant thus defines the number of
posting periods in a given fiscal year, as well
as their start and end dates in terms of the
calendar year. The default fiscal variant is
defined as the calendar year, which starts
on Jan 1st and ends on Dec 31st, and
includes 12 periods corresponding to the
months, and 4 calendar quarters.
CREATED_DT DATE This represents the date and time of ETL generated.
creation of the warehouse record. This field
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

86 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


DFLT_FSCL_VRN VARCHAR(2) This is the Default Fiscal Variant. The Fiscal User defined parameter called
T_CD Variant is used to define the fiscal calendars DEFAULT_VARIANT which is set to’K4’.
within an organization. An organization may
be composed of multiple companies (e.g., if
mergers took place), and may have to deal
with multiple fiscal calendars. Each fiscal
calendar is represented by a fiscal variant.
The fiscal variant thus defines the number of
posting periods in a given fiscal year, as well
as their start and end dates in terms of the
calendar year. The default fiscal variant is
defined as the calendar year, which starts
on Jan 1st and ends on Dec 31st, and
includes 12 periods corresponding to the
months, and 4 calendar quarters.

FISCAL_DT INTEGER This is the date of the fiscal calendar. The Table: N/A - DERIVED
fiscal date is similar to the calendar date, but Column: FISCAL_YEAR_VAL,
deals with periods instead of months. For POSTING_PERIOD_NO
example, a calendar date may be formatted format(FISCAL_YEAR_VAL,’0000’) ||
as YYYYMMDD, where YYYY represents format(.POSTING_PERIOD_NO,’00’) ||
the calendar year, MM the calendar month, format(Incremental number starting with 1
and DD the calendar day. The fiscal date, reset every fiscal period,’000’). 199906001
however, is formatted as YYYYPPDDD, is the first day of fiscal period 6 in fiscal year
where YYYY is the fiscal year, PP the period 1999. 199906002 is the second day of fiscal
number, and DDD the number of the day period 6 in fiscal year 1999.
within the period (e.g., 199906001).
FISCAL_PERIOD INTEGER This is a data warehouse system generated If it is the first day of the fiscal period then
_SID unique identifier for the fiscal period. this is a generated identifier otherwise set
the value to -1.

FISCAL_QUARTE NUMBER(1,0) This is the quarter of the fiscal calendar. Table: T009B, T009
R_VAL Column: POPER-POSTING PERIOD,
ANZBP-#OF POSTING PERIODS
Depending on the Fiscal Variant, the Fiscal
Quarter is derived in the following ways

Date Dependant Variants:


CEIL((T009B.POPER) / (T009.ANZBP / 4))

Non Year Dependant Variants: ceil


(T009B.POPER / (T009.ANZBP / 4))

Calendar Dependent Variants: Month


component of the
CEIL (((POSTING_PERIOD_END_DATE -
1) / 3) + 1)
FISCAL_VARIAN VARCHAR(2) This is the code representing the Fiscal Table: T009
T_CD Variant. The Fiscal Variant is used to define Column: PERIV-FISCAL YEAR VARIANT
the fiscal calendars within an organization.
An organization may be composed of
multiple companies (e.g., if mergers took
place), and may have to deal with multiple
fiscal calendars. Each fiscal calendar is
represented by a fiscal variant. The fiscal
variant thus defines the number of posting
periods in a given fiscal year, as well as their
start and end dates in terms of the calendar
year. The default fiscal variant is defined as
the calendar year, which starts on Jan 1st
and ends on Dec 31st, and includes 12
periods corresponding to the months, and 4
calendar quarters.

Developer Guide 87
Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


FISCAL_VARIAN VARCHAR(30) This is the name of the fiscal variant. The Table: T009T, T009
T_NM Fiscal Variant is used to define the fiscal Column: LTEXT-DESCRIPTION OF FISCAL
calendars within an organization. An YEAR VARIANT
organization may be composed of multiple
Select T009T.LTEXT
companies (e.g., if mergers took place), and
from T009T, T009
may have to deal with multiple fiscal
where T009.PERIV= T009T
calendars. Each fiscal calendar is
and T009T.SPRAS = LanguageParameter
represented by a fiscal variant. The fiscal
variant thus defines the number of posting
periods in a given fiscal year, as well as their
start and end dates in terms of the calendar
year. The default fiscal variant is defined as
the calendar year, which starts on Jan 1st
and ends on Dec 31st, and includes 12
periods corresponding to the months, and 4
calendar quarters.

FISCAL_YEAR_V NUMBER(4,0) This is the year of the fiscal calendar. This Table: T009B
AL field is in YYYY format. Column: BDATJ,RELJR,BUMON,BUTAG
Depending on the Fiscal Variant, the Fiscal
Year is derived in the following ways (format
YYYY)

Date Dependent Variants:


(T009B.BDATJ + T009B.RELJR)

Non Year Dependent Variants:


Derived from string manipulations involving
Year component of Calendar_ Year_Val +
T009B.RELJR

Calendar Dependant Variants:


Derived from a combination of string
manipulations involving Calendar Date

BDATJ-Posting Date YYYY


RELJR-Year shift relative to the current year
BUMON-Posting Date Calendar Month
BUTAG-Calendar Day for the Posting Date
POSTING_PERIO NUMBER(3,0) This is the total number of posting periods in Table: T009
D_CNT the fiscal year (e.g., 12). This depends on Column: ANZBP-NUMBER OF POSTING
the fiscal variant used. PERIODS
Depending on the Fiscal Variant, the
Number of Posting Periods is derived in the
following ways

:Date Dependent Variants:T009.ANZBP

Non Year Dependent Variants:T009.ANZBP

Calendar Dependent Variants: Hard coded


to 12.

POSTING_PERIO NUMBER(3,0) This is the number of the posting period of Table: T009B
D_NO the fiscal calendar (e.g, 01, 02,... 12). Column: POPER-POSTING PERIOD
Depending on the Fiscal Variant, the
Posting Period is derived in the following
ways:

Date Dependent Variants: T009B.POPER

Non Year Dependent Variants:T


009B.POPER

Calendar Dependent Variants: Month


component of the POSTING_DATE

88 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


PST_PRD_END_ INTEGER This is the ending calendar date of the Table: T009B
DT posting period. This date is in YYYYMMDD Column: BDATJ,BUMON,BUTAG
format (e.g., 20000131). Depending on the Fiscal Variant, the
Posting Date is derived in the following
ways:

Date Dependent Variants:(((T009B.BDATJ *


10000) + (T009B.BUMON * 100)) +
T009B.BUTAG)

Non Year Dependent Variants:Derived from


string manipulations involving Year
component of ADM_TIME_DIM.Year +
T009B.BUMON + T009B.BUTAG

Calendar Dependent Variants:


ADM_LastDay_FN(((TIME_EX1.YEAR_VAL
|| substr(TIME_EX1.TIME_SID, 5, 2)) ||’01’))

***
BDATJ-Posting Date YYYY
BUMON-Posting Date Calendar Month
BUTAG-Calendar Date for the Posting Date

PST_PRD_STRT INTEGER This is the starting calendar date of the


_DT posting period. This date is in YYYYMMDD
format (e.g., 20000101).

TIME_DIM_ID VARCHAR(150) This is the primary key for this entity. This key is composed of:
FISCAL_VARIANT_CD
FISCAL_DT

TIME_SID INTEGER This is a data warehouse system generated


unique identifier for the time. This field is in
YYYYMMDD format. A part of the surrogate
identifier of the All Time dimension, the
other part being Fiscal Variant Code.

Batch
Target table name: BATCH
Table type: Conformed dimension
Description: This table is a grouping of material manufactured in a single production run that is
managed together. In material management terminology, this group is known as a batch or lot.
The reason why companies make use of batches is that it is easier to manage a group of
materials with the same characteristics together than it is to handle them individually.

Developer Guide 89
Chapter 3: Data Mart Metadata

Column mapping

Column name Datatype Description Derivation or source mapping


AVAILABILITY_D INTEGER This is the date on which the batch becomes Pass 1
T available. select MCH1.VERAB from MCHA, MCH1
where MCHA.MATNR = MCH1.MATNR and
MCHA.CHARG = MCH1.CHARG

If no value is returned use default value for


unknown

Pass 2
MCH1.VERAB

BATCH_DIM_ID VARCHAR(150) This is the primary key for this entity. This key is composed of:
BATCH_NO
PLANT_ID
MATERIAL_ID

BATCH_NO VARCHAR(10) This is the source system unique identifier Pass 1


for the batch. MCHA.CHARG

Pass 2
MCH1.CHARG

BATCH_SID INTEGER This is a data warehouse system generated System ETL generated unique id.
unique identifier for the batch.

BATCH_STATUS_ CHAR(1) This is the code representing the status or Pass 1


CD usability of a batch. Statuses include select MCH1.ZUSCH from MCHA, MCH1
Restricted Use, and Blocked. left outer MCHA.MATNR = MCH1.MATNR
and MCHA.CHARG = MCH1.CHARG

If no value is returned use default value for


unknown

Pass 2
MCH1.ZUSCH

CHANGED_DT DATE This represents the date and time of update ETL generated.
of the warehouse record. This field is
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

CREATED_DT DATE This represents the date and time of ETL generated.
creation of the warehouse record. This field
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

LAST_RECEIPT_ INTEGER This is the date on which the last goods Pass 1
DT receipt for this batch was posted. select MCH1.LWEDT from MCHA, MCH1
where MCHA.MATNR = MCH1.MATNR and
MCHA.CHARG = MCH1.CHARG

If no value is returned use default value for


unknown

Pass 2
MCH1.LWEDT

MATERIAL_ID VARCHAR(18) This is the source system unique identifier Pass 1


of the material being managed as a batch. MCHA.MATNR

Pass 2
MCH1.MATNR

90 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


NEXT_INSPECTI INTEGER This is the date on which the next recurring Table: MCH1
ON_DT inspection for the batch will take place. Column: QNDAT
Pass 1
select MCH1.QNDAT from MCHA, MCH1
where MCHA.MATNR = MCH1.MATNR and
MCHA.CHARG = MCH1.CHARG

If no value is returned use default value for


unknown

Pass 2
MCH1.QNDAT

PLANT_ID VARCHAR(4) This is the source system unique identifier Pass 1


of the Plant at which the batch of materials MCHA.WERKS
is located. This is used if this batch is
specific to a Plant and is not managed Pass 2
across plants. set to short char

RESTRICTED_U CHAR(1) This is an indicator for the batch which is Pass 1


SE_IND either set to restricted use (=Y) or not (=N). select MCH1.ZUSTD from MCHA, MCH1
where MCHA.MATNR = MCH1.MATNR and
MCHA.CHARG = MCH1.CHARG

If no value is returned set indicator to N

if MCH1.ZUSTD = 'X'
then
set this indicator to Y
else
set this indicator to N

Pass 2
if MCH1.ZUSTD = 'X'
then
set this indicator to Y
else
set this indicator to N

SHELF_LIFE_EX INTEGER This is the date of expiry of the materials in Pass 1


PR_DT the batch. If the material is not of a type that select MCH1.VFDAT from MCHA, MCH1
expires, this date is set to null. If the where MCHA.MATNR = MCH1.MATNR and
materials in the batch have multiple dates of MCHA.CHARG = MCH1.CHARG
expiry, this is the earliest date amongst
them. If no value is returned use default value for
unknown

Pass 2
MCH1.VFDAT

VENDOR_ACCO VARCHAR(10) This is a source system unique identifier of Pass 1


UNT_NO the vendor that is managing the batch. This select MCH1.LIFNR from MCHA, MCH1 left
is relevant for batches that are managed at outerMCHA.MATNR = MCH1.MATNR and
the vendor's site. MCHA.CHARG = MCH1.CHARG

If no value is returned use default value for


unknown

Pass 2
MCH1.LIFNR

VENDOR_BATCH VARCHAR(15) This is the unique identifier for the batch at Pass 1
_NO the vendor's site. This is relevant for batches select MCH1.LICHA from MCHA, MCH1 left
that are managed at the vendor's site. outer MCHA.MATNR = MCH1.MATNR and
MCHA.CHARG = MCH1.CHARG

If no value is returned use default value for


unknown

Pass 2
MCH1.LICHA

Developer Guide 91
Chapter 3: Data Mart Metadata

Business Area
Target table name: BUSINESS_AREA
Table type: Conformed dimension
Description: This is an organizational unit within financial accounting that represents a
separate area of operations or responsibilities within an organization. Financial accounting
transactions can be allocated to a specific business area.
Business Areas permit external reporting of key performance indicators across multiple
companies by product lines and/or subsidiaries. Alternatively, business area can mean an
organizational entity for which "balance sheets" as well as "profit and loss statements" can be
created for internal reporting. Unlike the company identifier, the business area is not a legally
independent entity and is therefore not subject to the legal requirements for external reporting.
Column mapping

Column name Datatype Description Derivation or source mapping


BUSINESS_ARE VARCHAR(4) This is the code representing the business Table: TGSB
A_CD area. A Business Area permits external Column: GSBER
reporting of key performance indicators Natural key
across multiple Companies by product lines SAP Short Text: Business area
and/or subsidiaries.

BUSINESS_ARE VARCHAR(30) This is the name representing the business Table: TGSBT
A_NM area. A Business Area permits external Column: GTEXT
reporting of key performance indicators
SAP Short Text: BUSINESS AREA
across multiple Companies by product lines DESCRIPTION
and/or subsidiaries.
Derived from a lookup into TGSBT.GTEXT
based on TGSB.GSBER and
TGSBT.SPRAS = Language parameter

BUSINESS_ARE INTEGER This is a data warehouse system generated Created during the load (auto) created in
A_SID unique identifier for the business area. Dimensional Build

BUSINESS_AR_ VARCHAR(150) This is the primary key for this entity. This key is composed of:
DIM_ID BUSINESS_AREA_CD

CHANGED_DT DATE This represents the date and time of update Created during the load process (auto)
of the warehouse record. This field is created in Dimensional Build
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

CNSLDTN_BA_C VARCHAR(4) Code that identifies a business area used Table: TGSB
D centrally in the corporate group. The Column: GSBER_KONS
definition predefines the group parent. All
SAP Short Text: Consolidation business
reporting systems allocate business areas
area
used locally to the consolidation business
areas.

CNSLDTN_BA_N VARCHAR(30) Descriptive name for a consolidation Table: TGSBL


M business area associated with consolidation Column: TXT
business area code. SAP Short Text: BUSINESS AREA
DESCRIPTION

Derived from a lookup into TGSBL.TXT


based on TGSBL.GSBER_KONS and
TGSBL.SPRAS = Language parameter

CREATED_DT DATE This represents the date and time of Created during the load process (auto)
creation of the warehouse record. This field created in Dimensional Build
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

92 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Customer
Target table name: CUSTOMER
Table type: Conformed dimension
Description: This describes customers, such as the ones being Sold-to, Billed-to, Shipped-to,
Payers, Buyers, etc. Customers are relevant in the context of Sales, Financial Accounting,
Customer Relationship Management, etc. A customer may be either a person or a company.
Depending on the ERP implementation, a customer can have one or multiple addresses and
any one of these addresses may be used in relation to a business transaction, such as a Sales
Order.
Column mapping

Column name Datatype Description Derivation or source mapping


ACCNT_ASGMT_ VARCHAR(2) This is the identifier for the revenue account Table: KNVV-CUSTOMER MASTER SALES
GRP_CD on the sales document for the customer DATA
payer. This value can be modified for the Column: KTGRD-ACCOUNT
billing document. ASSIGNMENT GROUP FOR THIS
CUSTOMER
pass 1:
use source column

pass 2 & 3:
use unknown default parameter
ADDRESS_ID VARCHAR(10) This is a source system generated unique Table: KNA1 - GENERAL DATA IN
identifier of the address of the customer. CUSTOMER MASTER
Column: ADRNR - ADDRESS
pass 1, 2 & 3
use source column

BILLING_BLOCK VARCHAR(2) This is an indicator that halts billing for a Table: KNVV, KNA1
_CD customer either in general for that customer Column: FAKSD-BILLING BLOCK FOR
or in a specific sales area. This is used to CUSTOMER (SALES AND DISTRI
block billing if there are legal or pass 1:
credit-related problems. Depending on the If KNVV.FAKSD <> ' ' Then ---- (This means
ERP implementation, in order to block a it is blocked)
customer at an entire sales organization KNVV.FAKSD
level, it may have to be done in each sales else
area in which the sales organization is KNA1.FAKSD
defined. Endif.

For PASS 2 and 3


KNA1.FAKSD

CHANGED_DT DATE This represents the date and time of update ETL generated. This is set to the
of the warehouse record. This field is CREATED_DT when the row is inserted
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

CITY_NM VARCHAR(35) This is the name of the city where the Table: KNA1-GENERAL DATA IN
customer resides. CUSTOMER MASTER
Column: ORT01-CITY
passes 1,2 & 3
use source column

Developer Guide 93
Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


COLLECTION_M VARCHAR(81) This is the identification of the employee Table: PA0002 - HR MASTER RECORD:
NGR_NM who is assigned as the Accounts INFOTYPE 0002 (PERSONAL
Receivable Collection Manager for the Column: VORNA - FIRST NAME, NACHN -
customer in default. This identifier conforms LAST NAME
to the Employee dimension Personnel
pass 1 & 2:
Number and should exist in this dimension.
NULLIF(TRIM("KNA1"."KUNNR"), ' ') ||
'{$U_SEPARATOR_CHAR}' ||
NULLIF(TRIM("TVKO"."BUKRS"), ' ') ||
'{$U_SEPARATOR_CHAR}' ||
'{$U_DEFAULT_SHORT_CHAR}' ||
'{$U_SEPARATOR_CHAR}' ||
'{$U_DEFAULT_SHORT_CHAR}' ||
'{$U_SEPARATOR_CHAR}' ||
'{$U_DEFAULT_SHORT_CHAR}' AS
COLLECTION_MGR_LKP

pass 3:
use unknown default parameter

COMPANY_CD VARCHAR(4) This is the source system unique identifier Table: SEE MAPPING
for a Company. Column: BUKRS - COMPANY CODE OF
THE SALES ORGANIZATION
pass 1:
use TVKO.BUKRS

pass 2:
use knb1.bukrs

pass 3:
use unknown default parameter

COUNTRY_CD VARCHAR(3) This is a code representing the country Table: KNA1-GENERAL DATA IN
where the customer resides. CUSTOMER MASTER
Column: LAND1-COUNTRY KEY
pass 1, 2 & 3
use source column
COUNTRY_NM VARCHAR(15) This is the name of the country where the Table: T005T-COUNTRY NAMES
customer resides. Column: LANDX-COUNTRY NAME
use source column
based on lookup to source table on
KNA1.LAND1 and SPRAS= language
parameter

COUNTY_CD VARCHAR(3) This is a code representing the county Table: KNA1-GENERAL DATA IN
where the customer resides. CUSTOMER MASTER
Column: COUNC-COUNTY CODE
pass 1, 2 & 3
use source column

COUNTY_NM VARCHAR(20) This is the name of the county where the Table: T005F-COUNTY: TEXTS
customer resides. Column: BEZEI-DESCRIPTION
pass 1, 2 & 3:
use source column
based on lookup to T005F
WHERE language filter =T005F.SPRAS
AND
KNA1.LAND1 = T005F.LAND1 AND
KNA1.REGIO = T005F.REGIO AND
KNA1.COUNC = T005F.COUNC

CREATED_DT DATE This represents the date and time of ETL generated
creation of the warehouse record. This field
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

94 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


CREDIT_LIMIT_A NUMBER(15,2) This is the credit limit that the customer has Table: KNKK-CUSTOMER MASTER
MT been granted. This amount is stored in the CREDIT MANAGEMENT: CONTROL AR
currency of the company code in which the Column: KLIMK-CUSTOMER'S CREDIT
customer was created. LIMIT
pass 1:
If KNVV.kkber not null
then
select knkk.klimk from knkk
where CUSTOMER_NO = KNKK.kunnr
and
KNKK.kkber = knvv.kkber
If knkk.klimk = 0
then
use knkk.knkli and knkk.kkber to look up
knkk.klimk (a self join on knkk)
else
use knkk.klimk
else
select knkk.klimk from knkk
where CUSTOMER_NO = KNKK.kunnr
and
KNKK.kkber = T001.kkber (get company
code to do the lookup to T001 from
TVKO.BUKRS)
If knkk.klimk = 0
then
use knkk.knkli and knkk.kkber to look
up knkk.klimk (a self join on knkk)
else
use knkk.klimk

pass 2
Select KNKK.KLIMK from KNKK where
KNA1.KUNNR = KNKK.KUNNR and
T001.KKBER = KNKK.KKBER

To get T001.KKBER:
Lookup to T001.KKBER where
T001.BUKRS = KNB1.BUKRS

Pass 3:
use unknown default parameter

CREDIT_MANAG VARCHAR(81) This is the identification of the employee Table: PA0002 - HR MASTER RECORD:
ER_NM who is assigned as the Accounts INFOTYPE 0002 (PERSONAL
Receivable Analyst for the customer. This Column: VORNA - FIRST NAME,NACHN -
identifier conforms to the Employee SECOND NAME
dimension Personnel Number and should
pass 1 & 2:
exist in this dimension.
NULLIF(TRIM("KNA1"."KUNNR"), ' ') ||
'{$U_SEPARATOR_CHAR}' ||
NULLIF(TRIM("TVKO"."BUKRS"), ' ') ||
'{$U_SEPARATOR_CHAR}' ||
'{$U_DEFAULT_SHORT_CHAR}' ||
'{$U_SEPARATOR_CHAR}' ||
'{$U_DEFAULT_SHORT_CHAR}' ||
'{$U_SEPARATOR_CHAR}' ||
'{$U_DEFAULT_SHORT_CHAR}' AS
CREDIT_MGR_LKP

pass 3
use unknown default parameter

CURRENCY_CD VARCHAR(5) This is the customer's commonly accepted Table: SEE MAPPING
currency for the sales area. This currency is Column: SEE MAPPING
used to settle the customer's charges for
pass 1:
sales. This is used to know the base
use knvv.waers
currency, from which, conversions can occur
if knvv.waers NULL use kna1.uwaer
for the customer's sales.
pass 2 & 3
use kna1.uwaer

Developer Guide 95
Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


CUSTOMER_DIM VARCHAR(150) This is the primary key for this entity. This key is composed of:
_ID CUSTOMER_NO
COMPANY_CD
SALES_ORG_CD
DSTR_CHNL_CD
DIVISION_CD

CUSTOMER_GR VARCHAR(2) This is a code representing a particular Table: KNVV-CUSTOMER MASTER SALES
OUP_CD group of customers, for example, wholesale DATA
or retail, for the purposes of pricing or Column: KDGRP-CUSTOMER GROUP
generating statistics. These groupings may pass 1:
be freely defined by each company use source column
according to the needs of the organization.
pass 2 & 3:
use unknown default parameter

CUSTOMER_GR VARCHAR(20) This is a classification of customers by Table: T151T-CUSTOMERS: CUSTOMER


OUP_NM particular groups, for example, wholesale or GROUPS: TEXTS
retail, for the purposes of pricing or Column: KTEXT-NAME
generating statistics. These groupings may
use source column based on a lookup to
be freely defined by each company
T151T using KNVV.KDGRP and SPRAS =
according to the needs of the organization.
language parameter
CUSTOMER_LEV VARCHAR(35) This is the name of the level 1 to 5 parent of Table: CUSTOMERHIERARCHY.DAT
EL1_NM to a customer. Customers are part of a Column: LEVEL#_CUSTOMER_NM
CUSTOMER_LEV hierarchy, where customers can belong to
where # = 1 to 5
EL5_NM various levels in this hierarchy. This attribute
identifies the level 1 to 5 customer in the pass 1
hierarchy related to this customer. If the use source column
customer itself belongs to this level, the when CUSTOMER_NO =
levels below it will be null or have the CustomerHierarchy.CUSTOMER_NO
customer's name repeated in them. SALES_ORG_CD =
CustomerHierarchy.SALES_ORG_CD
DSTRBTN_CHNNL_CD =
CustomerHierarchy.DSTRBTN_CHNNL_CD
DIVISION_CD =
CustomerHierarchy.DIVISION_CD

pass 2 & 3
use unknown default parameter

CUSTOMER_LO VARCHAR(140) This is the full name of the customer, for Table: KNA1-GENERAL DATA IN
NG_NM example, the concatenation of first, middle, CUSTOMER MASTER
and last names of a person, or the legal Column: NAME1, NAME2, NAME3, NAME4
name of a company. pass 1, 2 & 3
Concatenate the source columns
KNA1.NAME1 +
KNA1.NAME2 +
KNA1.NAME3 +
KNA1.NAME4

CUSTOMER_NM VARCHAR(35) This is the commonly used name of the Table: KNA1-GENERAL DATA IN
customer, for example, the first and last CUSTOMER MASTER
names without the middle name of a person, Column: NAME1-NAME 1
or the trading name of a company.
pass 1, 2 & 3
use source column

CUSTOMER_NO VARCHAR(10) This is the source system generated unique Table: KNA1 - GENERAL DATA IN
identifier of the customer. CUSTOMER MASTER
Column: KUNNR-CUSTOMER NUMBER
pass 1, 2 & 3
use source column

CUSTOMER_SID INTEGER This is a data warehouse system generated


unique identifier for the customer.
CUSTOMER_TYP VARCHAR(4) This is a code that represents the type of Table: KNA1 - GENERAL DATA IN
E_CD customer. CUSTOMER MASTER
Column: KTOKD - CUSTOMER ACCOUNT
GROUP
pass 1, 2 & 3
use source column

96 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


CUSTOMER_TYP VARCHAR(30) This is the description for the type of Table: T077X - ACCOUNT GROUP NAMES
E_NM customer. (TABLE T077D)
Column: TXT30
pass 1, 2 & 3:
use source column
when kna1.KTOKD = t077x.KTOKD AND
t077x.SPRAS = language parameter

CUST_CLSSFCT VARCHAR(2) This is the code representing the Table: KNA1-GENERAL DATA IN
N_CD classification for the type of customer. For CUSTOMER MASTER
example, it classifies the customer as a bulk Column: KUKLA-CUSTOMER
purchaser. Classification values may be CLASSIFICATION
freely defined by the company and therefore
pass 1, 2 & 3
can vary from company to company.
use source column

CUST_CLSSFCT VARCHAR(20) This is classification for the type of Table: TKUKT-CUSTOMERS: CUSTOMER
N_NM customer. For example, it classifies the CLASSIFICATION: TEXTS
customer as a bulk Purchaser. Classification Column: VTEXT-DESCRIPTION
values may be freely defined by the Derived from a lookup into TKUKT.VTEXT
company and therefore can vary from based on KNA1.KUKLA and where SPRAS
company to company. = language parameter

CUST_HIER_LVL NUMBER(4,0) This is the level number of the customer Table: CUSTOMERHIERARCHY.DAT
_NO hierarchy. For example, if the customer is at Column: CUST_HIER_LEVEL_NO
level three of the hierarchy, the customer
pass 1
has a parent (in level 2) and a grandparent
use source column
(in level 1). Level four is unused (the
when CUSTOMER_NO =
customer may be repeated in level four, or it
CustomerHierarchy.CUSTOMER_NO
may be left as null).
SALES_ORG_CD =
CustomerHierarchy.SALES_ORG_CD
DSTRBTN_CHNNL_CD =
CustomerHierarchy.DSTRBTN_CHNNL_CD
DIVISION_CD =
CustomerHierarchy.DIVISION_CD

pass 2 & 3
use unknown default parameter

DIVISION_CD VARCHAR(2) This is a grouping of grouping material, Table: KNVV-CUSTOMER MASTER SALES
products, or services to which a customer DATA
can be associated. A product or service is Column: SPART-DIVISION
always assigned to just one division. from
pass 1:
the point of view of sales and distribution,
use source column
the use of divisions lets you organize your
sales around groups of similar products or
pass 2 & 3:
product lines. This allows the people in a
use unknown default parameter
division who process orders and service
customers to specialize within a
manageable area of expertise. If a sales
organization sells food and non-food
products through both retail and wholesale
distribution channels, each distribution
channel could then be further split into food
and non-food divisions.

DNNG_BLCK_RS VARCHAR(50) Descriptive text for a DUNNING BLOCK Table: T040T - DUNNING BLOCK REASON
N_DSC REASON CODE value. NAMES
Column: TEXT1 - REASON FOR DUNNING
BLOCK TEXT
passes 1, 2:
use source column
when CUSTOMER_NO = KNB5.KUNNR
AND
COMPANY_CD = KNB5.BUKRS AND
knb5.mansp = t040t.mansp and
t040t.spras = language parameter

pass 3:
use unknown default parameter

Developer Guide 97
Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


DSTR_CHNL_CD VARCHAR(2) This is a code representing the mechanism Table: KNVV-CUSTOMER MASTER SALES
by which products or services reach the DATA
customer. Typical examples are wholesale, Column: VTWEG-DISTRIBUTION
retail, internet, or direct sales CHANNEL
pass 1:
use source column

pass 2 & 3:
use unknown default parameter

DUNNING_BLOC CHAR(1) This indicates whether Dunning is to occur Table: KNB5 - CUSTOMER MASTER
K_IND for this particular customer. In other words, if (DUNNING DATA)
the value is set to 'Y' (i.e. blocked for Column: MANSP - DUNNING BLOCK
dunning), then this customer will not receive
pass 1 & 2
dunning letters. If the value is set to 'N', then
use mansp
dunning letters will be sent, as necessary.
when CUSTOMER_NO = KNB5.kunnr and
COMPANY_CD = KNB5.bukrs

if mansp is not blank then


set to 'Y'
else
set to 'N'
endif

pass 3
use unknown default parameter

DUNNING_LEVE CHAR(1) This is the level of "dunning" assigned to this Table: KNB5-CUSTOMER MASTER
L_ID Customer. It signifies the intensity of the (DUNNING DATA)
solicitation for payment of overdue invoices. Column: MAHNS-DUNNING LEVEL
passes 1 & 2
use mahns
when CUSTOMER_NO = knb5.kunnr and
COMPANY_CD to knb5.bukrs

pass 3
use unknown default parameter
EXTRNL_CUST_ VARCHAR(12) This is an identifier for the customer's Table: KNVV-CUSTOMER MASTER SALES
REF_NO company account number as assigned by DATA
the customer (or Vendor). Column: EIKTO-SHIPPER'S (OUR)
ACCOUNT NUMBER AT THE CUSTOM
Pass 1:
Lookup KNVV.EIKTO and if its = ' '
then
Lookup KNB1.EIKTO and if its = ' '
then
use unknown default parameter
else
use KNB1.EIKTO
else
use KNVV.EIKTO

Pass 2:
Lookup KNB1.EIKTO and if its = ' '
then
use unknown default parameter
else
use KNB1.EIKTO

Pass 3:
- use unknown default parameter

FAX_NO VARCHAR(31) This is the fax number of the customer. Table: KNA1-GENERAL DATA IN
CUSTOMER MASTER
Column: TELFX-FAX NUMBER
pass 1, 2 & 3
use source column

98 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


INDUSTRY_CD VARCHAR(4) This is the industry of a distinct group of Table: KNA1-GENERAL DATA IN
companies with the same basic business CUSTOMER MASTER
activity. This is used to select companies for Column: BRSCH-INDUSTRY KEY
evaluation. You can specify industries such
pass 1, 2 & 3
as trade, banking, manufacturing, health
use source column
care, media, etc.

INDUSTRY_DSC VARCHAR(20) This is the description of the industry of a Table: T016T-INDUSTRY NAMES
distinct group of companies with the same Column: BRTXT-DESCRIPTION OF THE
basic business activity. Used to select INDUSTRY KEY
companies for evaluation. You can specify passes 1, 2 & 3:
industries such as trade, banking, Derived from a lookup into T016T.BRTXT
manufacturing, health care, media, etc. based on KNA1.BRSCH and SPRAS=
language parameter

PAYMENT_TERM VARCHAR(4) A code used to classify the Payment terms Table: KNVV-CUSTOMER MASTER SALES
S_CD to allow grouping of customer by the terms DATA
of payment. Column: ZTERM-TERMS OF PAYMENT
KEY
pass 1:
use source column

pass 2 & 3:
use unknown default parameter

PAYMENT_TERM VARCHAR(28) A description used to classify the Payment Table: T052 - TERMS OF PAYMENT
S_DSC terms to allow grouping of customer by the Column: ZTAG1, ZTAG2, ZTAG3, ZPRZ1,
terms of payment. ZPRZ2
Concatenation of all the fields that make up
the payment term code.

Lookup to T052 where


KNVV.ZTERM = T052.ZTERM to retrieve:

concat((If T052.ZTAG1 <> ' ' then


T052.ZTAG1),
(If T052.ZPRZ1 <> ' ' then ' - ' +
T052.ZPRZ1 + '%'),
(If T052.ZTAG2 <> ' ' then ', ' +
T052.ZTAG2),
(If T052.ZPRZ2 <> ' ' then ' - ' +
T052.ZPRZ2 + '%'),
(If T052.ZTAG3 <> ' ' then ', '
+T052.ZTAG3))

Which will give


(e.g. 1) 30 - 3%, 40 - 2%, 60
(e.g. 2) 10 - 2%, 40
(e.g. 3) 20

ZTAG1, ZTAG2, ZTAG3 - Days from


Baseline Date for Payment
ZPRZ1, ZPRZ2 - Cash Discount Percentage
Rate

POSTAL_CD VARCHAR(10) This is the postal code associated with the Table: KNA1-GENERAL DATA IN
residence of a customer. CUSTOMER MASTER
Column: PSTLZ-POSTAL CODE
pass 1, 2 & 3
use source column

RCNCL_GL_ACC VARCHAR(10) This is the GL account number that is used Table: KNB1 - CUSTOMER MASTER
NT_NO for this Customer's AR transactions that are (COMPANY CODE)
rolled up into the general ledger. Many Column: AKONT
Customers may be assigned to the same
passes 1 & 2
GL reconciliation account. This account
use source column
identifier conforms to the Account Identifier
represented in the Chart of Accounts
pass 3
dimension.
use unknown default parameter

Developer Guide 99
Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


REGION_CD VARCHAR(3) This is the code representing the region Table: KNA1-GENERAL DATA IN
where the customer resides. The relevant CUSTOMER MASTER
meaning depends on the country. In the Column: REGIO-REGION (STATE,
USA the region would represent the state, in PROVINCE, COUNTY)
Canada the province, in Switzerland the
pass 1, 2 & 3
canton, in UK the county, etc.
use source column

REGION_NM VARCHAR(20) This is the name of the region where the Table: T005U-TAXES: REGION KEY:
customer resides. The relevant meaning TEXTS
depends on the country. In the USA it would Column: BEZEI-DESCRIPTION
represent the state, in Canada the province,
passes 1, 2 & 3:
in Switzerland the canton, in UK the county,
Derived from a lookup into T005U.BEZEI
etc.
based on KNA1.REGIO, KNA1.LAND1 and
SPRAS = language parameter

RISK_CATEGOR VARCHAR(3) This is a code representing the risk category Table: KNKK-CUSTOMER MASTER
Y_CD (of defaulting on Accounts Receivable) of CREDIT MANAGEMENT: CONTROL AR
the customer. Column: CTLPC-CREDIT MANAGEMENT:
RISK CATEGORY
pass 1:
use CTLPC
when KNKK.KUNNR = KNVV.KUNNR and
KNKK.kkber = CONSOLIDATION_AREA

To get CONSOLIDATION_AREA:
If KNVV.KKBER = ' ' then
Lookup to T001.KKBER where
T001.BUKRS = COMPANY_CD
Else
KNVV.KKBER
Endif

*COMPANY_CD is derived from TVKO

pass 2
To get CONSOLIDATION_AREA:
Lookup to T001.KKBER where
T001.BUKRS = KNB1.BUKRS
Endif

Pass 3:
use unknown default parameter
SALES_DISTRIC VARCHAR(20) This is the geographical sales district that Table: T171T-CUSTOMERS: SALES
T_NM the customer has been assigned to for DISTRICTS: TEXTS
pricing conditions and statistical purposes. Column: BZTXT-NAME OF THE DISTRICT
pass 1
Derived from a lookup into T171T.BZTXT
based on KNVV.BZIRK and where SPRAS
= language parameter

pass 2 & 3
use unknown default parameter

SALES_ORG_CD VARCHAR(4) This is the identifier of the organization unit Table: KNVV-CUSTOMER MASTER SALES
responsible for the sale of certain products DATA
or services. The responsibility of a sales Column: VKORG-SALES ORGANIZATION
organization may include legal liability for pass 1:
products and customer claims. A particular use source column
combination sales organization, distribution
channel, and division is know as a sales pass 2 & 3:
area. use unknown default parameter

100 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


STREET_ADDRE VARCHAR(35) This is the street and Table: KNA1-GENERAL DATA IN
SS_TXT house/building/apartment number where the CUSTOMER MASTER
customer resides. This attribute Column: STRAS-HOUSE NUMBER AND
accommodates multi-line addresses. STREET
pass 1, 2 & 3:
use source column

TELEPHONE_NO VARCHAR(16) This is the complete telephone number of Table: KNA1-GENERAL DATA IN
the customer including country code, area CUSTOMER MASTER
code, and number. Column: TELF1-FIRST TELEPHONE
NUMBER
pass 1, 2 & 3
use source column

Financial Currency Conversion


Target table name: FINANCIAL_CUR_CONV
Table type: Pseudo-dimension. In Cognos Applications, a pseudo-dimension refers to tables
that are not true dimensions, because they are not used to answer business questions.
Description: This dimension supports converting monetary values from one currency to
another for reporting purposes. For example, a multinational company's source system may
have transactions in multiple currencies. While extracting data from the source system the
monetary values are converted from their document currencies to a standard currency (referred
to as the local currency). This entity allows such a conversion. The Fiscal Variant is an important
component of this entity, as currency conversion rates vary from one fiscal calendar to the next.
This entity is typically sourced from the source system's financial currency conversion tables.
The Financial Currency Conversion entity is not a fact or a true dimension. However, it is used
for reports (business questions) that require a currency conversion. It is referred to as a
pseudo-dimension in our documentation.
Column mapping

Column name Datatype Description Derivation or source mapping


BASE_CURRENC VARCHAR(5) This is the code representing the currency Table: TCURV -EXCHANGE RATE TYPES,
Y_CD used as a base for triangulation purposes. T001-COMPANY CODES
Currency codes and associated conversion Column: TCURV.BWAER, T001.WAERS
rates are used in conversions from one
currency to another. The base currency
code is often used in a technique often
referred to as triangulation. In this method,
conversion rates are provided to convert
each currency to a base currency (usually, a
base currency is decided upon and available
as a global parameter set by the application
concerned). The ratio of two such
conversion rates then provides the rate to
convert directly from one currency to
another. For example: Base Currency = US
Dollars, Currency A = Yen, Conversion Rate
from A to Base = 0.009303; Currency B =
Canadian Dollars, Conversion Rate from B
to Base = 0.674933. Given this information,
one may calculate the rate of conversion
directly from A to B as 0.009303 / 0.674933
= 0.013751.

BASE_CURRENC VARCHAR(15) This is the full name of the base currency. Table: TCURT-CURRENCY CODE NAMES
Y_NM Column: KTEXT-SHORT TEXT
BASE_TO_TO_E NUMBER(15,7) This is the rate of conversion from base Table: TCURR-EXCHANGE RATES
XCH_RT currency to the currency converted to. Column: SEE SOURCE SYSTEM
MAPPING LOGIC

Developer Guide 101


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


BS_TO_FRM_EX NUMBER(15,7) This is the inverse of the rate of conversion Table: TCURR-EXCHANGE RATES
CH_RT from the currency converted from to the Column: SEE SOURCE SYSTEM
base currency. MAPPING LOGIC

CHANGED_DT DATE This represents the date and time of update ETL Derived. Changed_Dt is set to
of the warehouse record. This field is Created_Dt on insert of row.
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.
CREATED_DT DATE This represents the date and time of ETL Derived
creation of the warehouse record. This field
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

EXCHANGE_RT NUMBER(15,7) This is the rate of conversion from the


currency converted from to the currency
converted to.

FISCAL_PERIOD INTEGER This is a foreign key to the FISCAL entity Table: FISCAL_EX1
_SID that is identified by the relationship name Column: FISCAL_PERIOD_SID
"fiscal role" sourced from the Logical Data
Model.

FISCAL_VARIAN VARCHAR(2) This is used to define the fiscal calendars Table: FISCAL_EX1
T_CD within an organization. An organization may Column: FISCAL_VARIANT_CD
be composed of multiple companies (e.g., if
mergers took place), and may have to deal
with multiple fiscal calendars. This entity is
flexible enough to accommodate all the
fiscal calendars in the organization. Each
fiscal calendar is represented by a fiscal
variant code. The fiscal variant code thus
defines the number of posting periods in a
given fiscal year, as well as their start and
end dates in terms of the calendar year. The
posting periods within a fiscal year may
belong to fiscal quarters. The default fiscal
variant is defined as the calendar year,
which starts on Jan 1st and ends on Dec
31st, and includes 12 periods corresponding
to the months, and 4 calendar quarters.

FISCAL_YEAR_V NUMBER(4,0) This is the year of the fiscal calendar. This Table: FISCAL_EX1
AL field is in YYYY format. Column: FISCAL_YEAR_VAL

FROM_CURREN VARCHAR(5) This is the currency code to be converted Table: T001-COMPANY CODES
CY_CD from. Column: WAERS-CURRENCY KEY

FROM_CURREN VARCHAR(15) This is the full name of the currency Table: TCURT-CURRENCY CODE NAMES
CY_NM converted from. Column: KTEXT-SHORT TEXT
FROM_TO_BS_E NUMBER(15,7) This is the rate of conversion from the Table: TCURR-EXCHANGE RATES
XCH_RT currency converted from to the base Column: SEE SOURCE SYSTEM
currency. MAPPING LOGIC

GROUP_CURRE VARCHAR(5) This is the code representing the standard Table: T000-CLIENTS, TCURV-EXCHANGE
NCY_CD currency in which all monetary amounts in RATE TYPES
the data warehouse are stored. For Column: T000.MWAER, TCURV.BWAER
example, if the monetary amounts in the
data warehouse are stored in US Dollars,
the code representing that may be USD.
The standard or group currency is useful in
reports that compare monetary amounts
across companies that prefer to work in a
variety of currencies.

102 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


GROUP_CURRE VARCHAR(15) This is the name of the standard currency in Table: TCURT-CURRENCY CODE NAMES
NCY_NM which all monetary amounts in the data Column: KTEXT-SHORT TEXT
warehouse are stored. For example, if the
monetary amounts in the data warehouse
are stored in US Dollars, the code
representing that may be USD. The
standard or group currency is useful in
reports that compare monetary amounts
across companies that prefer to work in a
variety of currencies.

POSTING_PERIO NUMBER(3,0) This is the number of the posting period of Table: FISCAL_EX1
D_NO the fiscal calendar (e.g, 01, 02,... 12). Column: POSTING_PERIOD_NO

PST_PRD_END_ NUMBER(8,0) This is the ending calendar date of the Table: FISCAL_EX1
DT posting period. This date is in YYYYMMDD Column: PST_PRD_END_DT
format (e.g., 20000131).

PST_PRD_STRT NUMBER(8,0) This is the starting calendar date of the Table: FISCAL_EX1
_DT posting period. This date is in YYYYMMDD Column: PST_PRD_STRT_DT
format (e.g., 20000101).
This is retrieved from the FISCAL_EX1 work
table.

-- valid combinations of local currency, fiscal


variant, posting date and "convert to
currency"
select distinct co.waers,
fd.fiscal_period_sid, fd.fiscal_year,
fd.fiscal_variant_ cd, fd.posting_period,
fd.pst_prd_end_dt, fd.pst_prd_strt_dt
from adm.t001 co,
FISCAL_EX1 fd,
file: ADM_CONVERT_TO_CURRENCY
where co.mandt = Client_CD
and fd.FISCAL_VARIANT_CD = co.periv
and
ADM_CONVERT_TO_CURRENCY.CONVE
RT_TO_CURRENCY =’Y’;

RATE_PUBLISHE NUMBER(8,0) This is the date on which the rate of Table: TCURR-EXCHANGE RATES
D_DT currency conversion was published. Column: GDATU-DATE AS OF WHICH THE
EXCHANGE RATE IS EFFECT

TCUR_CNTRY_IS VARCHAR(3) This is the ISO country code of the currency


O_CD converted to.

TO_CURRENCY_ VARCHAR(5) This is the currency code to be converted to.


CD

TO_CURRENCY_ VARCHAR(15) This is the full name of the currency Table: TCURT-CURRENCY CODE NAMES
NM converted to. Column: KTEXT-SHORT TEXT

TO_TO_BASE_E NUMBER(15,7) This is the inverse of the rate of conversion Table: TCURR-EXCHANGE RATES
XCH_RT from base currency to the currency Column: SEE SOURCE SYSTEM
converted to. MAPPING LOGIC

Material
Target table name: MATERIAL
Table type: Conformed dimension
Description: The Material dimension is an important component of Supply Chain Management.
The dimension describes the products that a company manufactures and sells in extreme detail,
allowing one to analyze Sales or Inventory across Material Types, Groups, etc. For example, the
two most basic Inventory Management questions are - "what have I got?" and "where is it?". The
Material Dimension tells us what we have.

Developer Guide 103


Chapter 3: Data Mart Metadata

Column mapping

Column name Datatype Description Derivation or source mapping


BASE_UOM_CD VARCHAR(3) This is a code representing the base unit of Table: MARA-GENERAL MATERIAL DATA
measure in which material stocks are Column: MEINS-BASE UNIT OF
managed. This is sometimes referred to as MEASURE
the Stock Keeping Unit.

CHANGED_DT DATE This represents the date and time of update ETL generated.
of the warehouse record. This field is
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

CREATED_DT DATE This represents the date and time of ETL generated. CHANGED_DT =
creation of the warehouse record. This field CREATED_DT on insert of row.
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

DELETION_DT INTEGER This is the date on which the material is to Table: MARA
be deleted. This is the latest possible date of Column: LAEDA - DATE OF LAST CHANGE
all "TO-dates" referring to the material.
If the DELETION IND (mara.lvorm) = 'X'
then
the value in LAEDA - DATE OF LAST
CHANGE should be used

DELETION_IND CHAR(1) This is an indicator that flags all data on a Table: MARA-GENERAL MATERIAL DATA
material master for deletion. Column: LVORM-FLAG MATERIAL FOR
DELETION AT CLIENT LEVEL
if lvorm = 'X'
then
set to 'Y'
else
set to 'N'
DIM_UOM_CD VARCHAR(3) This is the unit of measure in which the Table: MARA
dimensions of length, width and height of a Column: MEABM-UNIT OF DIMENSION
material or its packaging are measured. FOR LENGTH/WIDTH/HEIGHT

DIVISION_CD VARCHAR(2) This is the code representing the division to Table: MARA
which the material belongs. A division is a Column: SPART-DIVISION
way of grouping materials, products, or
services, based on the sales area or the
business area that it belongs to. A product is
always assigned to just one division, from
the point of view of sales and distribution.
The use of divisions lets you organize your
sales around groups of similar products or
product lines. It also allows the people who
process orders and services within the
division to specialize in an area of expertise
related to the division. For example, if a
sales organization sells food and non-food
products, each could represent a division. If
the sales were conducted through both retail
and wholesale distribution channels, each
distribution channel could then be split into
food and non-food divisions.

104 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


DIVISION_NM VARCHAR(20) This is the name of the division to which the Table: TSPAT-ORGANIZATIONAL UNIT:
material belongs. A division is a way of SALES DIVISIONS: TEXTS
grouping materials, products, or services, Column: VTEXT-NAME
based on the sales area or the business
Derived from a lookup into TSPAT.VTEXT
area that it belongs to. A product is always
BASED ON MARA.SPART and where
assigned to just one division, from the point
SPRAS = LanguageParameter
of view of sales and distribution. The use of
divisions lets you organize your sales
around groups of similar products or product
lines. It also allows the people who process
orders and services within the division to
specialize in an area of expertise related to
the division. For example, if a sales
organization sells food and non-food
products, each could represent a division. If
the sales were conducted through both retail
and wholesale distribution channels, each
distribution channel could then be split into
food and non-food divisions.

HEIGHT_VAL NUMBER(13,3) This is the height of the material or its Table: MARA-GENERAL MATERIAL DATA
packaging, measured in the unit of Column: HOEHE-HEIGHT
dimension.

INDUSTRY_SEC CHAR(1) This is the code representing the branch of Table: MARA-GENERAL MATERIAL DATA
T_CD industry to which the material is assigned. Column: MBRSH-INDUSTRY SECTOR
Examples are fuel, food, hardware, etc.

INDUSTRY_SEC VARCHAR(25) This is the textual description of the branch Table: T137T-INDUSTRY DESCRIPTIONS
T_DSC of industry to which the material is assigned. Column: MBBEZ-INDUSTRY SECTOR
Examples are fuel, food, hardware, etc. DESCRIPTION
SELECT MBBEZ
FROM MARA, T137T
WHERE MARA.MBRSH = T137T.MBRSH
AND
T137T.SPRAS = LanguageParameter
INDUSTRY_STD_ VARCHAR(18) This is the standard industry description for Table: MARA-GENERAL MATERIAL DATA
DSC the material. Column: NORMT-INDUSTRY STANDARD
DESCRIPTION (SUCH AS ANSI

LENGTH_VAL NUMBER(13,3) This is the length of the material or its Table: MARA-GENERAL MATERIAL DATA
packaging, measured in the unit of Column: LAENG - LENGTH
dimension.

LEVEL1_MATERI VARCHAR(40) This is the name of the level 1 to 5 parent of Table: T179T-MATERIALS: PRODUCT
AL_NM to a material. Materials are part of a hierarchy, HIERARCHIES: TEXTS
LEVEL5_MATERI where a material can belong to various Column: VTEXT-DESCRIPTION
AL_NM levels in this hierarchy. This attribute Lookup to T179T.VTEXT
identifies the highest level material in the where PRODH = substring(MARA.PRDHA)
hierarchy related to this material. If the and SPRAS = LanguageParameter
material itself belongs to this level, the levels
below it will be null or have the material's The substring length should be a parameter
name repeated in them. (Material 1 Level Length to Material 5 Level
Length), however the default is from Char 1
to 5.

MATERIAL_CAT_ VARCHAR(2) This is a code representing the category of Table: MARA-GENERAL MATERIAL DATA
CD the material, for example, whether it is a Column: ATTYP - MATERIAL CATEGORY
configurable material, variant, a sales set,
display material, or single material, etc.

Developer Guide 105


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


MATERIAL_CAT_ VARCHAR(60) This is a textual description of the material Table: DD07T - DD: TEXTS FOR DOMAIN
DSC category code, for example, whether it is a FIXED VALUES (LANGUA
configurable material, variant, a sales set, Column: DDTEXT - SHORT TEXT FOR
display material, or single material, etc. FIXED VALUES
select DD07T-DDTEXT where
DD07T-DOMNAM = 'ATTYP'
And DD07T-SPRAS = LanguageParameter
And DD07T-DOMVALUE_L =
MARA-ATTYP

BLANK OR NULL IS A VALID VALUE for


MATERIAL_CAT_CD and returns 'Single
Material (Industry)' in the text field.

MATERIAL_DIM_I VARCHAR(150) This is the primary key for this entity. This key is composed of:
D MATERIAL_ID

MATERIAL_DSC VARCHAR(40) This is the textual description of the Table: MAKT


material. Column: MAKTX
Pass 1
select maktx
from mara, makt
where mara.matnr = makt.matnr and
spras = LanguageParameter

Pass 2
Use same value as material_id

MATERIAL_GRP_ VARCHAR(9) This is the code representing the grouping Table: MARA-GENERAL MATERIAL DATA
CD of materials or services with similar Column: MATKL-MATERIAL GROUP
attributes. Material groups may be used to pass 1)
restrict the scope of analysis to a number of use mara.matkl
similar materials at a time, rather than
focusing on a specific material. pass 2)
use t023.matkl

MATERIAL_GRP_ VARCHAR(20) This is the textual description of the Table: T023T-MATERIAL GROUP
DSC grouping of materials or services with DESCRIPTIONS
similar attributes. Material groups may be Column: WGBEZ-DESCRIPTION OF
used to restrict the scope of analysis to a MATERIAL GROUP
number of similar materials at a time, rather
SELECT WGBEZ
than focusing on a specific material.
FROM MARA, T023T
WHERE MARA.MATKL = T023T.MATKL
AND
SPRAS = LanguageParameter
- a row will not get returned if a description
in the filter language has not been defined.

MATERIAL_ID VARCHAR(18) This is the source system unique identifier Table: MARA-GENERAL MATERIAL DATA
of the material. Column: MATNR-MATERIAL NUMBER
Pass 1)
- load from MARA.MATNR

Pass 2)
- A contrived row will be created using all the
material group values in T023.
- The contrived MATERIAL_ID values
should be for all rows in T023 with the value
"NO MAT " + T023.MATKL.

MATERIAL_SID INTEGER This is a data warehouse system generated System generated unique identifier.
unique identifier for the material.

MATERIAL_TYPE VARCHAR(4) This is a code representing the material Table: MARA-GENERAL MATERIAL DATA
_CD types such as raw materials, finished Column: MTART-MATERIAL TYPE
products, etc.

106 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


MATERIAL_TYPE VARCHAR(25) This is the textual description of the material Table: T134T-MATERIAL TYPE
_DSC types such as raw materials, finished DESCRIPTIONS
products, etc. Column: MTBEZ-DESCRIPTION OF
MATERIAL TYPE
SELECT MTBEZ
FROM MARA, T134T
WHERE MARA.MTART = T134T.MTART
AND
MARA.MADT = T134T.MADT AND
T134T.SPRAS = LanguageParameter

MTRL_HIER_LVL VARCHAR(18) This is the level number of the material Table: MARA-GENERAL MATERIAL DATA
_NO hierarchy. Column: PRDHA-PRODUCT HIERARCHY
Derived from a lookup into T179.STUFE
based on MARA.PRDHA and where
SPRAS = LanguageParameter

NET_WEIGHT_V NUMBER(13,3) This is the net weight of the material Table: MARA
AL expressed in the unit of weight. Column: NTGEW-NET WEIGHT
ORDER_UOM_C VARCHAR(3) This is the unit of measure in which the Table: MARA-GENERAL MATERIAL DATA
D material was ordered. Column: BSTME-ORDER UNIT

PRICE_BND_CAT VARCHAR(2) This is the code representing the range of Table: MARA-GENERAL MATERIAL DATA
_CD prices to which the material belongs. For Column: PLGTP-PRICE BAND CATEGORY
example, price band categories may be
High, Medium, and Low.

PRICE_BND_CAT VARCHAR(20) This is the code representing the range of Table: TWPTT-TEXT: PRICE BAND
_DSC prices to which the material belongs. For CATEGORY
example, price band categories may be Column: VTEXT-DESCRIPTION
High, Medium, and Low. SELECT VTEXT
FROM MARA, TWPTT
WHERE MARA.PLGTP = TWPTT.PLGTP
AND
MARA.MADT = TWPTT.MADT AND
TWPTT.SPRAS = LanguageParameter

VALIDITY_DT INTEGER This is the date from when the material Table: MARA
information is valid. Column: DATAB-VALID-FROM DATE

VENDOR_ACCO VARCHAR(10) This is the source system number of a Table: MARA - GENERAL MATERIAL DATA
UNT_NO vendor, used in the context of Material Column: MFRNR - MANUFACTURER
Management, it is the Prime Vendor of the NUMBER
Material.
VENDOR_NM VARCHAR(35) This is the name of the Prime vendor of the Table: LFA1-VENDOR MASTER
Material as identified by the Vendor Account (GENERAL SECTION)
Number. Column: NAME1-NAME 1
SELECT NAME1
FROM MARA, LFA1
MARA.MFRNR = LFA1.LIFNR

VOLUME_UOM_ VARCHAR(3) This is the code representing the unit of Table: MARA-GENERAL MATERIAL DATA
CD measure in which material volume is Column: VOLEH-VOLUME UNIT
measured.
VOLUME_VAL NUMBER(13,3) This is the volume of the material per unit of Table: MARA
volume. Column: VOLUM-VOLUME

WEIGHT_UOM_C VARCHAR(3) This is the code representing the unit of Table: MARA-GENERAL MATERIAL DATA
D measure in which material weight is Column: GEWEI-WEIGHT UNIT
measured.

WIDTH_VAL NUMBER(13,3) This is the width of the material or its Table: MARA
packaging, measured in the unit of Column: BREIT-WIDTH
dimension.

Developer Guide 107


Chapter 3: Data Mart Metadata

Material Movement Detail


Target table name: MATERIAL_MVMNT_DTL
Table type: Fact
Description: This fact is the information required for management queries relating to material
movements. Material movements are the most basic type of actions that need to be tracked
while managing inventory. Examples of such movements are receipts, issues or transfers of
materials across plants. Each time a material movement occurs, the information pertaining to it
is stored in a document created in the source system.
The document contains information such as the quantity of materials moved, the date when the
movement occurred, the material that moved, the plant it moved from or to, etc. The metric
information from the document is stored here.
Notes: The material movement fact is designed for high performance management queries and
high performance load of summary fact tables. For this reason, it only contains foreign key
columns and measures. Textual attributes that are part of the movement document are kept
separate in the Movement Document entity. Related to the Material Movement entity are
summary entities such as Stock Overview that also contain metrics that are derived from goods
movement transactions.
Column mapping

Column name Datatype Description Derivation or source mapping


BATCH_SID INTEGER This is a foreign key to the BATCH entity Table: SEE SOURCE SYSTEM MAPPING
that is identified by the relationship name LOGIC
"material movement of a batch" sourced Column: SEE SOURCE SYSTEM
from the Logical Data Model. MAPPING LOGIC
Lookup to Batch based on
BATCH_NO = MSEG.CHARG CHAR(10)
PLANT_ID = MSEG.WERKS CHAR(4)
MATERIAL_ID = MSEG.MATNR CHAR(18)

BUSINESS_ARE INTEGER This is a foreign key to the BUSINESS Table: MSEG


A_SID AREA entity that is identified by the Column: GSBER-BUSINESS AREA
relationship name "material movement for
Lookup to Business Area based on GSBER
Business Area" sourced from the Logical
field equal to Business Area Code
Data Model.

CHANGED_DT DATE This represents the date and time of update ETL generated.
of the warehouse record. This field is
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.
CREATED_DT DATE This represents the date and time of ETL generated. CHANGED_DT =
creation of the warehouse record. This field CREATED_DT on insert of row.
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

108 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


CUSTOMER_SID INTEGER This is a foreign key to the CUSTOMER Table: SEE SOURCE SYSTEM MAPPING
entity that is identified by the relationship LOGIC
name "material movement for customer Column: SEE SOURCE SYSTEM
order" sourced from the Logical Data Model. MAPPING LOGIC
Lookup Customer DIM based on
MSEG.KUNNR =
CUSTOMER.CUSTOMER_NO
MSEG.BUKRS =
CUSTOMER.COMPANY_CD and
unknown value =
CUSTOMER.SALES_ORG_CD and
unknown value =
CUSTOMER.DSTR_CHNL_CD and
unknown value =
CUSTOMER.DIVISION_CD
DOCUMENT_ISS INTEGER This is a foreign key to the TIME entity that Table: MKPF
UED_DT is identified by the relationship name Column: BLDAT
"material movement document create on
Convert the source date to eApps date
date in time" sourced from the Logical Data
format of YYYYMMDD.
Model.
If ((ToChar(DOCUMENT_DT_TMP) <=
$AS_AT_DATE And
O_MAT_MOV_CREATED_DT_char >
$AS_AT_DATE),
ToChar(AddToDate(ToDate($AS_AT_DATE,'
YYYYMMDD'),1), 'YYYYMMDD'),
If((ToChar(DOCUMENT_DT_TMP) >
$AS_AT_DATE And
O_MAT_MOV_CREATED_DT_char <=
$AS_AT_DATE),
O_MAT_MOV_CREATED_DT_char,
ToChar(DOCUMENT_DT_TMP)))

FISCAL_PERIOD INTEGER This is a foreign key to the FISCAL entity Table: SEE SOURCE SYSTEM MAPPING
_SID that is identified by the relationship name LOGIC
"material movement has fiscal period" Column: SEE SOURCE SYSTEM
sourced from the Logical Data Model. MAPPING LOGIC
Lookup to ALL_TIME based on
use MKPF.BUDAT for fiscal date
join MSEG to T001 on MSEG.BUKRS =
T001.BUKRS to get the fiscal variant
T001.PERIV

FSCL_PRD_DC_I INTEGER This is a foreign key to the FISCAL entity Lookup to ALL_TIME based on
S_SID that is identified by the relationship name use MKPF.BLDAT for fiscal date
"material movement issued in" sourced from join MSEG to T001 on MSEG.BUKRS =
the Logical Data Model. T001.BUKRS to get the fiscal variant
T001.PERIV

LOCAL_CURREN VARCHAR(5) This is the code representing the currency in Table: T001W, T001K, T001
CY_CD which the company that created the Column: WAERS, BWKEY, BUKRS
document prefers to work. Currencies are Select T001.WAERS
applicable to monetary amounts. For from T001, T001W, T001K
example, if the currency which the where T001W.BWKEY = T001K.BWKEY
concerned company prefers to work in is and T001.BUKRS = T001K.BUKRS
Canadian dollars, the code representing it
may be CAD. This is used on reports that T001W - Plants/Branches,
are specific to the company that created the T001K- Valuation area,
document. Such reports display the T001-Company Codes
monetary amounts stored in the data
warehouse (which are in group currency) in T001.WAERSCurrency key-Char(5)
the currency of the company concerned.
T001W.BWKEY-Valuation area-Char(4)
T001K.BWKEY-Valuation area-Char(4)
T001.BUKRS-Company code-Char(4)
T001K.BUKRS-Company code-Char(4)

Developer Guide 109


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


MATERIAL_SID INTEGER This is a foreign key to the MATERIAL entity Table: MSEG
that is identified by the relationship name Column: MATNR
"movement details of material" sourced from
if MSEG.MATNR = ' '
the Logical Data Model.
then
SELECT EKPO.MATKL
WHERE MSEG.EBLEN = EKPO.EBLEN
AND
MSEG.EBELP = EKPO.EBELP --
EKPO can be filtered on EKPO.MATNR = ' '

MATERIAL ID = 'NO MAT' +


MSEG.MATNR
else
MATERIAL ID = MSEG.MATNR
MATERIAL_STRG INTEGER This is a foreign key to the MATERIAL Table: SEE SOURCE SYSTEM MAPPING
_SID STORAGE entity that is identified by the LOGIC
relationship name "movement for material Column: SEE SOURCE SYSTEM
storage" sourced from the Logical Data MAPPING LOGIC
Model.
Lookup to Material Storage based on
MATERIAL_ID = MSEG.MATNR CHAR(18)
PLANT_ID = MSEG.WERKS CHAR(4)

MOVEMENT_AM NUMBER(13,2) This is the total value assigned to the goods Table: MSEG
T in the Inventory Movement Document Line Column: DMBTR
Item, in Group Currency. This value can be If MSEG.SHKZG = 'H'
calculated in a number of ways, by then
considering the total price of the goods, the MSEG.DMBTR * -1 (credit)
total cost of it, the total discount applied to it,
else
etc. The method of calculation of this field
MSEG.DMBTR * 1 (debit)
depends on the source system. This is
.
useful in comparing stocks across various
The formula above assigns a sign to the
types of products. Each product may be
quantity based on the debit/credit indicator.
stored in a separate unit of measure (e.g.,
This way, all receipts are positive and issues
bottles vs. boxes), thus making comparisons
are negative.
of quantities meaningless. The only
meaningful comparisons that may be made
is in terms of currency amounts associated
with the goods.

MOVEMENT_QT NUMBER(13,3) This is the actual number of units of the Table: SEE SOURCE SYSTEM MAPPING
Y product moved, measured in base units. LOGIC
The unit of measure (e.g., bottles, pieces) in Column: SEE SOURCE SYSTEM
which the units are expressed is defined MAPPING LOGIC
separately, by relating the Billing Document If XAUTO = 'X' and LGORT = ' ' and SOBKZ
Line Item to the Unit of Measure dimension. =''
THEN
set MOVEMENT_QTY = 0
ELSE
If MSEG.MENGE = 0
THEN
If MSEG.SHKZG = 'H'
then
MSEG.ERFMG * -1 (credit)
else
MSEG.ERFMG * 1 (debit)
ELSE
If MSEG.SHKZG = 'H'
then
MSEG.MENGE * -1 (credit)
else
MSEG.MENGE * 1 (debit)
.
The formula above assigns a sign to the
quantity based on the debit/credit indicator.
This way, all receipts are positive and issues
are negative.

110 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


MTRL_MVMNT_D INTEGER This is a foreign key to the MATERIAL Table: SEE SOURCE SYSTEM MAPPING
OC_SID MOVEMENT DOCUMENT entity that is LOGIC
identified by the relationship name "material Column: SEE SOURCE SYSTEM
movement has document details" sourced MAPPING LOGIC
from the Logical Data Model.
Lookup to Movement Document based on
Document No = MSEG.MBLNR char(10)
Document Year No = MSEG.MJAHR char(4)
Document Item No = MSEG.ZEILE cha(4)

MVMNT_DOC_C INTEGER This is a foreign key to the MOVEMENT Table: SEE SOURCE SYSTEM MAPPING
LSS_SID DOCUMENT CLASS entity that is identified LOGIC
by the relationship name "movement detail Column: SEE SOURCE SYSTEM
of material movement doc class" sourced MAPPING LOGIC
from the Logical Data Model.
Lookup to Movement Document Class
based on
Document Type CD = MKPF.BLART char(2)
Document Line Type CD = MSEG.BWART
char(3)
Special Stock CD = MSEG.SOBKZ char(1)
Initiating Document Type CD =
MSEG.KZBEW char(1)
Receipt Type Cd = MSEG.KZZUG char(1)
Consumption Posting CD =
MSEG.KZVBR-Char(1)

PLANT_SID INTEGER This is a foreign key to the PLANT entity that Table: SEE SOURCE SYSTEM MAPPING
is identified by the relationship name LOGIC
"material movement in/out of plant" sourced Column: SEE SOURCE SYSTEM
from the Logical Data Model. MAPPING LOGIC
Lookup to Plant based on
PLANT_ID = MSEG.WERKS CHAR(4)
STORAGE_LCTN_CD = MSEG.LGORT
CHAR(4)

REVERSE_PLAN INTEGER This is a foreign key to the PLANT entity that Table: SEE SOURCE SYSTEM MAPPING
T_SID is identified by the relationship name LOGIC
"material movement has reverse plant" Column: SEE SOURCE SYSTEM
sourced from the Logical Data Model. MAPPING LOGIC
Lookup in the Plant dimension based on
PLANT_ID = MSEG.UMWRK
STORAGE_LCTN_CD = MSEG.UMLGO
.
SAP help text for MSEG.UMWRK
Receiving plant/issuing plant
Definition
Indicates the receiving or issuing plant.
The receiving plant is the plant or internal
organizational unit that is
to receive the goods.
The issuing plant is the plant that issues
the goods.
Note
The value of the transfer posting is
determined not by the plant entered
here but by the plant specified in the
Plant field.

Developer Guide 111


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


SHELF_LIFE_EX INTEGER This is a foreign key to the TIME entity that Table: SEE SOURCE SYSTEM MAPPING
PR_DT is identified by the relationship name LOGIC
"material has shelf life expiration date" Column: SEE SOURCE SYSTEM
sourced from the Logical Data Model. MAPPING LOGIC
Use the min. non-null value of
MSEG.VFDAT and MCHA.VFDAT.

Get MCHA.VFDAT by joining MSEG to


MCHA(do this as an left outer join on
MSEG) where
MSEG.MATNR = MCHA.MATNR AND
MSEG.WERKS = MCHA.WERKS AND
MSEG.CHARG = MCHA.CHARG

Use unknown value if there is no expiration


date

STOCK_CLASS_ INTEGER This is a foreign key to the STOCK CLASS Table: SEE SOURCE SYSTEM MAPPING
SID entity that is identified by the relationship LOGIC
name "material movement of stock class" Column: SEE SOURCE SYSTEM
sourced from the Logical Data Model. MAPPING LOGIC
Lookup to Stock Class
if MSEG.INSMK = ' '
then
STOCK_TYPE_CD = MSEG.BESTQ
else
STOCK_TYPE_CD = MSEG.INSMK

SPECIAL_STOCK_CD = MSEG.SOBKZ
CHAR(1)

STORAGE_BIN_ INTEGER This is a foreign key to the STORAGE BIN Table: SEE SOURCE SYSTEM MAPPING
SID entity that is identified by the relationship LOGIC
name "material movement in/out of storage Column: SEE SOURCE SYSTEM
bin" sourced from the Logical Data Model. MAPPING LOGIC
Lookup Storage Bin based on
WAREHOUSE_NO = MSEG.LGNUM
CHAR(3)
STORAGE_TYPE_CD = LGTYP CHAR(3)
STORAGE_BIN_ID = LGPLA CHAR(10)

TIME_SID INTEGER This is a foreign key to the TIME entity that Table: MKPF
is identified by the relationship name Column: BUDAT
"material movement posting date" sourced
Lookup to ALL_TIME (calendar date) based
from the Logical Data Model.
on
MKPF.BUDAT

112 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


UOM_SID INTEGER This is a foreign key to the UNIT OF Table: MSEG
MEASURE entity that is identified by the Column: MEINS
relationship name "material movement in IF MSEG.MEINS = ' '
base unit of measure" sourced from the
then
Logical Data Model.
LOOKUP UOM_SID WHERE
UNIT_OF_MEASURE_CD =
MSEG.ERFME
else
LOOKUP UOM_SID WHERE
UNIT_OF_MEASURE_CD = MSEG.MEINS
.
SAP help text
Base unit of measure
Unit of measure in which stocks of the
material are managed. The system
converts all the quantities you enter in
other units of measure
(alternative units of measure) to the base
unit of measure.
Procedure
You define the base unit of measure and
also alternative units of
measure and their conversion factors in
the material master record.
Dependencies
Since all data is updated in the base unit
of measure, your entry is
particularly important for the conversion
of alternative units of
measure. A quantity in the alternative unit
of measure can only be shown
precisely if its value can be shown with
the decimal places available.
To ensure this, please note the following:
o The base unit of measure is the unit
satisfying the highest
necessary requirement for precision.
o The conversion of alternative units of
measure to the base unit
should result in simple decimal
fractions (not, for example, 1/3 =
0.333...).
Inventory Management
In Inventory Management, the base unit
of measure is the same as the
stockkeeping unit.
Services
Services have units of measure of their
own, including the following:
o Service unit
Unit of measure at the higher item
level. The precise quantities of
the individual services are each at the
detailed service line level.
o Blanket
Unit of measure at service line level for
services to be provided
once only, and for which no precise
quantities can or are to be
specified.

Developer Guide 113


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


VALUATION_SID INTEGER This is a foreign key to the VALUATION Table: SEE SOURCE SYSTEM MAPPING
entity that is identified by the relationship LOGIC
name "material has price valuation" sourced Column: SEE SOURCE SYSTEM
from the Logical Data Model. MAPPING LOGIC
Lookup Valuation based on
MATERIAL_ID = MSEG.MATNR CHAR(18)
VALUATION_AREA_CD = T001W.BWKEY
join T001W to MSEG where
T001W.WERKS = MSEG.WERKS
VALUATION_TYPE_CD = MSEG.BWTAR
CHAR(10)

VENDOR_SID INTEGER This is a foreign key to the VENDOR entity Table: SEE SOURCE SYSTEM MAPPING
that is identified by the relationship name LOGIC
"material movement for vendor" sourced Column: SEE SOURCE SYSTEM
from the Logical Data Model. MAPPING LOGIC
Lookup Vendor based on
VENDOR_ACCOUNT_NO = MSEG.LIFNR
CHAR(10)
COMPANY_CD = MSEG.BUKRS
VARCHAR(4)
PURCHASE_ORG_CD = unknown value
(there is no purchasing group context for the
vendor lookup)

Material Movement Document


Target table name: MATERIAL_MVMNT_DOC
Table type: Dimension
Description: This table is the textual information that is part of a Material Movement Document,
such as header text, item text, user name, etc. A Material Movement Document is created every
time a material movement (such as a receipt, issue or transfer) occurs. The Material Movement
Document contains information critical to business analysis such as the document number,
related order number, the quantity of items moved, the amounts associated with the quantity,
etc. This type of critical information is stored in the Material Movement table. The remaining
(largely textual) information that is not relevant to the majority of business analysis, but may be
required in specific reports, such as those that re-create source system document detail, is
stored in the Material Movement Document dimension.
Column mapping

Column name Datatype Description Derivation or source mapping


CHANGED_DT DATE This represents the date and time of update The date when the target record was last
of the warehouse record. This field is updated in the source system. Populated by
populated for records that have been the ETL program.
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.
CREATED_DT DATE This represents the date and time of The date when the target record was first
creation of the warehouse record. This field extracted from the source system.
is populated for newly inserted records Populated by the ETL program.
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

DOCUMENT_ITE VARCHAR(4) This is the source system generated Table: MSEG


M_NO number that identifies a line in a document, Column: ZEILE
It is part of the natural key.
NK 3

114 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


DOCUMENT_NO VARCHAR(10) This is the source system generated Table: MSEG
identifier of a document which is part of the Column: MBLNR
natural key. NK 1

DOCUMENT_YE VARCHAR(4) This is the calendar year in which the Table: MSEG
AR_VAL material document was posted. In some Column: MJAHR
source systems, the material document
NK 2
year, in conjunction with the document
number, uniquely identifies a document. In
SAP it is part of the natural key.

ITEM_TXT VARCHAR(50) This is the textual information associated Table: MSEG


with the line item of the document. Column: SGTXT

MTRL_MVMNT_D INTEGER This is a data warehouse system generated System generated unique id.
OC_SID unique identifier for the movement
document.

MTRL_MV_DOC_ VARCHAR(150) This is the primary key for this entity. This key is composed of:
DIM_ID DOCUMENT_NO
DOCUMENT_YEAR_VAL
DOCUMENT_ITEM_NO

ORDER_DOC_IT VARCHAR(6) This is the source system generated unique If MSEG.KDPOS NE ' ' -- (sales order item
M_NO identifier of the Sales Order or Purchase number)
Order Document Line Item that this Material use MSEG.KDPOS to populate warehouse
Movement Document Line Item is related to. column

If MSEG.EBELP NE ' ' -- (purchase order


item number)
use MSEG.EBELP to populate warehouse
column

If MSEG.KDPOS EQ ' ' AND MSEG.EBELP


EQ ' '
use unknown character value to populate
warehouse column

ORDER_DOC_N VARCHAR(10) This is the source system generated unique Table: SEE SOURCE SYSTEM MAPPING
O identifier of the Sales Order or Purchase LOGIC
Order Document that this Material Column: SEE SOURCE SYSTEM
Movement Document is related to. MAPPING LOGIC
If MSEG.KDAUF NE ' ' -- (sales order
number)
use MSEG.KDAUF to populate warehouse
column

If MSEG.EBELN NE ' ' -- (purchase order


number)
use MSEG.EBELN to populate warehouse
column

If MSEG.EBELN EQ ' ' AND MSEG.KDAUF


EQ ' '
use unknown character value to populate
warehouse column

ORDER_DOC_TY VARCHAR(2) This code represents the type of source If MSEG.KDPOS NE ' ' -- (sales order item
P_CD document (sales, purchasing, etc.) that number)
initiated a movement. For example, PO = use "SO" to populate warehouse column
purchase order, and SO = sales order.
If MSEG.EBELP NE ' ' -- (purchase order
item number)
use "PO" to populate warehouse column

If MSEG.KDPOS EQ ' ' AND MSEG.EBELP


EQ ' '
use unknown character value to populate
warehouse column

USER_NM VARCHAR(12) This is the identification of the source Table: MKPF


system user who created the document. Column: USNAM

Developer Guide 115


Chapter 3: Data Mart Metadata

Material Movement Document Class


Target table name: MOVEMENT_DOC_CLSS
Table type: Dimension
Description: This contains combinations of attributes that are classifiers of material documents.
Such attributes classify material movement transactions as to the nature of the goods
movement. At the highest level of classification, a goods movement is either an "issue" or a
"receipt". At a lower level, the movement class describes the exact nature of the movement (e.g.
goods issue to production) and the reason for movement. Such classifications are used in the
calculation of stock level and stock usage.
For example, "goods issue for transfer to another plant" is not considered as usage whereas
"goods issue to production" is. Typically, a source system has many such classifiers, such as
Document Category, Document Type, Document Line Type, Document Status, etc. This
dimension combines every one of them into a single entity. This is done primarily for technical
reasons, such as improving the performance of queries and minimizing the storage space
required (a single link between the Class and the Fact is sufficient to answer queries that look at
metrics across document classifiers).
However, in certain cases, it makes business sense to do so as well. For example, combinations
of classifiers may be meaningful to a business. If so, some Class Status attributes may be
added that represent such meaningful combinations. This also contains a number of multipliers.
Multipliers are used for calculating derived metrics from existing ones, and have values of 1 or 0.
The derived metric is calculated by multiplying the multiplier with the existing metric. Multipliers
are defined by the ETL program based on certain source system classifiers.
Technical Notes: There are two options for creating the combinations of attributes. If the
attributes have only a few members, a complete set of combinations (called a complete
cartesian product) may be created at the time of initial load of the data warehouse, even though
some of the combinations may not make business sense. This option saves time of load.
However, if creating a complete cartesian product produces a very large set of combinations
most of which is meaningless, it may be better to use only the combinations that already exist in
documents. This is less efficient with regard to load time, but saves storage space.
Column mapping

Column name Datatype Description Derivation or source mapping


BLOCKED_MULT SMALLINT This is the multiplier that indicates whether Table: T156
the material movement is of "blocked" stock Column: KZWES-GR BLOCKED STOCK
or not. "Blocked" stock is a type of stock that
same logic for both passes 1 and 2:
indicates that the material is restricted from
usage for an unspecified reason. Multipliers
IF T156.KZWES = 'X' then
are used for calculating derived metrics from
set to 1
existing ones, and have values of 1 or 0.
ELSE
The derived metric is calculated by
set to 0
multiplying the multiplier with the existing
ENDIF
metric. Multipliers are defined by the ETL
program based on certain source system
classifiers.

CHANGED_DT DATE This represents the date and time of update ETL Generated. Changed_Dt set to
of the warehouse record. This field is Created_Dt on insert.
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

116 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


CNSMPTN_PSTN CHAR(1) This is an code that specifies whether Table: T156T
G_CD consumption is to be posted to a Column: KZVBR-CONSUMPTION
consumption account, an asset account, a POSTING
sales order, or a project account. In the case
Pass 1: set to T156T.KZVBR
of goods receipt for purchase orders the
account assignment is obtained from the
Pass 2: Set to default value
account assignment category on the
purchase order.

CREATED_DT DATE This represents the date and time of ETL Generated
creation of the warehouse record. This field
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

CUSTOMER_CO SMALLINT This multiplier that is applied to the Same logic for both passes 1 and 2. Set to
NS_MULT computation of KPIs. This multiplier is set to default value. User may update this field
1 if the movement is an "issue to" or "receipt through Console.
from" a customer site but belongs to (is
owned by) the source plant. Customer
consignment is material located at a
customer location.

DISPOSAL_MULT SMALLINT This is a multiplier that is applied to the Same logic for both passes 1 and 2. Set to
computation of KPIs. This multiplier is set to default value. User may update this field
1 if the movement is a disposal. through Console.

DOCUMENT_LN_ VARCHAR(3) This code represents material movement Table: T156T


TYP_CD document line types. In this context, Column: BWART-MOVEMENT TYPE
document line types represent types of (INVENTORY MANAGEMENT)
material movement. Examples include same value for both pass 1 and 2.
"purchase order to warehouse", "goods
issue", " reversal of goods receipt", etc.
DOCUMENT_TY VARCHAR(2) This is the code representing the type of Table: T003
PE_CD document. Examples are "customer Column: BLART-DOCUMENT TYPE
invoice", "customer payment", "vendor
Pass 1: set to T003.BLART
invoice", "vendor payment", "inventory
document", "goods issue/receipt", etc.
Pass 2: Set to default value

DOCUMENT_TY VARCHAR(20) This is the textual description of the type of Table: T003T
PE_DSC document. Examples are "goods issue", Column: LTEXT
"goods receipt", etc. Pass 1:
Lookup to T003T. Lookup using
Document_typ_cd and filter by SPRAS
equal to language parameter.

Pass 2:
Set to default value.

DOC_LN_TYP_D VARCHAR(20) This is a textual description of the material Table: T156T


SC movement document line type. In this Column: BTEXT-MOVEMENT TYPE TEXT
context, document line types represent (INVENTORY MANAGEMENT)
types of material movement. Examples
Pass 1:
include "purchase order to warehouse",
Set to T156T.BTEXT.
"goods issue", " reversal of goods receipt",
etc.
Pass 2:
Perform a lookup to T156T as
Select Last Row(BTEXT) from T156T
where SPRAS = Default Language
Parameter
and BWART = Document Line Type Code
and SOBKZ = ' '

Developer Guide 117


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


GOODS_ISSUE_ SMALLINT This multiplier that is applied to the For Pass 1:
MULT computation of KPIs. This multiplier is set to If Document_Type_Cd in
1 if this is a goods issue from inventory GoodsIssueParameter then
accounting. set to 1
Else
set to 0
Endif

For Pass 2:
Set to default value.

* User may update this field through


Console.

GOODS_RECEIP SMALLINT This is a multiplier that is applied to the Pass 1:


T_MULT computation of KPIs. This multiplier is set to If Document_Type_Cd in
1 if this is a receipt into inventory GoodsReceiptParameter then
accounting. set to 1
Else
set to 0
Endif

Pass 2:
Set to default value.

* User may update this field through


Console.
INDPNDNT_RQR SMALLINT This is an Indicator specifying whether a Table: T156
_MULT requirements reduction is necessary or not Column: XPBED-REQUIREMENTS
for a given material document item in the REDUCTION BY GOODS MOVEMENTS
case of a goods movement. Same logic for both passes 1 and 2.

IF XPBED = 'X' then


set to 1
ELSE
set to 0
ENDIF

INSPECTION_MU SMALLINT This is a multiplier that is applied to the Table: T156


LT computation of KPIs. This multiplier is set Column: QSSBW-INSPECTION BY
to 1 if the movement type is a movement QUALITY ASSURANCE
into inspection.
Same logic for both passes 1 and 2:
If QSSBW = 'X' then
set to 1
Else
set to 0
Endif
INTTNG_DOC_T CHAR(1) This is an code specifying the type of Table: T156T
YP_CD document for which the movement relates, Column: KZBEW-MOVEMENT INDICATOR
i.e.purchase order, delivery note etc., that
Pass 1: set to T156T.KZBEW
constitutes the basis for the movement. This
is necessary, for example, to enable a
Pass 2: Set to default value
distinction to be made between a goods
receipt for a purchase order and a goods
receipt for a production order. These two
movements result in different data and
accounts updates in the system.

INTTNG_DOC_T VARCHAR(60) Textual description that identifies the type of Pass 1


YP_DSC document for which the movement relates. select DD07T.DDTEXT where
DD07T.DOMNAM = 'KZBEW'
And DD07T.DDLANGUAGE =
LanguageParameter
And DD07T.DOMVALUE_L =T156T.KZBEW

Pass 2
set to default short char

MVMNT_DOC_C INTEGER This is a data warehouse system generated System generated unique id.
LSS_SID unique identifier for the movement class.

118 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


MV_DOC_CLSS_ VARCHAR(150) This is the primary key for this entity. This key is composed of:
DIM_ID DOCUMENT_TYPE_CD
DOCUMENT_LN_TYP_CD
SPECIAL_STOCK_CD
INTTNG_DOC_TYP_CD
RECEIPT_TYP_CD
CNSMPTN_PSTNG_CD

RECEIPT_TYP_C CHAR(1) This is the code representing the type of Table: T156T
D purchase order if this requires different Column: KZZUG-RECEIPT INDICATOR
accounting treatment (for example, stock Pass 1: set to T156T.KZZUG
transport order or a sub-contract order).
Pass 2: Set to default value

RECEIPT_TYP_D VARCHAR(60) Description of the type of purchase order. Pass 1


SC select DD07T.DDTEXT where
DD07T.DOMNAM = 'KZZUG'
And DD07T.DDLANGUAGE =
LanguageParameter
And DD07T.DOMVALUE_L =T156T.KZZUG

Pass 2
set to default short char

REVERSAL_MUL SMALLINT This multiplier is used to identify Table: T156


T transactions that are "reversals" of an Column: XSTBW-REVERSAL MOVEMENT
original transaction. TYPE
Same logic for both passes 1 and 2:
If XSTBW = 'X' then
set to 1
Else
set to 0
Endif

SHRINKAGE_MU SMALLINT This is a multiplier that is applied to the Same logic for both passes 1 and 2. Set to
LT computation of KPIs. This multiplier is set to default value. User may update this field
1 if the if the movement is an adjustment to through Console.
inventory as a result of a physical stock. The
default is 0.

SIGN_REVERSA SMALLINT This multiplier is used to assign a sign to a Table: T156


L_MULT monetary amount. If the ERP only uses Column: SHKZG-DEBIT/CREDIT
positive numbers the this multiplier is used INDICATOR
where credits are assigned negative signs Same logic for both passes 1 and 2:
and debits are assigned positive signs. If SHKZG = 'H' then
set to -1
Else (SHKZG = 'S')
set to 1
Endif

Value of H = Credit
Value of S = Debit

SPECIAL_STOCK CHAR(1) This is an indicator of whether the stock, i.e. Table: T156T
_CD consignment stock, of a material needs to Column: SOBKZ-SPECIAL STOCK
be managed separately. INDICATOR
Pass 1: set to T156T.SOBKZ

Pass 2: Set to default value

SPECIAL_STOCK VARCHAR(20) Textual description that identifies if certain Pass 1


_DSC stock (for example, consignment stock, select T148T.SOTXT where
project stock, etc.) needs to be managed T156T.SOBKZ = T148T.SOBKZ
separately. AND T148T.SPRAS = LanguageParameter

Pass 2
set to default short char

Developer Guide 119


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


STK_OVRVW_IN SMALLINT This is a data warehouse required attribute Same logic for passes 1 and 2.
C_MULT that controls whether the movement type is
to be included in the computation of Stock If (DOCUMENT_TYPE_CD in {Goods
Overview. Receipt Document Type Parameter} AND
CNSMPTN_PSTNG_CD = 'V') or
T156.KZWES = 'S' then
STOCK_OVERVIEW_INCL_MULT = 0
Else
STOCK_OVERVIEW_INCL_MULT = 1
Endif

TRANSFER_IN_ SMALLINT This is a multiplier that is applied to the Same logic for both passes 1 and 2. Set to
MULT computation of KPIs. This multiplier is set to default value. User may update this field
1 if this is a transfer in to a particular plant. through Console.
The default for this is 0.
TRANSFER_OUT SMALLINT This is a multiplier that is applied to the Same logic for both passes 1 and 2. Set to
_MULT computation of KPIs. This multiplier is set to default value. User may update this field
1 if this is a transfer out to a particular plant. through Console.
The default for this is 0.

UNPLANNED_US SMALLINT This is a multiplier that is applied to the Table: T156


E_MULT computation of KPIs. This multiplier is set to Column: KZVBU-CONSUMPTION
1 if the movement is one that is not planned. POSTING
That is, it is not part of the Manufacturing
Same logic for both passes 1 and 2:
Resource Planning (MRP).
If BKZBU in UnplannedUseParameter and
Goods_Issue_Mult = 1 then
set to 1
Else
set to 0
Endif

*User may update this field through


Console.

USAGE_MULT SMALLINT This is a multiplier that is applied to the Table: T156


computation of KPIs. This multiplier is set to Column: KZVBU-CONSUMPTION
1 for all usage of raw materials issued to POSTING
production, finished goods to sales, spare Same logic for both passes 1 and 2:
parts for maintenance etc. It is set to 0 for If KZVBU in UsageMultiplier and
Receipts and issues to vendor or scrap. Goods_Issue_Mult = 1 then
That is, it is part of the Manufacturing set to 1
Resource Planning (MRP). Else
set to 0
Endif

*User may update this field through


Console.

USER_DEFINED SMALLINT This is a user defined attribute available for Same logic for both passes 1 and 2. This is
1_MULT to the addition of any new multiplier specific to user defined. This should be set to a default
USER_DEFINED a particular client. value = 0;
5_MULT

VENDOR_CONS SMALLINT This multiplier is applied to the computation Same logic for both passes 1 and 2. Set to
_MULT of KPIs. This multiplier is set to 1 if the default value. User may update this field
movement is into or out of a Vendor through Console.
consignment. A vendor consignment is
material that is located at a plant but is still
owned by the vendor.

Material Reservation Detail


Target table name: MTRL_RSRVTN_DTL
Table type: Fact

120 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Description: This fact is the metric information related to reservations of materials at a specific
Plant or Storage Location. Each time a material reservation occurs, the information pertaining to
it is stored in a document created in the source system. The document contains information
such as the quantity of materials reserved, the date when the reservation occurred, the material
reserved, the plant at which the reservation was made, etc. The metric information from the
document is stored here.
Additional notes: The material reservations fact is designed for high performance
management queries and high performance load of summary fact tables. For this reason, it only
contains foreign key columns and measures. Textual attributes that are part of the material
reservations document are kept separate in the Material Reservation Document entity. There is
a one to one relationship between the Material Reservation Document and the Material
Reservation Fact.
SAP note: The sign for quantities in material reservations is opposite to all other material
documents. For example, a reservation of 10 will result in a goods issue, credit, of 10 out of a
plant.
Column mapping

Column name Datatype Description Derivation or source mapping


BATCH_SID INTEGER This is a foreign key to the BATCH entity Lookup to Batch Dimension where:
that is identified by the relationship name Batch Number = CHARG and
"batch" sourced from the Logical Data Plant Id = WERKS and
Model. Material Id = MATNR

CHARG-Batch number-Char(10)
WERKS-Plant-Char(4)
MATNR-Material number-Char(18)

BUSINESS_ARE INTEGER This is a foreign key to the BUSINESS Lookup to Business Area where:
A_SID AREA entity that is identified by the Business Area Code = GSBER
relationship name "for business area"
sourced from the Logical Data Model. GSBER-Business Area-Char(4)

CHANGED_DT DATE This represents the date and time of update ETL generated. CHANGED_DT =
of the warehouse record. This field is CREATED_DT on insert of row.
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.
CONFIRMED_QT NUMBER(15,3) This is the quantity of material that is Table: RESB
Y confirmed to be delivered. Column: VMENG
If RESB.SHKZG = 'H'
Confirmed Quantity = VMENG *1
Else
Confirmed Quantity = VMENG* -1

****THIS IS OPPOSITE TO ALL OTHER


MATERIAL FACTS!

CREATED_DT DATE This represents the date and time of ETL generated.
creation of the warehouse record. This field
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

DELIVERY_DDLN INTEGER This is a foreign key to the TIME entity that Table: RESB
_DT is identified by the relationship name Column: SBTER
"delivery deadline date is" sourced from the
Logical Data Model.
FISCAL_PERIOD INTEGER This is a foreign key to the FISCAL entity Use the required date for the fiscal period
_SID that is identified by the relationship name lookup. If it is null use the delivery deadline
"fiscal period" sourced from the Logical Data date.
Model.

Developer Guide 121


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


LOCAL_CURREN VARCHAR(5) This is the code representing the currency in Table: T001W, T001K, T001
CY_CD which the company that created the Column: WAERS, BWKEY, BUKRS
document prefers to work. Currencies are
Select T001.WAERS
applicable to monetary amounts. For
Select T001.WAERS
example, if the currency which the
Select T001.WAERS
concerned company prefers to work in is
from RESB, T001, T001W, T001K
Canadian dollars, the code representing it
from RESB, T001, T001W, T001K
may be CAD. This is used on reports that
where RESB.WERKS - T001W.WERKS
are specific to the company that created the
from RESB, T001, T001W, T001K
document. Such reports display the
and T001W.BWKEY = T001K.BWKEY
monetary amounts stored in the data
where RESB.WERKS - T001W.WERKS
warehouse (which are in group currency) in
and T001.BUKRS = T001K.BUKRS
the currency of the company concerned.
where RESB.WERKS - T001W.WERKS

and T001W.BWKEY = T001K.BWKEY


T001W - Plants/Branches,
and T001W.BWKEY = T001K.BWKEY
T001K- Valuation area,
and T001.BUKRS = T001K.BUKRS
T001-Company Codes
and T001.BUKRS = T001K.BUKRS

T001.WAERSCurrency key-Char(5)
T001W.BWKEY-Valuation area-Char(4)
T001W - Plants/Branches,
T001K.BWKEY-Valuation area-Char(4)
T001W - Plants/Branches,
T001.BUKRS-Company code-Char(4)
T001K- Valuation area,
T001K.BUKRS-Company code-Char(4)
T001K- Valuation area,
T001-Company Codes
T001-Company Codes

T001.WAERSCurrency key-Char(5)
T001.WAERSCurrency key-Char(5)
T001W.BWKEY-Valuation area-Char(4)
T001W.BWKEY-Valuation area-Char(4)
T001K.BWKEY-Valuation area-Char(4)
T001K.BWKEY-Valuation area-Char(4)
T001.BUKRS-Company code-Char(4)
T001.BUKRS-Company code-Char(4)
T001K.BUKRS-Company code-Char(4)
T001K.BUKRS-Company code-Char(4)

MATERIAL_SID INTEGER This is a foreign key to the MATERIAL entity Table: RESB-RESERVATION/DEPENDENT
that is identified by the relationship name REQUIREMENTS
"material" sourced from the Logical Data Column: SEE SOURCE MAPPING LOGIC
Model. Lookup to Material Dimension where:
Material Id = MATNR

MATNR-Material number-Char(18)

MATERIAL_STRG INTEGER This is a foreign key to the MATERIAL Lookup to Material Storage Dimension
_SID STORAGE entity that is identified by the where:
relationship name "material storage" Plant Id = WERKS and
sourced from the Logical Data Model. Material Id = MATNR

WERKS-Plant-Char(4)
MATNR-Material number-Char(18)

MTRL_RSRV_DO INTEGER This is a foreign key to the MATERIAL Lookup to Material Reservation Document
C_SID RESERVATION DOCUMENT entity that is where:
identified by the relationship name "material Material Reservation Number = RSNUM
reservation document" sourced from the and
Logical Data Model. Material Reservation Item Number =
RSPOS

RSNUM-Number of reservation/dependent
requirements-NUMC(10)
RSPOS-Item number of
reservation/dependent
requirements-NUMC(4)

122 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


MVMNT_DOC_C INTEGER This is a foreign key to the MOVEMENT Table: RESB-RESERVATION/DEPENDENT
LSS_SID DOCUMENT CLASS entity that is identified REQUIREMENTS
by the relationship name "movement class" Column: SEE SOURCE MAPPING LOGIC
sourced from the Logical Data Model.
Lookup to Movement Document Class
based on
Document Type CD =default value
Document Line Type CD = RESB.BWART
Special Stock CD = RESB.SOBKZ
Initiating Document Type CD =default value
Receipt Type Cd = default value
Consumption Posting CD = default value

BWART Movement type (inventory


management) char(3)
SOBKZ Special Stock Indicator Char(1).

PLANT_SID INTEGER This is a foreign key to the PLANT entity that Lookup to Plant where:
is identified by the relationship name "plant" Plant Id = WERKS
sourced from the Logical Data Model. Storage Location = LGORT

WERKS-Plant-Char(4)
LGORT-Storage location-Char(4)

Note: If LGORT is NULL then substitute with


default value.

REQUESTED_QT NUMBER(13,3) This is the quantity of material requested to Table: RESB


Y be reserved. Column: BDMNG
If RESB.SHKZG = 'H'
Requested Quantity = BDMNG *1
Else
Requested Quantity =BDMNG* -1

****THIS IS OPPOSITE TO ALL OTHER


MATERIAL FACTS!
REQUIRED_DT INTEGER This is a foreign key to the TIME entity that Table: RESB
is identified by the relationship name Column: BDTER
"posted date" sourced from the Logical Data
Model.

REVERSE_PLAN INTEGER This is a foreign key to the PLANT entity that Table: RESB-RESERVATION/DEPENDENT
T_SID is identified by the relationship name REQUIREMENTS
"reverse plant" sourced from the Logical Column: SEE SOURCE MAPPING LOGIC
Data Model.
Lookup to Plant where:
Plant Id = UMWRK
Storage Location = UMLGO

WERKS-Receiving plant/issuing
plant-Char(4)
UMLGO-Receiving/issuing storage
location-Char(4)

Note: If UMLGO is NULL then substitute


with default value.

STORAGE_BIN_ INTEGER This is a foreign key to the STORAGE BIN Lookup to Storage Bin where
SID entity that is identified by the relationship Warehouse Number = LGNUM
name "storage bin" sourced from the Logical Storage Type Code =LGTYP
Data Model. Storage Bin Id = LGPLA

LGPLA-Storage Bin-Char(10)
LGNUM-Warehouse Number / Warehouse
Complex-Char(3)
LGTYP-Storage type-Char(3)

Developer Guide 123


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


UNIT_COST_AM NUMBER(15,7) This is the unit cost of the item being Table: RESB
T reserved/withdrawn/requested in local Column: GPREIS
currency.
If RESB.ENWRT > 0
then
UNIT_COST_AMT = RESB.ENWRT /
RESB.ENMNG
else
if RESB.GPREIS > 0 AND RESB.PEINH >
0
UNIT_COST_AMT = RESB.GPREIS /
RESB.PEINH
else
set to 0

UOM_SID INTEGER This is a foreign key to the UNIT OF Lookup to Unit of Measure dimension
MEASURE entity that is identified by the where:
relationship name "base uom" sourced from Unit Of Measure Code = MEINS
the Logical Data Model. MEINS-Base unit of measure-Unit(3)

WITHDRAWN_QT NUMBER(13,3) This is the cumulative quantity of the Table: RESB


Y material that has already been withdrawn. Column: ENMNG
If RESB.SHKZG = 'H'
Withdrawn Quantity = ENMNG *1
Else
Withdrawn Quantity = ENMNG* -1

****THIS IS OPPOSITE TO ALL OTHER


MATERIAL FACTS!

Material Reservation Document


Target table name: MTRL_RSRVTN_DOC
Table type: Dimension
Description: This table is the non metric information related to material reservations at a
specific Plant or Storage Location. Each time a material reservation occurs, the information
pertaining to it is stored in a document created in the source system. The document contains
information such as the quantity of materials reserved, the date when the reservation occurred,
the material reserved, the plant at which the reservation was made, etc. The metric information
from the document is stored here.
Notes: The material reservation fact is designed for high performance management queries
and high performance load of summary fact tables. For this reason, it only contains foreign key
columns and measures. Textual attributes that are part of the material reservations document
are kept separate in the Material Reservation Document entity. There is a one to one
relationship between the Material Reservation Document and the Material Reservation Fact.

124 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column mapping

Column name Datatype Description Derivation or source mapping


CHANGED_DT DATE This represents the date and time of update Table: N/A-DERIVED
of the warehouse record. This field is Column: N/A-DERIVED
populated for records that have been
ETL generated. CHANGED_DT =
updated since the last extract. The time of
CREATED_DT on insert of row.
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

CREATED_DT DATE This represents the date and time of Table: N/A-DERIVED
creation of the warehouse record. This field Column: N/A-DERIVED
is populated for newly inserted records
ETL Derived.
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

DELETION_IND CHAR(1) This is an indicator that marks all data on a Table: RESB-RESERVATION/DEPENDENT
material reservation line item as deleted. REQUIREMENTS
This is an SAP specific field. Column: XLOEK-ITEM IS DELETED
If RESB.XLOEK = 'X' then
set to 'Y'
Else
set to 'N'
Endif

DOCUMENT_ITE VARCHAR(4) This is the source system generated Table: RESB-RESERVATION/DEPENDENT


M_NO number that, in combination with the REQUIREMENTS
Document Number, is the unique identifier Column: RSPOS-MATERIAL
of the Document Line Item. RESERVATION ITEM NUMBER

DOCUMENT_NO VARCHAR(10) This is the source system generated unique Table: RKPF-DOCUMENT HEADER:
identifier of the Document. RESERVATION
Column: RSNUM-NUMBER OF
RESERVATION/DEPENDENT
REQUIREMENTS

FINAL_ISSUE_IN CHAR(1) This indicates that the final issue of material Table: RESB-RESERVATION/DEPENDENT
D for this reservation was completed. REQUIREMENTS
Column: KZEAR-FINAL ISSUE FOR THIS
RESERVATION
If RESB.KZEAR = 'X' then
set to 'Y'
Else
set to 'N'
Endif

MTRL_RSRV_DO INTEGER This is a foreign key to the MATERIAL Table: N/A-DERIVED


C_SID RESERVATION DETAIL entity that is Column: N/A-DERIVED
identified by the relationship name "material System generated unique id.
reservation" sourced from the Logical Data
Model.
MTRL_RSRV_D_ VARCHAR(150) This is the primary key for this entity. This key is composed of:
DIM_ID DOCUMENT_NO
DOCUMENT_ITEM_NO
RECORD_TYPE_CD

RECORD_TYPE_ CHAR(1) This is a natural key component for SAP. Table: RESB-RESERVATION/DEPENDENT
CD REQUIREMENTS
Column: RSART-RECORD TYPE

USER_NM VARCHAR(12) This is the identification of the source Table: RKPF


system user who created the document. Column: USNAM-USER NAME

Developer Guide 125


Chapter 3: Data Mart Metadata

Material Storage
Target table name: MATERIAL_STORAGE
Table type: Dimension
Description: This table contains information that is applicable to both Materials and Plants. For
example, it contains the plant-specific attributes of a material, such as the maximum and
minimum size a batch is allowed to have in a plant, or the maximum stock level that is allowed. It
also has material planning information (such as procurement planning or inventory planning)
specific to a plant, such as the MRP group in charge of planning for the material, the purchasing
group responsible for procuring the material, etc.
Column mapping

Column name Datatype Description Derivation or source mapping


ABC_CD CHAR(1) This is the code representing the Table: MARC
classification of a material as of type A Column: MAABC
(important - high consumption), B (less
SAP short text: ABC indicator
important - medium consumption), or C
.
(relatively unimportant, low consumption).
MARC.MAABC
Vendors responsible for 'A' type products
.
are those that account for the company's
SAP system values
biggest expenditure. This type of
A = Very important material according to the
classification is known as Activity Based
ABC analysis
Cost analysis.
B = Fairly important material according to
the ABC analysis
C = Less important material according to the
ABC analysis

CHANGED_DT DATE This represents the date and time of update ETL generated.
of the warehouse record. This field is
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

CREATED_DT DATE This represents the date and time of ETL generated. CHANGED_DT =
creation of the warehouse record. This field CREATED_DT on insert of row.
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

FIXED_LOT_SIZE NUMBER(13,3) This is the quantity that will be ordered or Table: MARC
_QTY produced in the event of a shortage. If the Column: BSTFE
shortage is less than the fixed lot size, the
SAP short text: Fixed lot size
fixed lot size is ordered. If the shortage is
greater than the fixed lot size, a multiple of
MARC.BSTFE
fixed lot are ordered.

MAINT_STTS_CD VARCHAR(15) This is the code representing which Table: MARC


departments may maintain a material Column: PSTAT
master record of a particular material type.
SAP short text: Maintenance status
The overall maintenance status is made up
of the individual maintenance statuses. The
individual maintenance statuses may have
the following values: Work Scheduling,
Accounting, MRP, Purchasing, Costing,
Storage, Forecasting, QC, Sales, etc.

MATERIAL_ID VARCHAR(18) This is the source system unique identifier Table: MARC
of the material. Column: MATNR
NK1
SAP short text: Material number

MATERIAL_STRG INTEGER This is a data warehouse system generated System generated unique identifier.
_SID unique identifier for the material storage.

126 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


MAXIMUM_LOT_ NUMBER(13,3) This is the quantity that the number of items Table: MARC
SZ_QTY in a lot or batch must not exceed during Column: BSTMA
procurement. SAP short text: Maximum lot size
.
MARC.BSTMA
MAXIMUM_STOC NUMBER(13,3) This is the quantity of stock that may not be Table: MARC
K_QTY exceeded in a plant. This is also known as Column: MABST
the Maximum Stock Level.
SAP short text: Maximum stock level
.
MARC.MABST

MINIMUM_LOT_S NUMBER(13,3) This is the quantity that the number of items Table: MARC
Z_QTY in a lot or batch must not fall below of during Column: BSTMI
procurement. SAP short text: Minimum lot size
.
MARC.BSTMI

MRP_CNTLR_CD VARCHAR(3) This is the code representing the Table: MARC


Manufacturing Resource Planning (MRP) Column: DISPO
Controller or group of Controllers
SAP short text: MRP controller
responsible for planning material
requirements.
MARC.DISPO

MRP_CNTLR_NM VARCHAR(18) This is the textual description of the Table: T024D


Manufacturing Resource Planning (MRP) Column: DSNAM
Controller or group of Controllers
SAP short text: Name of MRP controller
responsible for planning material
.
requirements.
join MARC to T024D
where MARC.WERKS = T024D.WERKS
and
MRP_CNTLR_CD = T024D.DISPO

MRP_PRFL_CD VARCHAR(4) This is the code representing the Table: MARC


Manufacturing Resource Planning (MRP) Column: DISPR
parameters that are independent of the SAP short text: Material: MRP profile
material master record. In an MRP profile,
you define: which fields are filled with values
when MRP data is entered in the material
master record, which values these fields
have, and which of these values can be
overwritten and which cannot. The
information stored in a profile is standard
information that is needed again and again
in similar constellations when material
master records are maintained. Thus an
MRP Profile is a useful aid and makes it
easier to manage MRP data.
MRP_TYP_CD VARCHAR(2) This is the code representing the Table: MARC
Manufacturing Resource Planning (MRP) Column: DISMM
method to be applied to the material.
SAP short text: MRP type
Examples are 'manual reorder point
planning', 'automatic reorder point planning',
MARC.DISMM
'forecast-based planning', 'master
production scheduling', etc.

MRP_TYP_DSC VARCHAR(30) This is the textual description of the Table: T438T


Manufacturing Resource Planning (MRP) Column: DIBEZ
method to be applied to the material.
SAP short text: Material requirements
Examples are 'manual reorder point
planning description
planning', 'automatic reorder point planning',
.
'forecast-based planning', 'master
Lookup T438T.DIBEZ
production scheduling', etc.
where T438T.DISMM = MRP_MTHD_CD
and
T438T.SPRAS = LanguageParameter
.
If no value is returned because an entry has
not been created for the
LanguageParameter put in the default
parameter for unknown value.

Developer Guide 127


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


MTRL_STRG_DI VARCHAR(150) This is the primary key for this entity. This key is composed of:
M_ID MATERIAL_ID
PLANT_ID

PLANT_ID VARCHAR(4) This is the source system unique identifier Table: MARC
of the plant. A plant is an organizational unit Column: WERKS
within logistics that subdivides the NK2
Enterprise from the viewpoint of production, SAP short text: Plant
inventory management, manufacturing
resource planning (MRP) and plant
maintenance.

PRCHSNG_GRP VARCHAR(3) This is the code representing the buyer or Table: MARC
_CD group of buyers responsible for certain Column: EKGRP
purchasing-related activities. Internal
SAP short text: Purchasing group
purchasing groups are responsible for the
.
procurement of a material or a group of
MARC.EKGRP
materials. External purchasing groups are a
medium through which contacts with
vendors are maintained.

PRCHSNG_GRP VARCHAR(18) This is the textual description for the buyer Table: T024
_DSC or group of buyers responsible for certain Column: EKNAM
purchasing-related activities. Internal
SAP short text: Description of purchasing
purchasing groups are responsible for the
group
procurement of a material or a group of
materials. External purchasing groups are a
medium through which contacts with
vendors are maintained.

PRCRMT_TYP_C CHAR(1) This is the code representing the type of Table: MARC
D procurement of the material. Examples are: Column: BESKZ
"produced in-house" or "procured
SAP short text: Procurement Type
externally" or "both produced in-house and
.
procured externally".
SAP system values:
E = In-house production
F = External procurement
" " = No procurement
X = Both procurement types
PRCRMT_TYP_D VARCHAR(60) This is the textual description of the type of Table: DD07T
SC procurement of the material. Examples are: Column: DDTEXT
"produced in-house" or "procured
SAP short text: Short text for fixed values
externally" or "both produced in-house and
.
procured externally".
Lookup DD07T.DDTEXT
where DD07T.DDLANGUAGE =
LanguageParameter and
DD07T.DOMNAME = 'BESKZ' and
DD07T.DOMVALUE_L =
PRCRMT_TYP_CD
.
If no value is returned because an entry has
not been created for the
LanguageParameter put in the default
parameter for unknown value.

REORDER_POIN NUMBER(13,3) This is the least quantity of stock allowed for Table: MARC
T_QTY the material in the plant before it is flagged Column: MINBE
for re-order. If the quantity of the material SAP short text: Reorder point
falls below this level, it will be identified as .
one for which procurement must be MARC.MINBE
planned.

RPLNSHMT_LD_ NUMBER(3,0) This is the time required to re-stock the Table: MARC
TM_NO material in the plant either through in-house Column: WZEIT
production or procurement.
SAP short text: Total replenishment lead
time (in workdays)
MARC.WZEIT

128 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


SAFETY_STOCK NUMBER(13,3) This is the stock quantity kept in reserve to Table: MARC
_QTY satisfy unexpectedly high demand in the Column: EISBE
coverage period. The risk of shortfalls is SAP short text: Safety stock
reduced by having a safety stock quantity
.
(aka safety stock level) in a plant.
MARC.EISBE
SPCL_PRCRMT_ VARCHAR(2) This is the code representing the special Table: MARC
TYP_CD procurement type. The special procurement Column: SOBSL
type allows the procurement type to be
SAP short text: Special procurement type
further defined. The procurement type is
.
predetermined by the material type. For
The value in SAP is constrained by the
example, the special procurement type
plant.
"consignment order" is possible for
"externally procured materials". (This
definition is unclear and needs to be
improved)

SPCL_PRCRMT_ VARCHAR(40) The textual description that allows more Table: T460T
TY_DSC information on the procurement type to be Column: LTEXT
defined. The procurement type is
SAP short text: Long text
predetermined by the material type. For
.
example, the special procurement type
Lookup T460T.LTEXT
"consignment order" is possible for
where T460T.WERKS = PLANT_ID and
externally procured materials, and
T460T.SOBSL = SPCL_PRCRMT_TYP_CD
"produced in another plant" for in-house
and
production.
T460T.SPRAS = LanguageParameter
.
If no value is returned because an entry has
not been created for the
LanguageParameter put in the default
parameter for unknown value.
VALUATION_CAT CHAR(1) This is a code representing whether stocks Table: MARC
_CD of the material are valuated together or Column: BWTTY
separately. In the case of split valuation, it
SAP short text: Valuation category
also determines which movement types are
.
allowed, that is, the criteria by which the
SAP system values:
stocks can be valuated.
A=" "
B = Inhse/ext.proc.
C = Status
H = Origin
R = Retail
X = Automat.(batch)

VALUATION_CAT VARCHAR(15) The textual description of the (Valuation Table: T149T


_DSC Category Code) which is used to determine Column: BTBEZ
whether stocks of the material are valuated SAP short text: Description of valuation
together or separately. In the case of split category
valuation, it also determines which .
movement types are allowed, that is, the Lookup T149T.BTBEZ
criteria by which the stocks can be valuated. where T149T.BWTTY =
VALUATION_CAT_CD and
T149T.SPRAS = LanguageParameter
.
If no value is returned because an entry has
not been created for the
LanguageParameter put in the default
parameter for unknown value.

Physical Inventory Detail


Target table name: PHYSICAL_INV_DTL
Table type: Fact

Developer Guide 129


Chapter 3: Data Mart Metadata

Description: This fact compares the expected quantity of a material (or the book quantity)
against the actual amount based on the physical count of material in the storage location. This
activity is done to determine the accuracy of the stock balance in the inventory books. An over-
or under-estimation of the stock balance is measured as a percentage of the actual stock. One
of two indicators of accuracy may be used - the absolute stock accuracy, which treats both
positive and negative deviations from the actual as the same, and the relative stock accuracy,
which makes a distinction between positive and negative deviations.
Notes: The physical inventory document is the central element of physical inventory
management. It is used to 1) plan and carry out physical inventory 2) enter count-related
information, 3) post any differences. After all lines in the physical inventory document are
counted and posted, the document can be archived.
Column mapping

Column name Datatype Description Derivation or source mapping


ABS_STK_ACCR NUMBER This is the absolute value of the accuracy of {(1 - ABS[BOOK_STOCK_QTY -
CY_PCT the physical inventory levels expressed as a PHYSICAL_STOCK_QTY]) /
percentage, with no regard to whether the BOOK_STOCK_QTY} * 100
estimate is over or under the actual amount.
The formula used is: SPECIAL SITUATIONS:
Absolute Stock Accuracy Percentage = 1) If ABS_STK_ACCRCY_PCT< ZERO
(1 - ABS(Book Stock Level Count - Physical THEN SET TO ZERO
Inventory Count)/ Book Stock Level Count) * 2) If PHYSICAL_STOCK_QTY > 0 AND
100 (e.g., if Book Stock Level Count = BOOK_STOCK_QTY = 0 THEN SET TO
100 and Physical Inventory Count = 110 ZERO
then ABS Stock Accuracy = 90%; if Book 3) If PHYSICAL_STOCK_QTY = 0 AND
Stock Level Count = 100 and Physical BOOK_STOCK_QTY = 0 THEN SET TO
Inventory Count = 90 then ABS Stock 100
Accuracy = 90%) 4) If PHYSICAL_STOCK_QTY = 0 AND
BOOK_STOCK_QTY > 0 THEN SET TO
ZERO

e.g.
If Book = 100 and Physical = 110
ABS_STK_ACCRCY_PCT= 90%
If Book = 100 and Physical = 90
ABS_STK_ACCRCY_PCT= 90%
BATCH_SID INTEGER This is a foreign key to the BATCH entity The sid should be set to 0 as the lookup to
that is identified by the relationship name batch will not be implemented pending a
"group together by BATCH" sourced from decision from product management
the Logical Data Model. regarding the removal of Batch.
.
This mapping should not be used but
appears in the spec just for historical
purposes
Lookup BATCH based on
ISEG.CHARG = BATCH_NO
ISEG.WERKS = PLANT_ID
ISEG.MATNR = MATERIAL_ID

BOOK_STOCK_A NUMBER(13,2) This is the total value assigned to the book Table: ISEG
MT stock quantity of goods in the Physical Column: WRTBM
Inventory Document Line Item, in Local
Currency. This value can be calculated in a
number of ways, by considering the total
price of the goods, the total cost of it, the
total discount applied to it, etc. The method
of calculation of this field depends on the
source system. This is useful in comparing
stocks across various types of products.
Each product may be stored in a separate
unit of measure (e.g., bottles vs. boxes),
thus making comparisons of quantities
meaningless. The only meaningful
comparisons that may be made is in terms
of currency amounts associated with the
goods.

130 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


BOOK_STOCK_Q NUMBER(13,3) This is the book inventory balance of this Table: ISEG
TY item at the time of the count. The count is Column: BUCHM
not adopted as the new book inventory
balance until the inventory differences are
posted.

CHANGED_DT DATE This represents the date and time of update ETL generated.
of the warehouse record. This field is
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

COUNT_DT INTEGER This is a foreign key to the TIME entity that Lookup to ALL_TIME on CALENDAR_DT
is identified by the relationship name based on
"physical inventory counted on date in time" IF "ISEG"."ZLDAT" (DETAIL COUNT DT)
sourced from the Logical Data Model. IS NULL
THEN USE "IKPF"."ZLDAT" (HEADER
COUNT DT)
ELSE USE "ISEG"."ZLDAT" (DETAIL
COUNT DT)

If ((ToChar(COUNT_DT_TMP) <=
ToChar($AS_AT_DATE) And
ToChar(CREATED_DT_char) >
ToChar($AS_AT_DATE)),
ToChar(AddToDate(ToDate($AS_AT_DATE,'
YYYYMMDD'),1), 'YYYYMMDD'),
If((ToChar(COUNT_DT_TMP) >
ToChar($AS_AT_DATE) And
ToChar(CREATED_DT_char) <=
ToChar($AS_AT_DATE)),
ToChar(CREATED_DT_char),
ToChar(COUNT_DT_TMP)))

COUNT_FSCL_P INTEGER This is a foreign key to the FISCAL entity Lookup the fiscal period sid in All Time
RD_SID that is identified by the relationship name using the count date ZLDAT and fiscal
"physical inventory taken during a period in variant
fiscal" sourced from the Logical Data Model. IF "ISEG"."ZLDAT" (DETAIL COUNT DT) IS
NULL
THEN USE "IKPF"."ZLDAT" (HEADER
COUNT DT)
ELSE USE "ISEG"."ZLDAT" (DETAIL
COUNT DT)

To get the fiscal variant T001.PERIV


where IKPF.WERKS = T001W.WERKS
AND
T001W.BWKEY = T001K.BWKEY AND
T001K.BUKRS = T001.BUKRS

CREATED_DT DATE This represents the date and time of ETL generated. CHANGED_DT =
creation of the warehouse record. This field CREATED_DT on insert of row.
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

FINAL_COUNT_I CHAR(1) This is an indicator that specifies that the If ISEG.XNZAE = "X"
ND item will not be recounted in another then
physical inventory document. set indicator to "N"
else
set indicator to "Y"

Developer Guide 131


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


FISCAL_PERIOD INTEGER This is a foreign key to the FISCAL entity Derived from Posting Date and Fiscal
_SID that is identified by the relationship name Variant
"physical inventory posted to period in
fiscal" sourced from the Logical Data Model. IKPF.BUDAT = posting date

To get the fiscal variant T001.PERIV


where IKPF.WERKS = T001W.WERKS
AND
T001W.BWKEY = T001K.BWKEY AND
T001K.BUKRS = T001.BUKRS

LOCAL_CURREN VARCHAR(5) This is the code representing the currency in Table: T001W, T001K, T001
CY_CD which the balances are kept in the source Column: WAERS, BWKEY, BUKRS
company. Select T001.WAERS
from T001, T001W, T001K
where T001W.BWKEY = T001K.BWKEY
and T001.BUKRS = T001K.BUKRS

T001W - Plants/Branches,
T001K- Valuation area,
T001-Company Codes

T001.WAERSCurrency key-Char(5)
T001W.BWKEY-Valuation area-Char(4)
T001K.BWKEY-Valuation area-Char(4)
T001.BUKRS-Company code-Char(4)
T001K.BUKRS-Company code-Char(4)

MATERIAL_SID INTEGER This is a foreign key to the MATERIAL entity Lookup Material based on
that is identified by the relationship name ISEG.MATNR = MATERIAL_ID
"material" sourced from the Logical Data
Model.

MATERIAL_STRG INTEGER This is a foreign key to the MATERIAL Lookup Material Storage based on
_SID STORAGE entity that is identified by the ISEG.MATNR = MATERIAL_ID
relationship name "material storage" ISEG.WERKS = PLANT_ID
sourced from the Logical Data Model.

PHYSICAL_STOC NUMBER(13,2) This is the total value assigned to the Table: ISEG
K_AMT physical stock quantity of goods in the Column: WRTZL
Physical Inventory Document Line Item, in
Local Currency. This value can be
calculated in a number of ways, by
considering the total price of the goods, the
total cost of it, the total discount applied to it,
etc. The method of calculation of this field
depends on the source system. This is
useful in comparing stocks across various
types of products. Each product may be
stored in a separate unit of measure (e.g.,
bottles vs. boxes), thus making comparisons
of quantities meaningless. The only
meaningful comparisons that may be made
is in terms of currency amounts associated
with the goods.

PHYSICAL_STOC NUMBER(13,3) This is the actual quantity of stock found in Table: ISEG
K_QTY inventory at the time of the count. Column: MENGE

PHYS_INV_DOC INTEGER This is a foreign key to the PHYSICAL Lookup Physical Inventory Document based
_SID INVENTORY DOCUMENT entity that is on:
identified by the relationship name "further ISEG.IBLNR = DOCUMENT_NO
described by physical inventory doc" ISEG.ZEILI = DOCUMENT_ITEM_NO
sourced from the Logical Data Model. ISEG.GJAHR = FISCAL_YEAR_VAL

PLANT_SID INTEGER This is a foreign key to the PLANT entity that Lookup to Plant based on
is identified by the relationship name "plant" ISEG.WERKS = PLANT_ID
sourced from the Logical Data Model. ISEG.LGORT = STORAGE_LCTN_CD

132 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


RLTV_STK_ACR NUMBER This is the accuracy of the physical {(1 - [BOOK_STOCK_QTY -
CY_PCT inventory levels expressed as a percentage, PHYSICAL_STOCK_QTY]) /
with a distinction between an over- or BOOK_STOCK_QTY} * 100
under-estimation of the actual amount. The
formula used is: Relative Stock SPECIAL SITUATIONS:
Accuracy Percentage = 1) If RLTV_STK_ACRCY_PCT< ZERO
(1 - (Book Stock Level Count - Physical THEN SET TO ZERO
Inventory Count) / Book Stock Level Count) 2) If PHYSICAL_STOCK_QTY > 0 AND
* 100 (e.g., if Book Stock Level BOOK_STOCK_QTY = 0 THEN SET TO
Count = 100 and Physical Inventory Count = ZERO
110 then ABS Stock 3) If PHYSICAL_STOCK_QTY = 0 AND
Accuracy = 110% BOOK_STOCK_QTY = 0 THEN SET TO
if Book Stock Level Count = 100 and 100
Physical Inventory Count = 90 4) If PHYSICAL_STOCK_QTY = 0 AND
then ABS Stock Accuracy = 90%) BOOK_STOCK_QTY > 0 THEN SET TO
ZERO

e.g.
if Book = 100 and Physical = 110
RLTV_STK_ACRCY_PCT= 110%
if Book = 100 and Physical = 90
RLTV_STK_ACRCY_PCT= 90%

STOCK_CLASS_ INTEGER This is a foreign key to the STOCK CLASS Lookup Stock Class based on
SID entity that is identified by the relationship STOCK_TYPE_CD = ISEG.BSTARS
name "stock class" sourced from the Logical SPECIAL_STOCK_CD = ISEG.SOBKZ
Data Model.
TIME_SID INTEGER This is a foreign key to the TIME entity that Convert the source date to eApps date
is identified by the relationship name format of YYYYMMDD.
"physical inventory document issued on
date" sourced from the Logical Data Model.

UOM_SID INTEGER This is a foreign key to the UNIT OF Lookup UOM_SID in Unit of Measure
MEASURE entity that is identified by the Dimension where UOM_CD = ISEG.MEINS
relationship name "stockkeeping UOM"
sourced from the Logical Data Model.

VALUATION_SID INTEGER This is a foreign key to the VALUATION If the following lookup returns a value use
entity that is identified by the relationship the SID
name "physical inventory is valued by Lookup Valuation based on
valuation" sourced from the Logical Data MATERIAL_ID = ISEG.MATNR CHAR(18)
Model. VALUATION_AREA_CD =
T001W.BWKEY join T001W to ISEG where
T001W.WERKS = ISEG.WERKS
VALUATION_TYPE_CD = ISEG.CHARG
CHAR(10)
otherwise do the following lookup
Lookup Valuation based on
MATERIAL_ID = ISEG.MATNR CHAR(18)
VALUATION_AREA_CD =
T001W.BWKEY join T001W to ISEG where
T001W.WERKS = ISEG.WERKS
VALUATION_TYPE_CD = default short
char

Physical Inventory Document


Target table name: PHYSICAL_INV_DOC
Table type: Dimension

Developer Guide 133


Chapter 3: Data Mart Metadata

Description: This table compares the expected quantity of a material (or the book quantity)
against the actual amount based on the physical count of material in the storage location. This
activity is done to determine the accuracy of the stock balance in the inventory books. An over-
or under-estimation of the stock balance is measured as a percentage of the actual stock. One
of two indicators of accuracy may be used - the absolute stock accuracy, which treats both
positive and negative deviations from the actual as the same, and the relative stock accuracy,
which makes a distinction between positive and negative deviations.
Notes: The physical inventory document is the central element of physical inventory
management. It is used to 1) plan and carry out physical inventory 2) enter count-related
information, 3) post any differences. After all lines in the physical inventory document are
counted and posted, the document can be archived.
Column mapping

Column name Datatype Description Derivation or source mapping


CHANGED_DT DATE This represents the date and time of update ETL generated.
of the warehouse record. This field is
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

CREATED_DT DATE This represents the date and time of ETL generated. CHANGED_DT =
creation of the warehouse record. This field CREATED_DT on insert of row.
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

DOCUMENT_ITE VARCHAR(6) A source system generated number that Table: ISEG


M_NO identifies a line item on a physical inventory Column: ZEILI
document. This is part of the natural key.
Natural Key 3
DOCUMENT_NO VARCHAR(10) A source system generated identifier for a Table: ISEG
physical inventory document. Column: IBLNR
Natural Key 1

FISCAL_YEAR_V VARCHAR(4) This is the fiscal year in which the physical Table: ISEG
AL inventory activity was conducted (for a Column: GJAHR
definition of Fiscal Year, refer to the Fiscal Natural Key 2
entity).
PHYS_INV_DC_D VARCHAR(150) This is the primary key for this entity. This key is composed of:
IM_ID DOCUMENT_NO
FISCAL_YEAR_VAL
DOCUMENT_ITEM_NO

PHYS_INV_DOC INTEGER This is a data warehouse system generated System generated unique id.
_SID unique identifier for a physical inventory
document line item.

USER_NM VARCHAR(12) This is the identification of the source Table: IKPF


system user who created the document. Column: USNAM

Plant
Target table name: PLANT
Table type: Conformed Dimension

134 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Description: This describes the plants of an organization. The most basic inventory
management questions are - "what have I got?" and "where is it?". This helps us answer the
"where is it?" question. In the context of Inventory Analysis, plants refer to warehouses. The
plant or warehouse makes merchandise available for production, distribution and sale. A plant
may be subdivided into storage locations, allowing stocks of materials to be broken down
according to predefined criteria (e.g., location and materials planning aspects).
Column mapping

Column name Datatype Description Derivation or source mapping


CHANGED_DT DATE This represents the date and time of update ETL Generated. Changed_Dt is set to
of the warehouse record. This field is Created_dt on insert of row.
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

CITY_CD VARCHAR(4) This is the code representing the city where Table: T001W-PLANT/BRANCHES
the plant is located. Column: CITYC - CITY CODE

CITY_NM VARCHAR(35) This is the name of the city where the plant Table: T001W-PLANT/BRANCHES
is located. Column: ORT01-CITY

COMPANY_CD VARCHAR(4) This is the code representing the company Table: T001K- VALUATION AREA,
responsible for the valuation of this Plant. T001W-PLANT/BRANCHES
Column: T001K.BUKRS, T001K.BWKEY,
T001W.KWKEY
select T001K.BUKRS
from T001K, T001W
where T001K.BWKEY.T001W.BWKEY

T001K.BUKRS-Company code-Char(4)
T001K.BWKEY-Valuation area-Char(4)
T001W.BWKEY-Valuation area-Char(4)

COMPANY_NM VARCHAR(35) This is the textual description representing Table: T001-COMPANY


the company responsible for the valuation of Column: BUTXT-NAME OF THE COMPANY
this Plant. CODE OR COMPANY
Lookup to T001 (Company) using BUKRS
(Company Code) = Company Cd
- column made same size as other
company_nm columns for consistency

COUNTRY_CD VARCHAR(3) This is the code representing the country Table: T001W-PLANT/BRANCHES
where the plant is located. Column: LAND1-COUNTRY KEY
COUNTRY_NM VARCHAR(15) This is the textual description of the country Table: T005T-COUNTRY NAMES
where the plant is located. Column: LANDX-COUNTRY NAME
filter by SPRAS (language key)
Lookup to T005T using LAND1 (Country
key) = Country Cd

COUNTY_CD VARCHAR(3) This is the code representing the county Table: T001W-PLANT/BRANCHES
where the plant is located. It is used to Column: COUNC-COUNTY CODE
group cities into counties for tax purposes. It
is used only in the USA for handling county
taxes.

Developer Guide 135


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


COUNTY_NM VARCHAR(20) This is the textual description of the county Table: T005F-COUNTY: TEXTS
where the plant is located. It is used to Column: BEZEI-TEXT
group cities into counties for tax purposes. It
filter by SPRAS (language key)
is used only in the USA for handling county
taxes.
SELECT NULLIF("T005F"."COUNC", ' ')
COUNTY_CD,
NULLIF("T005F"."BEZEI", ' ')
COUNTY_NM,

FROM "T005F", T001W


WHERE "T005F"."SPRAS" = 'E'
AND "T005F"."LAND1" = "T001W"."LAND1"
AND "T005F"."REGIO" = "T001W"."REGIO"
AND "T005F"."COUNC" =
"T001W"."COUNC"
CREATED_DT DATE This represents the date and time of ETL Generated.
creation of the warehouse record. This field
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

DIVISION_CD VARCHAR(2) This is the code representing the division Table: T001L-STORAGE LOCATIONS,
with which the plant is associated. A division T001W-PLANT/BRANCHES
is a way of grouping materials, products, or Column: SPART-DIVISION FOR
services, based on the sales area or the INTERCOMPANY BILLING
business area that it belongs to. A product is
When mapping to a storage location = '-'
always assigned to just one division, from
then this field maps to T001W.SPART
the point of view of sales and distribution.
The use of divisions lets you organize your
When mapping to a storage location <> '-'
sales around groups of similar products or
then this field maps to T001L.SPART
product lines. It also allows the people who
process orders and services within the
division to specialize in an area of expertise
related to the division. For example, if a
sales organization sells food and non-food
products, each could represent a division. If
the sales were conducted through both retail
and wholesale distribution channels, each
distribution channel could then be split into
food and non-food divisions.

DIVISION_NM VARCHAR(20) This is the textual description of the division Table: TSPAT-ORGANIZATIONAL UNIT:
with which the plant is associated. A division SALES DIVISIONS: TEXTS
is a way of grouping materials, products, or Column: VTEXT-NAME
services, based on the sales area or the
filter by SPRAS (language key)
business area that it belongs to. A product is
Lookup to TSPAT using SPART (Division) =
always assigned to just one division, from
Division Cd
the point of view of sales and distribution.
The use of divisions lets you organize your
sales around groups of similar products or
product lines. It also allows the people who
process orders and services within the
division to specialize in an area of expertise
related to the division. For example, if a
sales organization sells food and non-food
products, each could represent a division. If
the sales were conducted through both retail
and wholesale distribution channels, each
distribution channel could then be split into
food and non-food divisions.

FISCAL_VARIAN VARCHAR(2) This is the code representing the fiscal Table: T001-COMPANY CODES
T_CD calendar that is used by the plant for Column: PERIV-FISCAL YEAR VARIANT
accounting purposes. Lookup to T001 (Company) where BUKRS
= Company Cd

136 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


FREEZE_BOOK_I CHAR(1) This is an indicator that specifies whether in Table: T001L-STORAGE LOCATIONS
ND the storage location, it is possible to freeze Column: XBUFX-FREEZING BOOK
the book inventory balances of all items in a INVENTORY BAL. ALLOWED IN STRG
physical inventory document that has not yet
Pass 1: loading Plants/no storage location
been counted. The frozen book inventory
- use default value for unknown value
balance is recorded in the physical inventory
document and is used for calculations of
Pass 2: loading Plants/with storage
inventory differences.
locations
Join of T001W to T001L using WERKS
(plant)
if xbufx = 'X'
then
FREEZE_BOOK_IND='Y'
else
FREEZE_BOOK_IND= 'N'
GROUP_CURRE VARCHAR(5) This is the code representing the standard ETL derived
NCY_CD currency in which all monetary amounts in
the data warehouse are stored. For
example, if the monetary amounts in the
data warehouse are stored in US Dollars,
the code representing that may be USD.
The standard or group currency is useful in
reports that compare monetary amounts
across companies that prefer to work in a
variety of currencies.

LOCAL_CURREN VARCHAR(5) This is the code representing the currency in Table: T001W, T001K, T001
CY_CD which the company that created the Column: WAERS, BWKEY, BUKRS
document prefers to work. Currencies are
Select T001.WAERS
applicable to monetary amounts. For
from T001, T001W, T001K
example, if the currency which the
where T001W.BWKEY = T001K.BWKEY
concerned company prefers to work in is
and T001.BUKRS = T001K.BUKRS
Canadian dollars, the code representing it
may be CAD. This is used on reports that
T001W - Plants/Branches,
are specific to the company that created the
T001K - Valuation area,
document. Such reports display the
T001 - Company Codes
monetary amounts stored in the data
warehouse (which are in group currency) in
T001.WAERS Currency key-Char(5)
the currency of the company concerned.
T001W.BWKEY - Valuation area-Char(4)
T001.BUKRS - Company code-Char(4)
MRP_STRG_LCT CHAR(1) This is an indicator that specifies whether to Table: T001L-STORAGE LOCATIONS
N_CD exclude or not a storage location from Column: DISKZ-STORAGE LOCATION
material requirements planning at the Plant MRP INDICATOR
level. If this indicator is not set, stock,
Pass 1: loading Plants/no storage location
requirements, and receipts are included in
- use default value for unknown value
the Manufacturing Resource Planning
(MRP) at plant level.
Pass 2: loading Plants/with storage
locations
- join of T001W to T001L using WERKS
(plant)

MRP_STRG_LCT VARCHAR(60) Descriptive text for a MRP STORAGE Table: DD07T - DD: TEXTS FOR DOMAIN
N_DSC LOCATION CODE value. FIXED VALUES (LANGUAG
Column: DDTEXT - SHORT TEXT FOR
FIXED VALUES
Pass 1: loading Plants/no storage location
- use default value for unknown value

Pass 2: loading Plants/with storage


locations
select ddtext
where domname = 'DISKZ' and
MRP_STRG_LCTN_CD =
DD07T.DOMVALUE_L AND
ddlanguage = language parameter

Developer Guide 137


Chapter 3: Data Mart Metadata

Stock Class
Target table name: STOCK_CLASS
Table type: Conformed dimension
Description: This table is used to classify the fitness of use of inventory. The most basic
inventory management questions are "what have I got?" and "where is it?". Stock Class helps to
clarify the "what have I got?" question by describing fitness for use. For example, there are 100
widgets in stock, but 10 are unavailable as they are going through "quality inspection", 20 are
"blocked" for an unspecified reason, and 30 are "reserved". This implies that only 80 of the 100
widgets in stock are available for "unrestricted use", and 30 of these 80 have been "reserved" for
use in a specific production process. This contains combinations of attributes that are
classifiers of stock.
Typically, a source system has many such classifiers, such as Stock Type. Other classifiers,
such as Age basket may be derived. This combines every one of these classifiers into a single
entity. This is done primarily for technical reasons, such as improving the performance of
queries and minimizing the storage space required (a single link between the Class and the Fact
is sufficient to answer queries that look at metrics across document classifiers). However, in
certain cases, it makes business sense to do so as well. For example, combinations of
classifiers may be meaningful to a business. If so, some Class Status attributes may be added
that represent such meaningful combinations. This also contains a number of multipliers.
Multipliers are used for calculating derived metrics from existing ones, and have values of 1 or 0.
The derived metric is calculated by multiplying the multiplier with the existing metric. Multipliers
are defined by the ETL program based on certain source system classifiers.
Technical Notes: There are two options for creating the combinations of attributes. If the
attributes have only a few members, a complete set of combinations (called a complete
cartesian product) may be created at the time of initial load of the warehouse, even though
some of the combinations may not make business sense. This option saves time of load.
However, if creating a complete cartesian product produces a very large set of combinations
most of which is meaningless, it may be better to use only the combinations that already exist in
documents. This is less efficient with regard to load time, but saves storage space.
Column mapping

Column name Datatype Description Derivation or source mapping


BLOCKED_MULT SMALLINT This is a multiplier that is applied to the If Stock_Type_Cd in
computation of KPIs. This multiplier is set to BlockedStockTypeParameter then
1 if the movement if the stock is blocked set to 1 (blocked)
from being used. else
set to default value (not blocked)
endif
CHANGED_DT DATE This represents the date and time of update ETL generated. Changed_Dt set to
of the warehouse record. This field is Created_Dt on insert of row.
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

CREATED_DT DATE This represents the date and time of ETL generated.
creation of the warehouse record. This field
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

138 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


CUSTOMER_CO SMALLINT This multiplier is applied to the computation If Special_Stock_Cd in
NS_MULT of KPIs. This multiplier is set to 1 if the CustomerConsignmentSpecialStockParame
movement is into or out of a Vendor ter then
consignment. A customer consignment is a set to 1 (on customer consignment)
material movement where the material is else
located at the customer location. set to default value (not on customer
consignment)
endif

OVRL_STTS_LVL VARCHAR(50) This is the level 1 to 5 of a hierarchy that These are user entered status fields. Set to
1_DSC to describes the status associated with a stock default value in ETL.
OVRL_STTS_LVL class. A stock class is a combination of
5_DSC classifiers of stocks. Sometimes, a
combination may make business sense, and
a status maybe associated with it. The
status may even be part of a hierarchy. This
is the 1st to 5th level parent of such a status
hierarchy.
QLTY_INSPCTN_ SMALLINT This multiplier is applied to the computation If Stock_Type_Cd in
MULT of KPIs. This multiplier is set to 1 if the QualityInspectionStockTypeParameter then
quality inspection has been done. set to 1 (QI required)
else
set to default value (QI not required)
endif

SPECIAL_STOCK CHAR(1) This is the code representing the type of Table: T148
_CD stock in terms of its management. For Column: SOBKZ-SPECIAL STOCK
example, "consignment stock" of a material INDICATOR
needs to be managed separately.
Pass 1, 2: T148.SOBKZ
Pass 3, 4: {DEFAULT_SHORT_CHAR}

SPECIAL_STOCK VARCHAR(20) This is the textual description of the type of Table: T148T
_DSC stock in terms of its management. For Column: SOTXT-DESCRIPTION OF
example, "consignment stock" of a material SPECIAL STOCK
needs to be managed separately.
Lookup to T148T using Special Stock Code
and Filtering by Language Parameter
(SPRAS)

STOCK_CLASS_ INTEGER This is a data warehouse system generated System generated unique id.
SID unique identifier for the stock class.
STOCK_CLSS_DI VARCHAR(150) This is the primary key for this entity. This key is composed of:
M_ID STOCK_TYPE_CD
SPECIAL_STOCK_CD

STOCK_TYPE_C VARCHAR(10) This is the code representing the type of Pass 1, 3: DD07T.DOMVALUE_L
D stock in terms of its fitness of use. Examples Pass 2, 4: T064B.BSTAR
include "unrestricted-use" stock, stock "in
quality inspection", and "blocked" stock. DOMVALUE_L - VALUES FOR DOMAINS
BSTAR - STOCK TYPE

STOCK_TYPE_D VARCHAR(60) This is the textual description of the type of Table: DD07T
SC stock in terms of its fitness of use. Examples Column: DDTEXT-SHORT TEXT FOR
include "unrestricted-use" stock, stock "in FIXED VALUES
quality inspection", and "blocked" stock. Pass 1, 3: DD07T.DDTEXT where
DDLANGUAGE = {Language Parameter}

Pass 2, 4:
Lookup to T064B.BTEXT
where T064A.BSTAR = T064B.BSTAR
and T064B.SPRAS = {Language
Parameter}

BTEXT: Text for Stock Type


DDTEXT: Short text for fixed values
DDLANGUAGE/SPRAS: Language
parameter.
BSTAR: Stock Type

Developer Guide 139


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


UNRESTRICTED SMALLINT This is a multiplier that is applied to the If Stock_Type_Cd in
_MULT computation of KPIs. This multiplier is set to UnrestrictedStockTypeParameter then
1 if the stock is available for general use. set to 1 (unrestricted)
else
set to default value (restricted)
endif

USER_DEFINED SMALLINT This is an user-defined multiplier. The usage This is user defined. This should be set to a
1_MULT to of It is optional. The default value of it is default value = 0;
USER_DEFINED zero.
5_MULT
VENDOR_CONS SMALLINT This multiplier is applied to the computation If Special_Stock_Cd in
_MULT of KPIs. This multiplier is set to 1 if the VendorConsignmentSpecialStockParameter
movement is into or out of a Vendor then
consignment. A vendor consignment is a set to 1 (on vendor consignment)
material movement where the material is else
located at the vendor location. set to default value (not on vendor
consignment)
endif

Stock Opening Balance


Target table name: STOCK_OPEN_BAL_PEX
Table type: Work table
Description: This table provides a snapshot of the stock levels for every material across plants
and storage locations at a given point in time. This is a persistent work table, used in building
certain types of summary facts (called snapshot facts) from transactional facts. This is not to be
used for answering business questions. However, it is a critical component of the Inventory
Analysis application. The information in it is used as a starting point to create stock levels.
For example:
1. The opening balance of widgets in a plant as on 2000-01-01 00:00:00 was 100.
2. The following material movement transactions were posted in that plant in the month of
1999-12.
3. 10 widgets were issued on 1999-12-10.
4. 100 widgets were received on 1999-12-15.
5. 50 widgets were issued on 1999-121-20.
6. 50 widgets were issued on 1999-12-29.
7. The Open Stock Level as of1999-12-01 is:
100 + 10 - 100 + 50 + 50 = 110.
This table is used the first time rows are added to the Stock Overview and Stock Level tables. If
the stock overview must be reloaded this table must be saved so the stock overview can be
correctly calculated. Hence the information in it must persist. The table must be loaded once,
and must not be truncated or refreshed at any stage after the initial load. This table is usually
sourced from a corresponding "Opening Balances" table in the source system. The point in time
of the snapshot is the time of the extract from that table (since the extract may take a while, the
time of the start of the extract is applied to every record).

140 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column mapping

Column name Datatype Description Derivation or source mapping


AVG_EXPR_DY_ INTEGER The average number of days for the material Table: MCHA
CNT in the lot or batch to expire. Column: VFDAT
All Passes:
Convert to Number of days ((Lookup to
MCHA.VFDAT where
SOURCE_TABLE.MATNR = MCHA.MATNR
and
SOURCE_TABLE.WERKS =
MCHA.WERKS and
SOURCE_TABLE.CHARG =
MCHA.CHARG) - SYSTEM DATE)

Pass 1: SOURCE_TABLE = MCHB


Pass 2: SOURCE_TABLE =
Pass 3: SOURCE_TABLE =
Pass 4: SOURCE_TABLE =
Pass 5: SOURCE_TABLE =
Pass 6: SOURCE_TABLE =

If CHARG is empty (or does not exist),


DEFAULT NUMBER

AVG_RECPT_DY INTEGER The average number of days from the time


_CNT the purchase order was issued for the
material, to the time it was received into the
plant.

BATCH_NO VARCHAR(10) This is the source system unique identifier Pass 1: MCHB.CHARG
for the batch in the source system. A batch Pass 2: MSPR.CHARG
is a grouping of material manufactured in a Pass 3: MSKA.CHARG
single production run that is managed Pass 4: MKOL.CHARG
together. This applies to stocks of materials Pass 5: MSKU.CHARG
managed in batches. Pass 6: MSLB.CHARG
Pass 7: Default number

COMPANY_CD VARCHAR(4) This is the code representing the company Table: T001K
that the plant belongs to. Column: BUKRS
All Passes
Lookup to T001K.BUKRS where
T001K.BWKEY = VALUATION_AREA_CD

VALUATION_AREA_CD logic is in
VALUATION_AREA_CD attribute
COST_METHOD_ VARCHAR(2) This is the code representing the method of Not required
CD pricing to use in valuating stock of a
material. Examples include "Standard
Price", "Moving Average Price", or "Periodic
Unit Price".

DELETION_IND CHAR(1) This is a flag that indicates that this record Pass 1:
should be considered as deleted. If MARD.LVORM = 'X' then 'Y'
Else 'N'

Pass 4:
If MKOL.LVORM = 'X' then 'Y'
Else 'N'

Pass 7:
If MARC.LVORM = 'X' then 'Y'
Else 'N'

Pass 2, 3, 5, 6:
Default short char, or 'N'?

Developer Guide 141


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


FISCAL_VARIAN VARCHAR(2) This code represents the Fiscal Variant for a All passes
T_CD plant. The Fiscal Variant is used to define
the fiscal calendars within an organization. Lookup to T001.PERIV
An organization may be composed of Where T001W.BWKEY = T001K.BWKEY
multiple companies (e.g., if mergers took T001K.BUKRS = T001.BUKRS
place), and may have to deal with multiple
fiscal calendars. Each fiscal calendar is T001W - Plants/Batches
represented by a fiscal variant. The fiscal T001K - Valuation Area
variant thus defines the number of posting T001 - Company Codes
periods in a given fiscal year, as well as their
start and end dates in terms of the calendar
year. The default fiscal variant is defined as
the calendar year, which starts on Jan 1st
and ends on Dec 31st, and includes 12
periods corresponding to the months, and 4
calendar quarters.

FISCAL_YEAR_V VARCHAR(4) The year of a given financial calendar that Pass 1: MARD.LFGJA
AL the Opening Balance Extract Date (As At Pass 2: MSPR.LFGJA
Date) falls in. Pass 3: MSKA.LFGJA
Pass 4: MKOL.LFGJA
Pass 5: MSKU.LFGJA
Pass 6: MSLB.LFGJA
Pass 7: MARC.LFGJA
INVENTORY_BLK CHAR(1) This indicates whether the Material at the Table: SEE SOURCE LOGIC
_IND Plant is blocked for an unspecified reason. Column: PHYSICAL INVENTORY
BLOCKING INDICATOR
Pass 1:
If MARD.SPERR <> ' ' then 'Y' Else 'N'

Pass 2:
If MSPR.PRSPR <> ' ' then 'Y' Else 'N'

Pass 3:
If MSKA.KASPR <> ' ' then 'Y' Else 'N'

Pass 4:
If MKOL.SPERS <> ' ' then 'Y' Else 'N'

Pass 5:
If MSKU.KUSPR <> ' ' then 'Y' Else 'N'

Pass 6:
If MSLB.LBSPR <> ' ' then 'Y' Else 'N'

Pass 7:
Default short char

LOCAL_CURREN VARCHAR(5) This is the code representing the currency in Table: T001
CY_CD which the company that created the Column: WAERS
document prefers to work. Currencies are
All Passes
applicable to monetary amounts. For
Lookup to T001K.WAERS where
example, if the currency which the
T001K.BWKEY = VALUATION_AREA_CD
concerned company prefers to work in is
Canadian dollars, the code representing it
may be CAD. This is used on reports that
are specific to the company that created the
document. Such reports display the
monetary amounts stored in the data
warehouse (which are in group currency) in
the currency of the company concerned.

MATERIAL_ID VARCHAR(18) This is the source system unique identifier Pass 1: MARD.MATNR
of the material being stocked. Pass 2: MSPR.MATNR
Pass 3: MSKA.MATNR
Pass 4: MKOL.MATNR
Pass 5: MSKU.MATNR
Pass 6: MSLB.MATNR
Pass 7: MARC.MATNR

142 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


OPN_BAL_EXTR INTEGER This is the date on which the Stock Opening
CT_DT Balance records were extracted from the
Source system.

PLANT_ID VARCHAR(4) This is the source system unique identifier Pass 1: MARD.WERKS
of the plant where the material is stocked. Pass 2: MSPR.WERKS
Pass 3: MSKA.WERKS
Pass 4: MKOL.WERKS
Pass 5: MSKU.WERKS
Pass 6: MSLB.WERKS
Pass 7: MARC.WERKS

POSTING_PERIO NUMBER(2,0) The posting period of the Fiscal Year of a Pass 1: MARD.LFMON
D_NO given financial calendar that the Opening Pass 2: MSPR.LFMON
Balance Extract Date (As At Date) falls in. Pass 3: MSKA.LFMON
Pass 4: MKOL.LFMON
Pass 5: MSKU.LFMON
Pass 6: MSLB.LFMON
Pass 7: MARC.LFMON

SPECIAL_STOCK CHAR(1) This is a code representing types of stock Pass 1: Default short char
_CD that need special handling,e.g., Pass 2: MSPR.SOBKZ
consignment stock. Pass 3: MSKA.SOBKZ
Pass 4: MKOL.SOBKZ
Pass 5: MSKU.SOBKZ
Pass 6: MSLB.SOBKZ
Pass 7: Default short char

Developer Guide 143


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


STOCK_QTY NUMBER(13,3) The total quantity of stock of the material in Pivot table on quantity rows:
a plant (or storage location). This is used as
the opening balance quantity of the material Note: for each stock quantity below, we have
in that plant and storage location. to "hard-code" a STOCK_TYPE_CD key in
order to turn one table row into multiple
rows. The STOCK_TYPE_CD will be
supplied by the user through a parameter
value. There will be six parameters:
a) Unrestricted_Use_Parameter
b) Blocked_Parameter
c) Quality_Inspection_Parameter
d) Restricted_Use_Parameter
e) Stock_In_Transit_Parameter
f) Returns_Parameter

STOCK_TYPE_CD = Unrestricted Use


Parameter
Pass 1: If MCHB.CLABS is Null then
If MARD.LABST > 0,
MARD.LABST, null
Else if MCHB.CLABS > 0,
MCHB.CLABS, null
Pass 2: IF sum(MSPR.PRLAB) > 0,
sum(MSPR.PRLAB), null
Same format as Pass 2, using:
Pass 3: sum(MSKA.KALAB)
Pass 4: sum(MKOL.SLABS)
Pass 5: sum(MSKU.KULAB)
Pass 6: sum(MSLB.LBLAB)
Pass 7: Not applicable

STOCK_TYPE_CD = Blocked_Parameter
Pass 1: IF MCHB.SPEME is null then
If MARD.SPEME > 0,
MARD.SPEME, null
ELSE If MCHB.SPEME > 0,
MCHB.SPEME, null
Pass 2: If sum(MSPR.PRSPE) > 0, sum
(MSPR.PRSPE), null
Same format as Pass 2, using:
Pass 3: sum(MSKA.KASPE)
Pass 4: sum(MKOL.SSPEM)
Pass 5, 6, 7: Not applicable

STOCK_TYPE_CD =
Quality_Inspection_Parameter
Pass 1: If MCHB.INSME is null then
if MARD.INSME > 0,
MARD.INSME, null
Else if MCHB.INSME > 0,
MCHB.INSME, null
Pass 2: If sum(MSPR.PRINS) > 0, sum
(MSPR.PRSPE), null
Same logic as Pass 2, using:
Pass 3: sum(MSKA.KAINS)
Pass 4: sum(MKOL.SINSM)
Pass 5: sum(MSKU.KUINS)
Pass 6: sum(MSLB.LBINS)
Pass 7: Not applicable

144 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


STOCK_QTY STOCK_TYPE_CD = Stock In Transit
(Cont’d) Quantity'?
Pass 1: If MCHB.UMLME is null then
If MARD.UMLME > 0,
MARD.UMLME, null
Else if MCHB.UMLME > 0,
MCHB.UMLME, null
Pass 2, 3, 4, 5, 6: Not applicable

Pass 7: If MARC.UMLMC > 0,


MARC.UMLMC, null

STOCK_TYPE_CD = 'Restricted QTY'


Pass 1: If MCHB.EINME is null then
if MARD.EINME > 0,
MARD.EINME, null
Else if MCHB.EINME > 0,
MCHB.EINME, null
Pass 2, 3, 7: Not applicable
Pass 4: If sum(MKOL.SEINM) > 0,
sum(MKOL.SEINM), Null
Same logic as pass 4 using:
Pass 5: sum(MSKU.KUEIN)
Pass 6: sum(MSLB.LBEIN)

STOCK_TYPE_CD = 'Returns Parameter'


Pass 1: If MCHB.RETME is null then
If MARD.RETME > 0,
MARD.RETME, null
Else if MCHB.RETME > 0,
MCHB.RETME, null
Pass 2, 3, 4, 5, 6, 7: Not applicable

STOCK_QTY NUMBER(13,3) The total quantity of stock of the material in applicable


a plant (or storage location). This is used as
the opening balance quantity of the material Pass 7: If MARC.UMLMC > 0,
in that plant and storage location. MARC.UMLMC, null

STOCK_TYPE_CD = 'Restricted QTY'


Pass 1: If MCHB.EINME is null then
if MARD.EINME > 0,
MARD.EINME, null
Else if MCHB.EINME > 0,
MCHB.EINME, null
Pass 2, 3, 7: Not applicable
Pass 4: If sum(MKOL.SEINM) > 0,
sum(MKOL.SEINM), Null
Same logic as pass 4 using:
Pass 5: sum(MSKU.KUEIN)
Pass 6: sum(MSLB.LBEIN)

STOCK_TYPE_CD = 'Returns Parameter'


Pass 1: If MCHB.RETME is null then
If MARD.RETME > 0,
MARD.RETME, null
Else if MCHB.RETME > 0,
MCHB.RETME, null
Pass 2, 3, 4, 5, 6, 7: Not applicable

STOCK_TYPE_C VARCHAR(2) This is a code representing the type of stock Derived from Pivot in all cases. See
D with regard to its availability for issue. For STOCK_QTY
example: "unrestricted-use" stock is
available for issue, whereas stock "in quality
inspection" or stock that is "blocked" for
some unspecified reason is not.
STORAGE_LCTN VARCHAR(4) This is the code representing the physical Pass 1: MARD.LGORT
_CD storage location in the plant where the Pass 2: MSPR.LGORT
stocks are held. Pass 3: MSKA.LGORT
Pass 4: MKOL.LGORT

Pass 5, 6, 7: Default short char

Developer Guide 145


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


VALUATED_STO NUMBER(13,3) This is the total quantity of stock of the If STOCK_TYPE_CD in 'RETURNS'
CK_QTY material in the plant that is valued. Stock in parameter OR
plants that are not "owned" are not counted. SPECIAL_STOCK_CD in 'Vendor
Consignment' then
0
Else STOCK_QTY

146 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


VALUATION_ARE VARCHAR(4) This is the code representing the Table: T001W
A_CD organizational grouping to which the plant Column: BWKEY
belongs for material valuation purposes. A Pass 1:
valuation area may be a single plant, or all
Lookup to T001W.BWKEY where
plants belonging to a company.
MARD.WERKS = T001W.WERKS

Pass 2:
Lookup to T001W.BWKEY where
MSPR.WERKS = T001W.WERKS

Pass 3:
Lookup to T001W.BWKEY where
MSKA.WERKS = T001W.WERKS

Pass 4:
Lookup to T001W.BWKEY where
MKOL.WERKS = T001W.WERKS

Pass 5:
Lookup to T001W.BWKEY where
MSKU.WERKS = T001W.WERKS

Pass 6:
Lookup to T001W.BWKEY where
MSLB.WERKS = T001W.WERKS

Pass 7:
Lookup to T001W.BWKEY where
MARC.WERKS = T001W.WERKS

Developer Guide 147


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


VALUATION_TYP VARCHAR(10) This is the code representing the stocks of a Table: MCHA
E_CD material subject to split valuation. The Column: BWTAR - VALUATION TYPE
valuation category determines which
Pass 1:
valuation types are permissible for a
Lookup to MCHA.BWTAR where
material. If a material is valuated according
MCHB.MATNR = MCHA.MATNR and
to its origin (valuation category H in SAP),
MCHB.WERKS = MCHA.WERS and
you can define the possible countries of
MCHB.CHARG = MCHA.CHARG
origin as valuation types.
Pass 2:
Lookup to MCHA.BWTAR where
MSPR.MATNR = MCHA.MATNR and
MSPR.WERKS = MCHA.WERS and
MSPR.CHARG = MCHA.CHARG

Pass 3:
Lookup to MCHA.BWTAR where
MSKA.MATNR = MCHA.MATNR and
MSKA.WERKS = MCHA.WERS and
MSKA.CHARG = MCHA.CHARG

Pass 4:
Lookup to MCHA.BWTAR where
MKOL.MATNR = MCHA.MATNR and
MKOL.WERKS = MCHA.WERS and
MKOL.CHARG = MCHA.CHARG

Pass 5:
Lookup to MCHA.BWTAR where
MSKU.MATNR = MCHA.MATNR and
MSKU.WERKS = MCHA.WERS and
MSKU.CHARG = MCHA.CHARG

Pass 6:
Lookup to MCHA.BWTAR where
MSLB.MATNR = MCHA.MATNR and
MSLB.WERKS = MCHA.WERS and
MSLB.CHARG = MCHA.CHARG

Pass 7: Default short char

MATNR - Material Number


WERKS - Plant
CHARG - Batch Number

Stock Overview
Target table name: STOCK_OVERVIEW
Table type: Fact
Description: This shows a summary of the most important information required in Inventory
Management, such as Stock Level, Stock Usage, Stock Usage Forecast, Stock outages and
Physical Inventory Counts. The summary is at a monthly grain.

148 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column mapping

Derivation or
source
Column name Datatype Description mapping
ABS_STK_ACCR NUMBER This is the accuracy of the physical inventory levels expressed as a
CY_PCT percentage, with no regard to whether the estimate is over or under
the actual amount. The formula used is: Absolute
Stock Accuracy Percentage =
(1 - ABS(Book Stock Level Count - Physical Inventory Count)/ Book
Stock Level Count) * 100 (e.g., if Book Stock Level Count = 100
and Physical Inventory Count = 110 then ABS Stock Accuracy = 90%;
if Book Stock Level Count = 100 and Physical Inventory Count = 90
then ABS Stock Accuracy = 90%).
For first row 0. Update for new or changed rows in
PHYSICAL_INVENTORY. roll forward: ABS_STOCK_ACCURACY.
Assume that the Stock Accuracy for any periods is the accuracy as at
the last physical inventory date.

Developer Guide 149


Chapter 3: Data Mart Metadata

Derivation or
source
Column name Datatype Description mapping
AVG_STCK_LVL_ NUMBER(18,3) This is the average of the stock levels for the time period concerned
QTY (day, week, or month). This is used in business questions such as the
following:

"Show me a report showing the stock level of Material A over time by


month".

This sounds like a simple question, but it is not. Stock levels change
constantly throughout the month. It is easy to determine the stock
level at the start of a month or at the end of it, but what does one really
mean by "the stock level for a month"? One answer might be that one
would like to see the average stock level for the month. So what is the
average stock level? That is another difficult question. The true
average stock level is calculated from a mathematical integral of
material movements across the period concerned. However, such
calculations are complicated, and most users seem to shy from it. A
variety of other simpler methods are used, though any method other
than the mathematical integral is an approximation of the average. To
add to the complication, the number of hours over which the average
is calculated affects the value of it (e.g., all hours of the day vs.
working hours). Thus, the value of the average is dependent on the
method of calculation chosen, and may vary from business to
business. The important point is to be consistent in the usage of a
method.

The following examples demonstrate the disparity in results from


various averaging methods:

Day 1 Started with 0 stock of an item.


Received 100 units of the item at the beginning of the working day.
Issued 80 units of the item more or less evenly throughout the
working day.
20 left in stock at the end of the working day.
Open Stock Level for the day is 0.
Close Stock Level for the day is 20.
True (integrated) average stock level for the working day is 60.
Average based on (Open Stock Level + Close Stock Level) / 2 is 10.
Average based on Daily Close Stock Level is 20.
Day 2 Received 100 at the beginning of the working day.
Issued 110 units of the item more or less evenly throughout the
working day.
10 left at the end of the working day.
Open Stock Level for the day is 20.
Close Stock Level for the day is 10.
True (integrated) average stock level for the working day is 65.
Average based on (Open Stock Level + Close Stock Level) / 2 is 15.
Average based on Daily Close Stock Level is 10.

The average stock level for the two days may be:

62.5 based on the True (integrated) average stock level for the
working day
5 based on the Average based on (Open Stock Level + Close Stock
Level) / 2 over two days
15 based on the Average of the Daily Close Stock Level of each day

Clearly, there is a large amount of disparity between the answers


obtained from different methods, and no answer that stands out as
being the "right" one. As long as the definition of average stock level is
clearly stated, yields answers that are meaningful to the business, and
is useful for comparison, it is suitable for most inventory management
purposes.

The IA e-application supports two definitions of average stock level:


1) Average based on (Open Stock Level + Close Stock Level) / 2 for
the period. For example, the average of the month is (Open Stock
Level for the month + Close Stock Level for the month) / 2
2) Average of daily Close Stock Level. For example, the average of the
month is the average of the Close Stock Level for every day of the
month.

The user selects an averaging method using a global configuration


parameter.
150 Cognos Analytic Applications Inventory Analysis for SAP(R)
Chapter 3: Data Mart Metadata

Derivation or
source
Column name Datatype Description mapping
AVG_UR_STK_LV NUMBER(18,3) This is the average of the stock levels for the time period concerned
L_QTY (day, week, or month) for "unrestricted-use" stock types only. This is
used in business questions such as the following:

"Show me a report showing the stock level of Material A over time by


month".

This sounds like a simple question, but it is not. Stock levels change
constantly throughout the month. It is easy to determine the stock
level at the start of a month or at the end of it, but what does one really
mean by "the stock level for a month"? One answer might be that one
would like to see the average stock level for the month. So what is the
average stock level? That is another difficult question. The true
average stock level is calculated from a mathematical integral of
material movements across the period concerned. However, such
calculations are complicated, and most users seem to shy from it. A
variety of other simpler methods are used, though any method other
than the mathematical integral is an approximation of the average. To
add to the complication, the number of hours over which the average
is calculated affects the value of it (e.g., all hours of the day vs.
working hours). Thus, the value of the average is dependent on the
method of calculation chosen, and may vary from business to
business. The important point is to be consistent in the usage of a
method.

The following examples demonstrate the disparity in results from


various averaging methods:

Day 1 Started with 0 stock of an item.


Received 100 units of the item at the beginning of the working day.
Issued 80 units of the item more or less evenly throughout the
working day.
20 left in stock at the end of the working day.
Open Stock Level for the day is 0.
Close Stock Level for the day is 20.
True (integrated) average stock level for the working day is 60.
Average based on (Open Stock Level + Close Stock Level) / 2 is 10.
Average based on Daily Close Stock Level is 20.
Day 2 Received 100 at the beginning of the working day.
Issued 110 units of the item more or less evenly throughout the
working day.
10 left at the end of the working day.
Open Stock Level for the day is 20.
Close Stock Level for the day is 10.
True (integrated) average stock level for the working day is 65.
Average based on (Open Stock Level + Close Stock Level) / 2 is 15.
Average based on Daily Close Stock Level is 10.

The average stock level for the two days may be:

62.5 based on the True (integrated) average stock level for the
working day
5 based on the Average based on (Open Stock Level + Close Stock
Level) / 2 over two days
15 based on the Average of the Daily Close Stock Level of each day

Clearly, there is a large amount of disparity between the answers


obtained from different methods, and no answer that stands out as
being the "right" one. As long as the definition of average stock level is
clearly stated, yields answers that are meaningful to the business, and
is useful for comparison, it is suitable for most inventory management
purposes.

The IA e-application supports two definitions of average stock level:


1) Average based on (Open Stock Level + Close Stock Level) / 2 for
the period. For example, the average of the month is (Open Stock
Level for the month + Close Stock Level for the month) / 2
2) Average of daily Close Stock Level. For example, the average of the
month is the average of the Close Stock Level for every day of the
month.

The user selects an averaging method using a global configuration


parameter.
Developer Guide 151
Chapter 3: Data Mart Metadata

Derivation or
source
Column name Datatype Description mapping
CLOSE_STCK_L NUMBER(18,3) This is the stock level at the end of a time period (day, week, or
VL_QTY month).
CLS_UR_STK_LV NUMBER(18,3) This is the stock level at the end of a time period (day, week, or month)
L_QTY for "unrestricted-use" stock types only.

CUMULATIVE_U NUMBER(18,3) This is the sum of the past usage of stocks for period of time (day,
SG_QTY week, or month).

FISCAL_PERIOD INTEGER This is a foreign key to the FISCAL entity that is identified by the
_SID relationship name "fiscal period" sourced from the Logical Data
Model.

FORECAST_USA NUMBER(18,3) This is the predicted usage of the stocks in the time period concerned
GE_QTY (day, week, or month) based on a version of a forecasting model (If
several valid versions of the model exist, such as Optimistic and
Pessimistic, an average of the versions may be used).

LAST_USED_DT INTEGER This is a foreign key to the TIME entity that is identified by the
relationship name "last used date" sourced from the Logical Data
Model.

MATERIAL_SID INTEGER This is a foreign key to the MATERIAL entity that is identified by the
relationship name "material" sourced from the Logical Data Model.
MATERIAL_STRG INTEGER This is a foreign key to the MATERIAL STORAGE entity that is
_SID identified by the relationship name "material storage" sourced from
the Logical Data Model.

MAX_STK_LVL_Q NUMBER(18,3) This is the highest value of the stock level in a time period (day, week,
TY or month).

MAX_UR_STK_L NUMBER(18,3) This is the highest value of the stock level in a time period (day, week,
VL_QTY or month) for "unrestricted-use" stock types only.

MIN_STK_LVL_Q NUMBER(18,3) This is the lowest value of the stock level in the time period concerned
TY (day, week, or month).
MIN_UR_STK_LV NUMBER(18,3) This is the lowest value of the stock level in the time period concerned
L_QTY (day, week, or month) for "unrestricted-use" stock types only.

MOVING_AVG_U NUMBER(18,3) This is the moving average of the stock usage quantities for the time
SG_QTY period concerned (day, week, or month). The moving average value is
dependent on the number of periods over which it is to be calculated,
which should be an user-defined global parameter. For example, if the
moving average is to be calculated over 3 periods, the formula used
would be: Moving Average
Stock Usage Quantity =
[Average Stock Usage Quantity for (current period) +
Average Stock Usage Quantity for the (current period -1) +
Average Stock Usage Quantity for the (current period -2)] / 3.

MV_AVG_STK_LV NUMBER(18,3) This is the moving average of the stock levels for the time period
_QTY concerned (day, week, or month). The moving average value is
dependent on the number of periods over which it is to be calculated,
which should be an user-defined global parameter. For example, if the
moving average is to be calculated over 3 periods, the formula used
would be: Moving
Average Stock Level = [Average Stock Level for (current period) +
Average Stock Level for the (current period -1) +
Average Stock Level for the (current period -2)] / 3.
MV_AVG_UR_ST NUMBER(18,3) This is the moving average of the stock levels for the time period
_L_QTY concerned (day, week, or month) for "unrestricted-use" stock types
only. The moving average value is dependent on the number of
periods over which it is to be calculated, which should be an
user-defined global parameter. For example, if the moving average is
to be calculated over 3 periods, the formula used would be: Moving
Average Stock Level = [Average Stock Level for (current period) +
Average Stock Level for the (current period -1) +
Average Stock Level for the (current period -2)] / 3.

OPEN_STOCK_L NUMBER(18,3) This is the stock level at the beginning of a time period (day, week, or
VL_QTY month).

152 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Derivation or
source
Column name Datatype Description mapping
OPN_UR_STK_L NUMBER(18,3) This is the stock level at the beginning of a time period (day, week, or
VL_QTY month) for "unrestricted-use" stock types only.
OVERSTOCK_QT NUMBER(18,3) This is the quantity of stock that is greater than the quantity needed to
Y meet short term demand.

OVRSPPLY_USG NUMBER(18,3) This is calculated by taking the replenishment period established for
_QTY the material by the category rank, and comparing the usage for that
period to the replenishment quantity expected for the period. The
Over Usage Quantity is the quantity of usage that exceeds the
replenishment quantity.

PHYSCL_INV_D NUMBER This is the number of physical inventory counts that have been
OC_CNT performed on the material at the plant in the period. It is calculated by
counting the number of detail physical inventory line items (in Physical
Inventory) for material at a plant.
PLANT_SID INTEGER This is a foreign key to the PLANT entity that is identified by the
relationship name "plant" sourced from the Logical Data Model.

RANK_NO INTEGER This field depicts the rank number (unique number) that will be used
to populate the STOCK_OVERVIEW table. Each rank is represented
by a group of plant_ids that share the same metrics for their
calculation.

RELV_STK_ACC NUMBER This is the accuracy of the physical inventory levels expressed as a
RC_PCT percentage, with a distinction between an over- or under-estimation of
the actual amount. The formula used is: Relative Stock
Accuracy Percentage =
(1 - (Book Stock Level Count - Physical Inventory Count) / Book Stock
Level Count) * 100 (e.g., if Book Stock Level Count = 100 and
Physical Inventory Count = 110 then ABS Stock
Accuracy = 110%
if Book Stock Level Count = 100 and Physical Inventory Count = 90
then ABS Stock Accuracy = 90%)

REQUIRED_QTY NUMBER(18,3) This is the number of units of material that must be purchased or
produced in order to meet short term demand. This measure is
available in the Inventory Analysis Catalog, which may be queried and
reported on using Cognos Impromptu.

REQUIRED_USG NUMBER(18,3) This is the quantity of expected future usage, reflecting either actual
_QTY requirements, or where these do not exist, the previous year`s same
month`s historical usage is used. This measure is available in the
Inventory Analysis Catalog, which may be queried and reported on
using Cognos Impromptu.

STD_DEV_USG_ NUMBER(18,3) This is the standard deviation of the stock usage quantities for a time
QTY period (day, week, or month).

STOCKOUT_CNT NUMBER This is the number of times that a stockout was registered in a time
period (day, week, or month). A stockout is registered when
somebody requests a stock item and the request cannot be satisfied
due to a shortage of stock.

UOM_SID INTEGER This is a foreign key to the UNIT OF MEASURE entity that is identified
by the relationship name "unit of measure" sourced from the Logical
Data Model.

USAGE_QTY NUMBER(18,3) This is the actual usage of the stocks in a time period (day, week, or
month).

VALUATION_SID INTEGER This is a foreign key to the VALUATION entity that is identified by the
relationship name "valuation" sourced from the Logical Data Model.
ZERO_STK_DYS NUMBER This is the number of days over which a stock level was zero in a time
_CNT period (day, week, or month).

ZERO_STOCK_C NUMBER This is the number of times that the stock level dipped to zero time
NT period concerned (day, week, or month).

ZERO_STOCK_C INTEGER This is the date on which the Zero Stock Count field was last updated.
NT_DT

Developer Guide 153


Chapter 3: Data Mart Metadata

Stock Usage Forecast


Target table name: STOCK_USAGE_FRCST
Table type: Fact
Description: This table contains the predicted usage quantities (Stock Usage Forecasts) for a
material in a given period based on a forecast version. Forecast Versions are used to predict
stock usage. Each version may be based on any one of a number of forecasting models
supported in the source system. A forecasting model is defined by a set of parameters that is
used to calculate the predicted usage quantity. A version thus represents a set of values
assigned to the parameters of the model.
Predicted usage quantities are stored in the Stock Usage Forecast entity. Stock Usage refers to
the utilization of stock in sales or in production. Transfers between plants, or the removal of stock
for quality inspection, reservations, etc. is not considered usage. Predicted usage quantities in
the Stock Usage Forecast entity are used to calculate an overall Stock Usage Forecast number
in the Stock Overview entity. The overall Stock Usage Forecast number may be based on an
average of the predicted usage quantity of multiple versions. The Include in Overview Indicator
indicates which versions are to be used in the average. The period over which the forecast is
calculated may be a day, a week or a month. The period is defined by the period first day date
and the period number.
Column mapping

Column name Datatype Description Derivation or source mapping


CHANGED_DT DATE This represents the date and time of update System generated
of the warehouse record. This field is
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

CREATED_DT DATE This represents the date and time of System generated
creation of the warehouse record. This field
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

CRRCTD_FRCST NUMBER(13,3) A manually entered value which corrects the Table: PROW
_QTY system calculated forecast value from a Column: KOPRW - CORRECTED
forecast run. FORECAST VALUE

FORECAST_MTH INTEGER This is a foreign key to the STOCK USAGE Table: PROP
D_SID FORECAST METHOD entity that is Column: PRMOD - FORECAST MODEL
identified by the relationship name "forecast
Lookup to STOCK_USG_FRCST_MTHD
method" sourced from the Logical Data
dimension to retrieve
Model.
FORECAST_MTHD_SID
where PROP.PRMOD =
FORECAST_MTHD_CD

FORECAST_PRD CHAR(1) This is the periodic code of the forecast (i.e. Table: MAPR
C_CD D = Daily, W = Weekly, M = Monthly). Column: PERKZ - PERIOD INDICATOR

FORECAST_PRD NUMBER(3) This is the count of periods included in the Table: PROP
_CNT forecast. Column: ANZPR - NUMBER OF
FORECAST PERIODS

154 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


FORECAST_QTY NUMBER(13,3) This is the anticipated usage quantity for a Table: PROW
period, pertaining to an instance of a Column: PRWRT - FORECAST VALUE
forecast.

FORECAST_RUN INTEGER(8) This is a foreign key to the TIME entity that Table: MAPR
_DT is identified by the relationship name "stock Column: DATUM - DATE AND TIME,
usage forecast was run at time" sourced CURRENT (APPLICATION SERVER
from the Logical Data Model.
FORECAST_STA INTEGER(8) This is a foreign key to the TIME entity that Table: PROP
RT_DT is identified by the relationship name "stock Column: PRDAT - DATE OF LAST
usage forecast period starts on time" FORECAST
sourced from the Logical Data Model.

FRCST_FSCL_P INTEGER This is a foreign key to the FISCAL entity Table: PROW
RD_SID that is identified by the relationship name Column: ERTAG
"stock usage forecast made for fiscal"
Lookup fiscal period in All Time using
sourced from the Logical Data Model.
PROW.ERTAG and the fiscal variant.

To get the fiscal variant T001.PERIV


where MAPR.WERKS = T001W.WERKS
AND
T001W.BWKEY = T001K.BWKEY AND
T001K.BUKRS = T001.BUKRS

FRCST_PRD_ST INTEGER(8) This is a foreign key to the TIME entity that Table: PROW
RT_DT is identified by the relationship name "stock Column: ERTAG - FRST DY OF THE PRD
usage forecast period starts at date in time" TO WHCH THE VALS REFER
sourced from the Logical Data Model.

MATERIAL_SID INTEGER This is a foreign key to the MATERIAL entity Table: MAPR
that is identified by the relationship name Column: MATNR, WERKS
"material dim" sourced from the Logical
Lookup to Material Storage dimension to
Data Model.
retrieve Material_Strg_Sid where
MAPR.MATNR =
MATERIAL_STORAGE.MATERIAL_ID and
MAPR.WERKS =
MATERIAL_STORAGE.PLANT_ID
MATERIAL_STRG INTEGER This is a foreign key to the MATERIAL Table: MAPR
_SID STORAGE entity that is identified by the Column: MATNR, WERKS
relationship name "material storage dim"
Lookup to Material Storage dimension to
sourced from the Logical Data Model.
retrieve Material_Strg_Sid where
MAPR.MATNR =
MATERIAL_STORAGE.MATERIAL_ID and
MAPR.WERKS =
MATERIAL_STORAGE.PLANT_ID

OFFCL_FRCST_ SMALLINT This multiplier is set to 1 if the forecast Table: PROP


MULT instance is considered the "official" forecast Column: HSNUM - HISTORY NUMBER
to be considered by the application for the IF PROP.HSNUM = '00' then '1' else '0'
purposes of calculating forecast accuracy,
overstock and understock. This multiplier is ****This must be checked each time a
set to 0 if the forecast instance is to be forecast is executed as this value changes
ignored. each time a forecast is run.

Developer Guide 155


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


PLANT_SID INTEGER This is a foreign key to the PLANT entity that Table: MAPR
is identified by the relationship name "plant Column: WERKS - PLANT
dim" sourced from the Logical Data Model.
Lookup to PLANT dimension to retrieve
PLANT_SID where
PLANT.PLANT_ID = MAPR.WERKS
PLANT.STORAGE_LCTN_CD = {Default
Short char}

UOM_SID INTEGER This is a foreign key to the UNIT OF Table: MARA


MEASURE entity that is identified by the Column: MEINS - BASE UNIT OF
relationship name "base uom dim" sourced MEASURE
from the Logical Data Model.
Lookup to the UOM dimension to retrieve
UOM_SID where
MARA.MEINS =
UNIT_OF_MEASURE.UOM_SID

To retrieve MARA.MEINS,
Lookup to MARA.MEINS where
MAPR.MATNR = MARA.MATNR

Stock Usage Forecast Method


Target table name: STK_USG_FRCST_MTHD
Table type: Dimension
Description: This table contains details of versions of forecasts used to predict stock usage.
Each version may be based on any one of a number of forecasting models supported in the
source system. A forecasting model is defined by a set of parameters that is used to calculate
the predicted usage quantity. A version thus represents a set of values assigned to the
parameters of the model. Predicted usage quantities are stored in the Stock Usage Forecast
entity
Stock Usage refers to the utilization of stock in sales or in production. Transfers between plants,
or the removal of stock for quality inspection, reservations, etc. is not considered usage.
Predicted usage quantities in the Stock Usage Forecast entity are used to calculate an overall
Stock Usage Forecast number in the Stock Overview entity. The overall Stock Usage Forecast
number may be based on an average of the predicted usage quantity of multiple versions. The
Include in Overview Indicator indicates which versions are to be used in the average.
Column mapping

Column name Datatype Description Derivation or source mapping


CHANGED_DT DATE This represents the date and time of update
of the warehouse record. This field is
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

CREATED_DT DATE This represents the date and time of


creation of the warehouse record. This field
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

156 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


FORECAST_MET VARCHAR(10) This is the code representing the forecasting Table: DD07T
HOD_CD method that was used to calculate predicted Column: DOMVALUE_L-VALUES FOR
usage quantities of the material. Examples DOMAINS: SINGLE VALUE/UPPER
of methods used include "moving average",
Select DOMVALUE_L from DD07T
"linear approximation", "regression
where DOMNAME = 'PRMOD'
analysis", etc.
and DDLANGUAGE = Language Parameter

FORECAST_MET VARCHAR(60) This is the textual name that interprets the Table: DD07T
HOD_NM forecasting method code. Column: DDTEXT
Select DDTEXT from DD07T
where DOMNAME = 'PRMOD'
and DDLANGUAGE = Language Parameter

FORECAST_MTH INTEGER This is a data warehouse system generated The ETL generated unique identifier for the
D_SID unique identifier for the forecast version. dimension.
FRCST_MTHD_D VARCHAR(150) This is the primary key for this entity. This key is composed of:
IM_ID FORECAST_METHOD_CD

Stockout
Target table name: STOCKOUT
Table type: Conformed dimension
Description: This table keeps a record of the number of times that a stockout was registered for
a material at a plant or storage location in the time period concerned (day, week, or month) A
stockout is registered when somebody requests a stock item and the request cannot be satisfied
due to a shortage of stock.
Column mapping

Column name Datatype Description Derivation or source mapping


CHANGED_DT DATE This represents the date and time of update Created by the ETL.
of the warehouse record. This field is
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

CREATED_DT DATE This represents the date and time of Created by the ETL.
creation of the warehouse record. This field
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

FISCAL_VARIAN VARCHAR(2) This is the code representing the Fiscal


T_CD Variant. The Fiscal Variant is used to define
the fiscal calendars within an organization.
An organization may be composed of
multiple companies (e.g., if mergers took
place), and may have to deal with multiple
fiscal calendars. Each fiscal calendar is
represented by a fiscal variant. The fiscal
variant thus defines the number of posting
periods in a given fiscal year, as well as their
start and end dates in terms of the calendar
year. The default fiscal variant is defined as
the calendar year, which starts on Jan 1st
and ends on Dec 31st, and includes 12
periods corresponding to the months, and 4
calendar quarters.

Developer Guide 157


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


MATERIAL_ID VARCHAR(18) This is the source system unique identifier
of the material.

OVERVIEW_INCL INTEGER This is the date on which this record was


D_DT included in the calculation of Stockout Count
in the Stock Overview entity.

PLANT_ID VARCHAR(4) This is the source system unique Identifier


of the plant where the stockout occurred.

STOCKOUT_CNT INTEGER This is the number of times that a stockout


was registered in the time period concerned
(day, week, or month). A stockout is
registered when somebody requests a stock
item and the request cannot be satisfied due
to a shortage of stock.

STOCKOUT_DIM VARCHAR(150) This is the primary key for this entity. This key is composed of:
_ID PLANT_ID
STORAGE_LCTN_CD
MATERIAL_ID
VALUATION_AREA_CD
VALUATION_TYPE_CD
STOCKOUT_DT
STOCKOUT_DT INTEGER This is the date when the stockout occurred.

STOCKOUT_SID INTEGER ETL generated unique identifier for a row in


the Stockout fact.

STORAGE_LCTN VARCHAR(20) This is the identifier of the storage location


_CD where the stockout occurred. A plant may
have a number of storage locations.

Storage Bin
Target table name: STORAGE_BIN
Table type: Conformed dimension
Description: This table describes the physical location where the material is stored in a
warehouse. In the context of Inventory Analysis, a warehouse is synonymous with a plant.
Column mapping

Column name Datatype Description Derivation or source mapping


BIN_LOAD_CAP_ NUMBER(11,3) This is the load capacity for the storage bin. SAP short text: Load capacity of storage bin
NO
Pass 1
LAGP.LGEWI

Pass 2
default short char

Pass 3
default short char

BIN_LOAD_UOM VARCHAR(3) This is a code representing the unit of SAP short text: Weight Unit
_CD weight used if the capacities specified
represent mass. Pass 1
LAGP.GEWEI

Pass 2
default short char

Pass 3
default short char

158 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


BIN_QUANTS_M NUMBER(7,0) This is the maximum number of quants that SAP short text: Maximum number of quants
AX_QTY may be stored in the storage bin. This field in storage bin
is used during stock placement strategy Pass 1
whereby, depending on the bin sectioning, LAGP.MAXQU
different numbers of storage units can fit into
the bin. Pass 2
set to 0

Pass 3
set to 0

BIN_QUANTS_Q NUMBER(7,0) This is the number of quants in a storage SAP short text: Number of quants in storage
TY bin. This number is automatically filled by bin
the system during stock placements and Pass 1
stock removals. LAGP.ANZQU

Pass 2
set to 0

Pass 3
set to 0
BIN_SECTION_ID CHAR(1) This is the identifier for the Bin Sectioning. Pass 1
In stock placement strategies, this decides LAGP.PLAUF
which storage unit types and how many
storage units of each type can be placed Pass 2
into storage. The sectioning is determined default short char
dynamically in the storage bin by the first
storage unit placed in the bin. The Pass 3
sectioning is deleted as soon as the last unit default short char
has been removed from the bin.

BIN_SORT_FIEL VARCHAR(9) This is the sort order of the bins. It is used Pass 1
D_TXT by the system for sorting empty bins. By LAGP.SORLP
automatically setting an entry in the field
when the storage bins are created, the Pass 2
system ensures that materials are placed default short char
into stock in the warehouse in a different
manner. For example, the warehouse is not Pass 3
filled aisle by aisle, but evenly from front to default short char
back.

BIN_TOTAL_CAP NUMBER(11,3) This is the total capacity of the storage bin. SAP short text: Total capacity of storage bin
_QTY This value must correspond to the capacity Pass 1
usage values that can be defined in the LAGP.LKAPV
material master or for the storage unit type.
Pass 2
set to 0

Pass 3
set to 0

BIN_TYPE_CD VARCHAR(2) This is a code representing the classification SAP short text: Storage bin type
of storage bins according to physical
characteristics, e.g.; high bin, liquid storage Pass 1
bin, etc. LAGP.LPTYP

Pass 2
default short char

Pass 3
default short char

Developer Guide 159


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


BIN_TYPE_DSC VARCHAR(20) This is a textual description representing the SAP short text: Description of storage bin
classification of storage bins according to type
physical characteristics, e.g.; high bin, liquid Pass 1
storage bin, etc. Lookup T303T.PTYPT where
T303T.LGNUM = LAGP.LGNUM and
T303T.LPTYP = LAGP.LPTYP and
T303T.SPRAS = LanguageParameter

Pass 2
default short char

Pass 3
default short char

BIN_UNIT_MAX_ NUMBER(5,0) This is the maximum number of storage SAP short text: Maximum number of storage
QTY units in storage bin. units in storage bin
Pass 1
LAGP.MAXLE

Pass 2
set to 0

Pass 3
set to 0
BIN_UNIT_QTY NUMBER(9,3) This is the current number of storage units SAP short text: Number of storage units in
in the storage bin. This value is updated storage bin
during stock placements and removals. Pass 1
LAGP.ANZLE

Pass 2
set to 0

Pass 3
set to 0

BLOCK_IND CHAR(1) This is an indicator of whether the storage Pass 1


bin is blocked for any reason. If any of the following fields have a value of
'X'
LAGP.SKZUA (Blocking indicator: for stock
removals (user))
LAGP.SKZUE (Blocking indicator: for
putaways (user))
LAGP.SKZSA (Blocking indicator: current
stock removal (system))
LAGP.SKZSE (Blocking indicator: current
stock placement (system))
LAGP.SKZSI (Blocking indicator: current
inventory (system))
then
set the indicator to 'Y'
else
set the indicator to 'N'

Pass 2
set to default short char

Pass 3
set to default short char

BLOCK_REASON CHAR(1) This is the code representing why the stock SAP short text: Blocking reason
_CD is being blocked from using this storage bin.
Pass 1
LAGP.SPGRU

Pass 2
default short char

Pass 3
default short char

160 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


BLOCK_REASON VARCHAR(20) This is the textual description representing SAP short text: Text for blocking reason
_DSC why the stock is being blocked from using Pass 1
this storage bin. Lookup T330T.SPGTX
where T330T.LGNUM = LAGP.LGNUM and
T330T.SPGRU = LAGP.SPGRU and
T330T.SPRAS = LanguageParameter

Pass 2
default short char

Pass 3
default short char

CHANGED_DT DATE This represents the date and time of update Created by the ETL.
of the warehouse record. This field is
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.
CREATED_DT DATE This represents the date and time of Created by the ETL.
creation of the warehouse record. This field
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

DYNAMIC_BIN_I CHAR(1) This is an indicator of whether the bin is Pass 1


ND dynamically allocated or not. IF LAGP.KZDYN = X
then
SET DYNAMIC_BIN_IND = 'Y'
ELSE
SET DYNAMIC_BIN_IND = 'N'

Pass 2
set to default short char

Pass 3
set to default short char

INVENTORY_PR CHAR(1) This is an indicator of whether a storage bin SAP short text: Inventory in preparation
EP_IND has been recorded in system inventory as Pass 1
being counted. An "x" in this field indicates IF LAGP.IVIVO = X
that the storage bin is recorded in a system then
inventory for the purpose of being counted. SET INVENTORY_PREP_IND = 'Y'
This prevents a storage bin from being ELSE
recorded in two different inventory records SET INVENTORY_PREP_IND = 'N'
at the same time. This indicator is
automatically set during the physical Pass 2
inventory process. set to default short char

Pass 3
set to default short char

INV_MTHD_CD VARCHAR(2) Represents the type of physical inventory SAP short text: Inventory method
count to be used, or has already been
taken. Possible values include a "PE" which Pass 1
represents "continuous inventory upon LAGP.KZINV
placement into stock or "ST" represents
"annual inventory", etc. Pass 2
default short char

Pass 3
default short char

Developer Guide 161


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


INV_MTHD_DSC VARCHAR(60) Description of the type of physical inventory Pass 1
count to be used, or has already been DD07T.DDTEXT
taken. Possible values include "continuous where DOMNAME = 'LVS_KZINV' and
inventory upon placement into stock" (PE) DOMVALUE_L = LAGP.KZINV and
or "annual inventory" (ST), etc. DDLANGUAGE = LanguageParameter

Pass 2
default short char

Pass 3
default short char

STORAGE_BIN_ VARCHAR(150) This is the primary key for this entity. This key is composed of:
DIM_ID WAREHOUSE_NO
STORAGE_TYPE_CD
STORAGE_BIN_ID

STORAGE_BIN_I VARCHAR(10) This is a source system identifier of a Pass 1


D storage bin. LAGP.LGPLA

Pass 2
default short char

Pass 3
default short char

STORAGE_BIN_ INTEGER This is a data warehouse system generated System generated unique id.
SID unique identifier for the storage bin.

STORAGE_SECT VARCHAR(3) This is a source system identifier Pass 1


ION_ID representing the storage sections that divide LAGP.LGBER
up a warehouse.
Pass 2
default short char

Pass 3
default short char

STORAGE_SECT VARCHAR(25) This is the textual description representing SAP short text: Name of storage area
ION_NM the storage sections that divide up a Pass 1
warehouse. Lookup T302T.LBERT
where T302T.LGNUM = LAGP.LGNUM and
T302T.LGTYP = LAGP.LGTYP and
T302T.LGBER = LAGP.LGBER and
SPRAS = LanguageParameter

Pass 2
default short char

Pass 3
default short char

STORAGE_TYPE VARCHAR(3) This is a code representing the subdivision Pass 1


_CD of storage bins into groups, for example, LAGP.LGTYP
large bin, small bins.
Pass 2
T301.LGTYP

Pass 3
default short char

162 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


STORAGE_TYPE VARCHAR(25) This is textual description representing the SAP short text: Name of storage type
_DSC subdivision of storage bins into groups, for Pass 1
example, large bin, small bins. T301T.LTYPT where
T301T.LGNUM = LAGP.LGNUM and
T301T.LGTYP = LAGP.LGTYP and
T301T.SPRAS = LanguageParmeter

Pass 2
T301T.LTYPT where
T301T.LGNUM = T301.LGNUM and
T301T.LGTYP = T301.LGTYP and
T301T.SPRAS = LanguageParmeter

Pass 3
default short char

WAREHOUSE_N VARCHAR(25) This is the textual description that SAP short text: Warehouse number
M represents a complex, physical warehouse description
structure within the Warehouse Pass 1
Management System. Lookup T300T.LNUMT
where T300T.LGNUM = LAGP.LGNUM and
T300T.SPRAS = LanguageParameter

Pass 2
Lookup T300T.LNUMT
where T300T.LGNUM = T301.LGNUM and
T300T.SPRAS = LanguageParameter

Pass 3
Lookup T300T.LNUMT
where T300T.LGNUM = T300.LGNUM and
T300T.SPRAS = LanguageParameter

WAREHOUSE_N VARCHAR(3) This is the source system identifier that Pass 1


O represents a complex, physical warehouse LAGP.LGNUM
structure within the Warehouse
Management System. All activities within a Pass 2
warehouse, for example, goods movement T301.LGNUM
and physical inventory, are assigned to a
specific warehouse number. The physical Pass 3
warehouse, where these activities take T300.LGNUM
place, is identified by a warehouse number.

Unit of Measure
Target table name: UNIT_OF_MEASURE
Table type: Conformed dimension
Description: The Unit of Measure dimension contains a list of the units of measure in which the
quantifying measures in the data warehouse are held.

Developer Guide 163


Chapter 3: Data Mart Metadata

Column mapping

Column name Datatype Description Derivation or source mapping


CHANGED_DT DATE This represents the date and time of update ETL generated. Changed_Dt is set to
of the warehouse record. This field is Created_Dt on creation of the row.
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

CREATED_DT DATE This represents the date and time of ETL generated.
creation of the warehouse record. This field
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

EXTERNAL_UOM VARCHAR(3) The language dependant textual value Table: T006A - ASSIGN INTERNAL TO
_DSC displayed by the source system in place of a LANGUAGE-DEPENDENT UNIT
standard code used by the source system Column: MSEH3 - EXTERNAL UNIT OF
for a unit of measure. MEASUREMENT COMMERCIAL FO
Select T006A.MSEH3
from T006A, T006
where T006A.SPRAS = E (language)
and T006A.MSEHI = T006.MSEHI

ISO_UOM_CD VARCHAR(3) This is the International Standards Table: T006


Organization's (ISO) code for this unit of Column: ISOCODE
measure.

ISO_UOM_DSC VARCHAR(25) This is the International Standards Table: T006J, T006


Organization's (ISO) name for this unit of Column: ISOTXT
measure.
Select T006J. ISOTXT
from T006J, T006
Where T006J.ISOCODE = T006.ISOCODE
and T006J.LANGU = LanguageParameter
UNIT_OF_MEAS VARCHAR(3) This is an unique code that identifies the unit Table: T006
URE_CD of measure in the source system. Column: MSEHI

UOM_DIM_CD VARCHAR(6) This is the coded value of type of Table: T006


measurement (i.e.; volume, weight, or Column: DIMID
length) that is being represented by a unit of
measure.

UOM_DIM_DSC VARCHAR(20) This is the textual description of the type of Table: T006T, T006
measurement (i.e.; volume, weight or Column: TXDIM
length) for a unit of measure. Select T006T.TXDIM
from T006T, T006
where T006T.DIMID = T006.DIMID
and SPRAS = LanguageParameter

UOM_DIM_ID VARCHAR(150) This is the primary key for this entity. This key is composed of:
UNIT_OF_MEASURE_CD

UOM_DSC VARCHAR(10) This is the textual description of the unit of Table: T006A, T006
measure. Column: MSEHT
Select T006A.MSEHT
from T006A, T006
where T006.SPRAS = E (language)
and T006A.MSEHI = T006.MSEHI

UOM_SID INTEGER This is a data warehouse system generated System generated unique id.
unique identifier for the unit of measure.

164 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Unit of Measure Conversion


Target table name: UOM_CONVERSION
Table type: Conformed dimension
Description: This table allows the conversion of one Unit of Measure into another.
Column mapping

Column name Datatype Description Derivation or source mapping


BASE_UOM_CD VARCHAR(3) This is the code representing the base unit Table: T006-UNITS OF MEASUREMENT,
of measure used to "triangulate" T006D-DIMENSIONS
conversions that are not supported directly. Column: MSEHI
For example, a conversion is required from select T006.MSEHI
centimeters to feet, but the conversion is not from T006, T006D
directly supported in the source system. where T006.DIMID = T006D.DIMID
However, a conversion from meters to feet is and T006.MSEHI = T006D.MSSIE
supported, and so is one from centimeters
to meters. Choosing meters as the base unit T006-Unit Of Measure
of measure, the two conversion factors are T006D-Dimensions
multiplied to provide a conversion factor that T006.MSEHI -Unit of Measure -Char(3)
allows a direct conversion from centimeters T006D.MSSIE -SI unit - Char(3)
to feet. T006D.DIMID -Dimension key - Char(6)

BASE_UOM_SID INTEGER This is a foreign key to the UNIT OF Table: UNIT_OF_MEASURE


MEASURE entity that is identified by the Column: UOM_SID
relationship name "base UOM" sourced
Perform a lookup on the Unit_Of_Measure
from the Logical Data Model.
table using the BASE_UOM_CD to get the
UOM_SID to populate this field.

BUOM_SI_CNST NUMBER(9,6) This is the constant value used when Table: T006-UNITS OF MEASUREMENT
NT_VAL converting temperatures to the international Column: ADDKO-ADDITIVE CONSTANT
systems (SI) unit Kelvin. The SI unit is the FOR CONVERSION TO SI UNIT
basis for conversion from one unit of
T006.ADDKO where T006.DIMID =
measurement to another.
T006D.DIMID and
Basic equation: Measurement unit =
T006.MSEHI = T006D.MSSIE
(Numerator /Denominator) x SI unit.
Complete equation: Measurement unit =
T006-UNITS OF MEASUREMENT
(Numerator /Denominator * 10**Exponent +
T006D-Dimensions
Constant (temperature only)) * SI unit.
T006.DIMID -Dimension key - Char(6)
T006D.DIMID -Dimension key - Char(6)
T006.MSEHI -Unit of measurement -
Char(3)
T006D.MSSIE - SI unit - Char(3)

BUOM_SI_DNMN NUMBER(10,0) This is the conversion factor for the Table: T006-UNITS OF MEASUREMENT
TR_VAL denominator to SI unit. SI unit represents Column: NENNR-DENOMINATOR FOR
SYSTEME INTERNATIONAL unit and is the CONVERSION INTO SI UNIT
basis for conversion from one unit of T006.NENNR where T006.DIMID =
measurement to another. Basic equation: T006D.DIMID and
Measurement unit = (Numerator T006.MSEHI = T006D.MSSIE
/Denominator) x SI unit. Complete
equation: Measurement unit = (Numerator T006-UNITS OF MEASUREMENT
/Denominator * 10**Exponent + Constant T006D-Dimensions
(temperature only)) * SI unit. T006.DIMID -Dimension key - Char(6)
T006D.DIMID -Dimension key - Char(6)
T006.MSEHI -Unit of measurement -
Char(3)
T006D.MSSIE - SI unit - Char(3)

Developer Guide 165


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


BUOM_SI_EXPN NUMBER(5,0) This is the conversion factor for the base 10 Table: T006-UNITS OF MEASUREMENT
TN_VAL exponent, to SI unit. SI unit represents Column: EXP10-BASE TEN EXPONENT
SYSTEME INTERNATIONAL unit and is the FOR CONVERSION TO SI UNIT
basis for conversion from one unit of
T006.EXP10 where T006.DIMID =
measurement to another. Basic equation:
T006D.DIMID and
Measurement unit = (Numerator
T006.MSEHI = T006D.MSSIE
/Denominator) x SI unit. Complete
equation: Measurement unit =
T006-UNITS OF MEASUREMENT
(Numerator /Denominator * 10**Exponent +
T006D-Dimensions
Constant (temperature only)) * SI unit.
T006.DIMID -Dimension key - Char(6)
T006D.DIMID -Dimension key - Char(6)
T006.MSEHI -Unit of measurement -
Char(3)
T006D.MSSIE - SI unit - Char(3)
BUOM_SI_NMRT NUMBER(10,0) This is the conversion factor for the Table: T006-UNITS OF MEASUREMENT
R_VAL numerator to SI unit. SI unit represents Column: ZAEHL-NUMERATOR FOR
SYSTEME INTERNATIONAL unit and is the CONVERSION TO SI UNIT
basis for conversion from one unit of
T006.ZAEHL where T006.DIMID =
measurement to another. Basic equation:
T006D.DIMID and
Measurement unit = (Numerator
T006.MSEHI = T006D.MSSIE
/Denominator) x SI unit. Complete
equation: Measurement unit = (Numerator
T006-UNITS OF MEASUREMENT
/Denominator * 10**Exponent + Constant
T006D-Dimensions
(temperature only)) * SI unit.
T006.DIMID -Dimension key - Char(6)
T006D.DIMID -Dimension key - Char(6)
T006.MSEHI -Unit of measurement -
Char(3)
T006D.MSSIE - SI unit - Char(3)

CHANGED_DT DATE This represents the date and time of update ETL derived. Changed_Dt is set to
of the warehouse record. This field is Created_Dt on insert of row.
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

CREATED_DT DATE This represents the date and time of ETL derived.
creation of the warehouse record. This field
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

DIMENSION_CD VARCHAR(6) This is a code representing the dimension Table: T006-UNITS OF MEASUREMENT
being measured using the UOM table. For Column: DIMID-DIMENSION KEY
example V = volume, W = mass, L = length,
etc.

DIMENSION_TXT VARCHAR(20) This is a textual description representing the Table: T006T-DIMENSION TEXT
dimension being measured using the UOM Column: TXTDIM-DIMENSION TEXT
table. For example volume, mass, length,
Filter by SPRAS (language code). Join to
temperature etc.
this table using the DIMENSION_KEY_CD
(DIMID).

FROM_UOM_CD VARCHAR(3) This is the code representing the unit of Table: T006-UNITS OF MEASUREMENT
measure being converted from. Column: MSEHI-UNIT OF MEASUREMENT

FROM_UOM_SID INTEGER This is a foreign key to the UNIT OF Table: UNIT_OF_MEASURE


MEASURE entity that is identified by the Column: UOM_SID
relationship name "from UOM" sourced from
Perform a lookup on the Unit_Of_Measure
the Logical Data Model.
table using the FROM_UOM_CD to get the
UOM_SID to populate this field.

166 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


FUOM_SI_CNST NUMBER(9,6) This is the conversion factor for the Table: T006-UNITS OF MEASUREMENT
NT_VAL temperature constant, to SI unit. SI unit Column: ADDKO-ADDITIVE CONSTANT
represents SYSTEME INTERNATIONAL FOR CONVERSION TO SI UNIT
unit and is the basis for conversion from one
T006.ADDKO from t1 where T006.MSEHI
unit of measurement to another. Basic
t1!= T006.MSEHI t2 and T006.DIMID t1 =
equation: Measurement unit = (Numerator
T006.DIMID t2
/Denominator) x SI unit. Complete equation:
Measurement unit = (Numerator
T006-UNITS OF MEASUREMENT
/Denominator * 10**Exponent + Constant
T006.DIMID -Dimension key - Char(6)
(temperature only)) * SI unit.
T006.MSEHI -Unit of measurement -
Char(3)

FUOM_SI_DNMN NUMBER(10,0) This is the conversion factor for the Table: T006-UNITS OF MEASUREMENT
TR_VAL denominator to SI unit. SI unit represents Column: NENNR-DENOMINATOR FOR
SYSTEME INTERNATIONAL unit and is the CONVERSION INTO SI UNIT
basis for conversion from one unit of
T006.NENNR from t1 where T006.MSEHI
measurement to another. Basic equation:
t1!= T006.MSEHI t2 and T006.DIMID t1 =
Measurement unit = (Numerator
T006.DIMID t2
/Denominator) x SI unit. Complete
equation: Measurement unit = (Numerator
T006-UNITS OF MEASUREMENT
/Denominator * 10**Exponent + Constant
T006.DIMID -Dimension key - Char(6)
(temperature only)) * SI unit.
T006.MSEHI -Unit of measurement -
Char(3)

FUOM_SI_EXPN NUMBER(5,0) This is the conversion factor for the base 10 Table: T006-UNITS OF MEASUREMENT
TN_VAL exponent, to SI unit. SI unit represents Column: EXP10-BASE TEN EXPONENT
SYSTEME INTERNATIONAL unit and is the FOR CONVERSION TO SI UNIT
basis for conversion from one unit of T006.EXP10 from t1 where T006.MSEHI
measurement to another. Basic equation: t1!= T006.MSEHI t2 and T006.DIMID t1 =
Measurement unit = (Numerator T006.DIMID t2
/Denominator) x SI unit. Complete
equation: Measurement unit = T006-UNITS OF MEASUREMENT
(Numerator /Denominator * 10**Exponent + T006.DIMID -Dimension key - Char(6)
Constant (temperature only)) * SI unit. T006.MSEHI -Unit of measurement -
Char(3)

FUOM_SI_NMRT NUMBER(10,0) This is the conversion factor for the Table: T006-UNITS OF MEASUREMENT
R_VAL numerator to SI unit. SI unit represents Column: ZAEHL-NUMERATOR FOR
SYSTEME INTERNATIONAL unit and is the CONVERSION TO SI UNIT
basis for conversion from one unit of
T006.ZAEHL from t1 where T006.MSEHI
measurement to another. Basic equation:
t1!= T006.MSEHI t2 and T006.DIMID t1 =
Measurement unit = (Numerator
T006.DIMID t2
/Denominator) x SI unit. Complete
equation: Measurement unit = (Numerator
T006-UNITS OF MEASUREMENT
/Denominator * 10**Exponent + Constant
T006.MSEHI - Unit of Measurement -
(temperature only)) * SI unit.
Char(3)
T006.DIMID - Dimension Key - Char(6)

TO_UOM_CD VARCHAR(3) This is the code representing the unit of Table: T006-UNITS OF MEASUREMENT
measure being converted to. Column: MSEHI - UNIT OF
MEASUREMENT

TO_UOM_SID INTEGER This is a foreign key to the UNIT OF Table: UNIT_OF_MEASURE


MEASURE entity that is identified by the Column: UOM_SID
relationship name "to UOM" sourced from
Perform a lookup on the Unit_Of_Measure
the Logical Data Model.
table using the TO_UOM_CD to get the
UOM_SID to populate this field.

TUOM_SI_CNST NUMBER(9,6) This is the conversion factor for the Table: T006-UNITS OF MEASUREMENT
NT_VAL temperature constant, to SI unit. SI unit Column: ADDKO-ADDITIVE CONSTANT
represents SYSTEME INTERNATIONAL FOR CONVERSION TO SI UNIT
unit and is the basis for conversion from one
T006.ADDKO from t2 where T006.MSEHI
unit of measurement to another. Basic t1!= T006.MSEHI t2 and T006.DIMID t1 =
equation: Measurement unit = (Numerator T006.DIMID t2
/Denominator) x SI unit. Complete equation:
Measurement unit = (Numerator T006-UNITS OF MEASUREMENT
/Denominator * 10**Exponent + Constant T006.DIMID -Dimension key - Char(6)
(temperature only)) * SI unit. T006.MSEHI -Unit of measurement -
Char(3)

Developer Guide 167


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


TUOM_SI_DNMN NUMBER(10,0) This is the conversion factor for the Table: T006-UNITS OF MEASUREMENT
TR_VAL denominator to SI unit. SI unit represents Column: NENNR-DENOMINATOR FOR
SYSTEME INTERNATIONAL unit and is the CONVERSION INTO SI UNIT
basis for conversion from one unit of
T006.NENNR from t2 where T006.MSEHI
measurement to another. Basic equation:
t1!= T006.MSEHI t2 and T006.DIMID t1 =
Measurement unit = (Numerator
T006.DIMID t2
/Denominator) x SI unit. Complete
equation: Measurement unit = (Numerator
T006-UNITS OF MEASUREMENT
/Denominator * 10**Exponent + Constant
T006.DIMID -Dimension key - Char(6)
(temperature only)) * SI unit.
T006.MSEHI -Unit of measurement -
Char(3)

TUOM_SI_EXPN NUMBER(5,0) This is the conversion factor for the base 10 Table: T006-UNITS OF MEASUREMENT
TN_VAL exponent, to SI unit. SI unit represents Column: EXP10-BASE TEN EXPONENT
SYSTEME INTERNATIONAL unit and is the FOR CONVERSION TO SI UNIT
basis for conversion from one unit of
T006.EXP10 from t2 where T006.MSEHI
measurement to another. Basic equation:
t1!= T006.MSEHI t2 and T006.DIMID t1 =
Measurement unit = (Numerator
T006.DIMID t2
/Denominator) x SI unit. Complete
equation: Measurement unit =
T006-UNITS OF MEASUREMENT
(Numerator /Denominator * 10**Exponent +
T006.DIMID -Dimension key - Char(6)
Constant (temperature only)) * SI unit.
T006.MSEHI -Unit of measurement -
Char(3)

TUOM_SI_NMRT NUMBER(10,0) This is the conversion factor for the Table: T006-UNITS OF MEASUREMENT
R_VAL numerator to SI unit. SI unit represents Column: ZAEHL-NUMERATOR FOR
SYSTEME INTERNATIONAL unit and is the CONVERSION TO SI UNIT
basis for conversion from one unit of T006.ZAEHL from t2 where T006.MSEHI
measurement to another. Basic equation:
t1!= T006.MSEHI t2 and T006.DIMID t1 =
Measurement unit = (Numerator
T006.DIMID t2
/Denominator) x SI unit. Complete
equation: Measurement unit = (Numerator
T006-UNITS OF MEASUREMENT
/Denominator * 10**Exponent + Constant
T006.DIMID -Dimension key - Char(6)
(temperature only)) * SI unit.
T006.MSEHI -Unit of measurement -
Char(3)
UOM_CONV_DIM VARCHAR(150) This is the primary key for this entity. This key is composed of:
_ID FROM_UOM_CD
TO_UOM_CD

Valuation
Target table name: VALUATION
Table type: Dimension
Description: This table contains information on the financial value of inventory. The "value of
inventory" (valuation) is an important measure - not just for accounting purposes, but because
unlike the measure "stock quantity," it can be rolled up across materials. If an inventory has 5
liters of paint, 1000 washers and 10000 split pins, it does not make much sense to say that there
are 11005 items of inventory. If paint is valued at $20 a liter, washers at $0.01 each and split
pins at $10 for a box of 1000, it does make sense to say that the overall value of inventory is
$210.
Unlike most other areas where transaction values are summed up to get overall values (e.g.
Account Balance is the cumulative sum of transactions), the current value of stock is not defined
from the sum of goods movement transactions. In the previous example, a drastic reduction in
the price of paint prompted the inventory manager to buy another 5 liters for $5 a liter. If the
transactions were summed up to get the current value, one would get a stock value of $235
($210 + $25). This is not a true representation of the stock value as the drop in the price of paint
has lowered the value of the existing inventory to $160 (based on an unit value of $5 a liter).

168 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

The current value of each material is based on the valuation area and valuation type. The
valuation area is a grouping of plants for valuation purposes. The valuation type is used to
handle split valuation of materials. Materials with the same material number may be valued
differently. For example, if one has new and refurbished motors in stock (both types of motors
have the same material number), the new motors may be valued at $500 each while the
refurbished ones are valued at $350 if they are assigned to different valuation types.
Column mapping

Column name Datatype Description Derivation or source mapping


CHANGED_DT DATE This represents the date and time of update ETL generated
of the warehouse record. This field is
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

CREATED_DT DATE This represents the date and time of ETL generated
creation of the warehouse record. This field
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.
MATERIAL_ID VARCHAR(18) This is the source system unique identifier Table: MBEW
of the material being valuated. Column: MATNR-MATERIAL NUMBER
NK1
SAP short text: Material number

PRICE_CONTRO CHAR(1) This is a code representing which price Table: MBEW


L_CD control to use in valuating stock of a Column: VPRSV-PRICE CONTROL
material. Some values include "Standard INDICATOR
Price", "Moving Average Price", or "Periodic SAP short text:
Unit Price".

PRICE_CONTRO VARCHAR(60) This is a textual description representing Table: DD07T


L_DSC which price control to use in valuating stock Column: DDTEXT-SHORT TEXT FOR
of a material. Some values include FIXED VALUES
"Standard Price", "Moving Average Price",
Lookup DD07T.DDTEXT
or "Periodic Unit Price".
where DD07T.DDLANGUAGE =
LanguageParameter and
DD07T.DOMNAME = 'VPRSV' and
DD07T.DOMVALUE_L = MBEW.VPRSV

VALUATION_ARE VARCHAR(4) This is the code representing the Table: MBEW


A_CD organizational grouping to which the plant Column: BWKEY-VALUATION AREA
belongs for material valuation purposes. A NK2
valuation area may be a single plant, or all SAP short text: Valuation area
plants belonging to a company.
VALUATION_DIM VARCHAR(150) This is the primary key for this entity. This key is composed of:
_ID MATERIAL_ID
VALUATION_AREA_CD
VALUATION_TYPE_CD

VALUATION_SID INTEGER This is a data warehouse system generated System generated unique identifier.
unique identifier for the valuation.

Developer Guide 169


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


VALUATION_TYP VARCHAR(10) This is the code representing the stocks of a Table: MBEW
E_CD material subject to split valuation. The Column: BWTAR-VALUATION TYPE
valuation category determines which
NK3
valuation types are permissible for a
SAP short text: Valuation type
material. If a material is valuated according
to its origin (valuation category H in SAP),
you can define the possible countries of
origin as valuation types.

VLTN_UPRC_AM NUMBER(18,7) This is the unit price of the material in Local Table: SEE SOURCE LOGIC MAPPING
T Currency. Column: SEE SOURCE LOGIC MAPPING
If MBEW.VPRSV = 'S', then
MBEW.STPRS / MBEW.PEINH (standard
pricing)
else
MBEW.VERPR / MBEW.PEINH
.
Note: (If MBEW.PEINH = 0, divide by 1)
.
MBEW.VPRSV CHAR(1)
MBEW.STPRS (standard pricing)
NUMBER(11,2)
MBEW.VERPR NUMBER(11,2)
MBEW.PEINH NUMBER(5,0)

Vendor
Target table name: VENDOR
Table type: Conformed dimension
Description: This is a supplier of materials and/or services to an organization. In Accounts
Payable, the vendor represents an entity that a payment may be made to including expense
payments to employees.
Column mapping

Column name Datatype Description Derivation or source mapping


ABC_CD CHAR(1) This is the code representing the Table: LFM1-VENDOR MASTER RECORD
classification of a material as an A PURCHASING ORGANIZATION
(important - high consumption), B (less Column: LFABC-ABC INDICATOR
important - medium consumption), or C
(relatively unimportant, low consumption)
part. "A" vendors are those responsible for
your companies greatest expenditure. This
classification process is known as the
Activity Based Cost analysis.

CHANGED_DT DATE This represents the date and time of update ETL generated. Changed_dt is set to
of the warehouse record. This field is Created_dt on insert of row.
populated for records that have been
updated since the last extract. The time of
extract (the system date and time at which
the extract from the source system was
started) is stored in this field. This field is
populated by the ETL program.

CITY_NM VARCHAR(35) This is the textual description of the city Table: LFA1-VENDOR MASTER
where the vendor is located. (GENERAL SECTION)
Column: ORT01-CITY

COMPANY_CD VARCHAR(4) This is the code representing the company, Table: LFB1-VENDOR MASTER
an organizational unit used for the purposes (COMPANY CODE)
of external accounting. Column: BUKRS

COUNTRY_CD VARCHAR(3) This is the code representing the country Table: LFA1-VENDOR MASTER
where the vendor is located. Column: LAND1-COUNTRY KEY

170 Cognos Analytic Applications Inventory Analysis for SAP(R)


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


COUNTRY_NM VARCHAR(15) This is the textual description of the country Table: T005T-COUNTRY NAMES
where the vendor is located. Column: LANDX-COUNTRY NAME
Lookup to T005T using Country Code equal
to LAND1 and filtering by SPRAS (language
parameter).
CREATED_DT DATE This represents the date and time of ETL generated.
creation of the warehouse record. This field
is populated for newly inserted records
since the last extract. The time of extract
(the system date and time at which the
extract from the source system was started)
is stored in this field. This field is populated
by the ETL program.

DISTRICT_NM VARCHAR(35) This is the name of the district where the Table: LFA1-VENDOR MASTER
vendor is located. It is appended to the city (GENERAL SECTION)
for providing further address detail. Column: ORT02-DISTRICT

HOLD_PAYMENT CHAR(1) An indicator that specifies that Table: LFB1-VENDOR MASTER


_IND vouchers/invoices are to be held for (COMPANY CODE)
payment for this vendor. Column: ZAHLS-BLOCK KEY FOR
PAYMENT
If ZAHLS is set to ’A’
then
set to ’Y’
else
set to ’N’

Future enhancement (If more information is


required on the type of hold):
lookup to T008
where ZAHLS = ’A’

If Char1 is set then Indicator: Change in


Payment Proposal Permitted?
if XOZP is set then Indicator: Blocked for
manual payments
If XNCHG is set then Payment block, not
changeable

INDUSTRY_CD VARCHAR(4) This is the code representing the industry Table: LFA1-VENDOR MASTER
that the vendor belongs to. Examples (GENERAL SECTION)
include trade, banking, manufacturing, Column: BRSCH-INDUSTRY KEY
health care, media, etc.

INDUSTRY_DSC VARCHAR(20) This is the textual description of the industry Table: T016T-INDUSTRY NAMES
that the vendor belongs to. Examples Column: BRTXT-DESCRIPTION OF THE
include trade, banking, manufacturing, INDUSTRY KEY
health care, media, etc. Lookup to T016T using Industry Code equal
to BRSCH and filtering by SPRAS
(language parameter).

PLAN_GROUP_C VARCHAR(10) This is the code representing the Table: LFB1-VENDOR MASTER
D classification of Vendors (and customers) (COMPANY CODE)
according to accounting rules, domestic, Column: FDGRV-PLANNING GROUP
foreign, high risk.

PLAN_GROUP_N VARCHAR(30) This is the textual description of the Table: T035T-PLANNING GROUP TEXTS
M classification of Vendors (and customers) Column: TEXTL-DESCRIPTION
according to accounting rules, domestic, Lookup on T035T using the Plan Group
foreign, high risk. Code equal to the GRUPP field and filtering
by SPRAS (language code)

POSTAL_CD VARCHAR(10) This is the postal code associated with the Table: LFA1-VENDOR MASTER
address of the vendor. (GENERAL SECTION)
Column: PSTLZ-POSTAL CODE

PURCHASE_OR VARCHAR(4) This is the code representing the purchasing Table: LFM1-VENDOR MASTER RECORD
G_CD organization with which this vendor is PURCHASING ORGANIZATION
associated. Column: EKORG-PURCHASING
ORGANIZATION

Developer Guide 171


Chapter 3: Data Mart Metadata

Column name Datatype Description Derivation or source mapping


REGION_CD VARCHAR(3) This is the code representing the region Table: LFA1-VENDOR MASTER
where the vendor is located. The relevant (GENERAL SECTION)
meaning depends on the country. In the Column: REGIO-REGION (STATE,
USA the region would represent the state, in PROVINCE, COUNTY)
Canada the province, in Switzerland the
canton, in UK the county, etc.

REGION_NM VARCHAR(20) This is the textual description of the region Table: T005U-TAXES: REGION KEY:
where the vendor is located. The relevant TEXTS
meaning depends on the country. In the Column: BEZEI-DESCRIPTION
USA the region would represent the state, in SELECT DISTINCT NULLIF("BLAND",’’)
Canada the province, in Switzerland the REGION_CD,
canton, in UK the county, etc. NULLIF("BEZEI",’’) REGION_NM

FROM "T005U", "LFA1"


WHERE "T005U"."SPRAS" =’EN’ AND
"T005U"."LAND1" = "LFA1"."LAND1"
AND "LFA1"."REGIO" = "T005U"."BLAND"

VENDOR_ACCO VARCHAR(10) This is the source system account number Table: LFA1-VENDOR MASTER
UNT_NO of the vendor (creditor). (GENERAL SECTION)
Column: LIFNR-ACCOUNT NUMBER OF
VENDOR OR CREDITOR

VENDOR_DIM_ID VARCHAR(150) This is the primary key for this entity. This key is composed of:
VENDOR_ACCOUNT_NO
COMPANY_CD
PURCHASE_ORG_CD

VENDOR_LEVEL VARCHAR(35) This is the name of the level 1 to 5 parent of Table: VENDORHIERARCHY
1_NM to a Vendor. Vendors are part of a hierarchy, Column: LEVEL1_VENDOR_NM to
VENDOR_LEVEL where Vendors can belong to various levels LEVEL4_VENDOR_NM
4_NM in this hierarchy. This attribute identifies the
highest level Vendor in the hierarchy related
to this Vendor. If the Vendor itself belongs to
this level, the levels below it will be null or
have the Vendor’s name repeated in them.
VENDOR_NM VARCHAR(35) This is the name of the vendor. Table: LFA1-VENDOR MASTER
(GENERAL SECTION)
Column: NAME1-NAME 1

VENDOR_SHOR VARCHAR(10) This is the short or "significant" name of the Table: LFA1-VENDOR MASTER
T_NM vendor and is used for searches. (GENERAL SECTION)
Column: SORTL-SORT FIELD

VENDOR_SID INTEGER This is a data warehouse system generated System generated unique identifier.
unique identifier for the vendor.

VENDOR_TYPE_ VARCHAR(4) A code that classifies the vendor as an Table: LFA1-VENDOR MASTER
CD Employee, Plant, Supplier, etc. (GENERAL SECTION)
Column: KTOKK-VENDOR ACCOUNT
GROUP

VENDOR_TYPE_ VARCHAR(30) A textual description of the vendor type Table: T077Y-ACCOUNT GROUP NAMES
DSC code. Column: TXT30-ACCOUNT GROUP NAME
Lookup on T077Y using the Vendor Type Cd
(KTOKK from LFA1) and SPRAS equal to
language parameter.

VNDR_HIER_LEV SMALLINT This is the level number of the Vendor in the Table: VENDORHIERARCHY
EL_NO hierarchy. For example, if the Vendor is at Column: HIERARCHY_LEVEL_NO
level three of the hierarchy, the Vendor has a
parent (in level 2) and a grandparent (in
level 1). Level four is unused (the Vendor
may be repeated in level four, or it may be
left as null).

172 Cognos Analytic Applications Inventory Analysis for SAP(R)


Index

B metadata tables (cont'd)


Batch, 89
build logic Business Area, 92
dimensions, 7 Customer, 93
facts, 7 Financial Currency Conversion, 101
Build Relationships, 8 Material, 103
builds Material Movement Detail, 108
descriptions, 7-8 Material Movement Document, 114
Material Movement Document Class, 116
C Material Reservation Detail, 120
Material Reservation Document, 124
copyright, 2 Material Storage, 126
Physical Inventory Detail, 129
D Physical Inventory Document, 133
Plant, 134
document
Stock Class, 138
version, 2
Stock Opening Balance, 140
Stock Overview, 148
E Stock Usage Forecast, 154
entity relationship diagrams Stock Usage Forecast Method, 156
All Dimensions, 83-84 Stockout, 157
Material Movement, 78 Storage Bin, 158
Material Reservation, 80 Unit of Measure, 163
Physical Inventory, 79 Unit of Measure Conversion, 165
Stock Overview, 81 Valuation, 168
Stock Usage Forecast, 82 Vendor, 170

J P
JobStream details product
All Time, 9 version, 2
Batch, 13
Business Area, 16 V
Customer, 18
version
Financial Currency Conversion, 24
product, 2
Material, 28
Material Movement Activity, 31
Material Movement Document Class, 34
Material Reservation, 37
Material Storage, 40
Physical Inventory, 42
Plant, 44
Re-Ranking, 48
Stock Class, 50
Stock Overview, 54
Stock Usage Forecast, 62
Stock Usage Forecast Method, 64
Storage Bin, 66
Unit of Measure, 68
Valuation, 71
Vendor, 73
JobStreams
descriptions, 7-8

M
metadata tables
All Time, 85

Developer Guide 173


Index

174 Cognos Analytic Applications Inventory Analysis for SAP(R)

You might also like