To create a time dependent master data that keep track of changes in the Article sell price (Current as well as historical) on daily basis from Material master Table.
Step1: Create a Master data with the required attributes:
Go to T.Code: RSD1
Put the Info Object Name and Click on Create Button.
Assign the Info Area to this Master data and if you want this both as a Master Data and Text, Tick both the check box.
Now go to Attribute Tab and assign the attributes that you want to add in the master data.
Attributes that you want as Time dependent, use the check box time dependent attributes.
Now Time Dependent Master Data is ready.
Step2: Changes in DS as per the requirement:
Source of this Master data is 0ART_PLANT_ATTR where we have appended the System date and based on that date we need to distribute the Sell Price and some other kefigures data in Master data on daily basis.
Populating System Date in the DS 0ART_PLANT_ATTR:
DATA: lt_t_data TYPE STANDARD TABLE OF biw_marc_s,
lv_date TYPE sy–datum.
FIELD-SYMBOLS: <lfs_s_data> TYPE biw_marc_s.
lt_t_data = c_t_data.
IF lt_t_data IS NOT INITIAL.
lv_date = sy–datum.
LOOP AT lt_t_data ASSIGNING <lfs_s_data>.
<lfs_s_data>–zz_udate = lv_date.
c_t_data = lt_t_data.
Step 3: Transformation with Source Data Source:
Now Map the Data Source to Master data:
Map Current Date with DATE FROM (0DATEFROM) and Put the DATE TO (0DATETO) as 12/31/9999. And rest you can map as per your requirement.
Step 4: Self Transformation of Master Data:
Now do the self-transformation of ZARTCLE Master Data with the ZARTICLE if you want to track the previous dates sell price as well. As for example if Price of an Article on 31/10/2013 is 200 but on 2/11/2013 its changed to 250, and you want to have all the entry in the master data based on different date like from 01/01/1000 to 30/10/2013 price will be shown as 200 and from 31/10/2013 to 01/11/2013 price will be shown in the master data is 200 and from 2/11/2013 to 31/12/9999 price will be 250.
Here self-transformation comes into picture, if you will do the self-transformation, then Sell price for date 01/01/1000 to 30/10/2013 will get updated and rest will get updated as per the functionality of time dependent master data.
Only map the key fields and Time dependent attributes and remove the mapping of rest of the fields.
In Transformation mapping, map DATEFROM to DATETO and put the DATEFROM as 01/01/1000 write a characteristics routine in 0DATETO where put the below code in the transformation:
When you do the full load first time, load data into master data from Data Source and then after doing full load from source DS, run the Full Load DTP of Self Transformation Master data (One Time activity) and afterwards start the delta load into master data.
You can see the distributed data in ZARTICLE on the basis of different date:
Here you can see that price for a particular Article is getting updated for the Period 10/01/1000 to 07/10/2013 as 20 because the first entry for that Article is on 07/11/2013 and sell price is 20 and rest is getting updated as per the functionality of time dependent master data.