start routine on 0equipment
we are having a transformation which runs from a datasource(source) to DSO(Target)....The source has a filed called TIDNR wich is a Technical Identification number ..and the target DSO has 0equipment which needs to be populated using a start routine..
The logic is TIDNR is an attribute for masterdata info object 0equipment .. now i need to populate 0equipment(in DSO) looking up against masterdata on TIDNR .
Can you please suggest me the code as iam confused from where i should be reading masterdata for 0equipment from? i mean we have various tables in Masterdata/Texts tab of the masterdata infoobject(like M table,Ptable,Qtable.Ytable)
Krishna Chaitanya replied
Please follow the below steps.
1. Fetch the data from the Ptable of the info object 0equipment in to an internal table.
2. Sort the internal table on TIDNR.
3. If source_package is not initial.
loop into source_package into wa_spkg.
i_idx = sy-tabix.
read table itab(0equiment) into wa_itab with key TIDNR = wa_spkg-TIDNR
if sy-subrc = 0.
wa_spkg-0equipment = wa_itab-0equipment.
modify source_package from wa_spkg index l_idx transporting 0equipment.
clear: wa_spkg, wa_itab.
So make sure before going to paste this code that you need to declare the data declaration part along with internal tables and work areas.
Note:- Please change the field names as per your data.