Buy

Buy

List of Posts

Get this widget
To get notifications, Please like our Facebook Page >>>>>>

Use Search box to find a topic in this Blog!!!

Routine Lesson 1


Scenario: the data source does not have division and we need to derive it from material which exists in the datasource. Populate the cube with the division.
Solution:
Division needs to be derived from material as division is not retrieved from the datasource and the division needs to be derived from material using the /BI0/PMATERIAL table. wa_th_material is an internal table derived from a work area which is wa_material and wa_material is a work area derived from the structure t_material
since t_material has material and division as the 2 fields and this is read into a work area wa_material using a key which is the -material i.e. the material that is loaded into the end routine of the transformation.
Start Routine: use a SELECT statement to load the internal table.
CODE SNIPPET:
if wa_th_material[] is initial.
*Load Division by material
Select material division
into table wa_th_material
from /BI0/PMATERIAL
where objvers = ‘A’.
End Routine: use a READ statement and read the internal table populated in the start routine into a work area using a KEY. If data is found make the data found equal to the end routine field.
CODE SNIPPET:
read table wa_th_material
into wa_material
with table key material = -material.
if sy-subrc = 0.
-division = wa_material-division.
DATA DEFINITION:
Data:
BEGIN OF t_material,
material TYPE /BI0/OImaterial,
division TYPE /BI0/OIdivision,
END OF t_material,
data: wa_th_material TYPE HASHED TABLE OF t_material WITH UNIQUE KEY material,
data: wa_material type t_material,

1 comment:

Note

This blog is solely for the purpose of getting educated in SAP. This blog does not encourage distribution of SAP hold copyright and any other publication and/or materials bearing SAP mark. If you find any copyright materials, please mail me so I can remove them. This blog is not in association with SAP.

ALL Posts

Get this widget