Hi Experts,
I am trying to do a master data lookup. My requirement is to load the data in HCM cube 0PABN_C01(Benefits) cube but some of the fields are not coming from the source 0HR_PA_BN_1. I am trying to do a lookup on 0Employee for (Person, Job, OrgUnit, etc..) that have all the missing fields with key Employee from both sources.
Here is the code that i have tried in start routine-Transformation Routine (Person, Job)
Start Routine:
Types : Begin of ZBenefits,
Employee type /BI0/OIEMPLOYEE,
Person type /BI0/OIPERSON,
Job type /BI0/OIJOB,
Orgunit type /BI0/OIORGUNIT
end of ZBenefits.
data: itab_emp type STANDARD table of /BI0/QEMPLOYEE.
data : wa_emp type /BI0/QEMPLOYEE.
Select Employee Person Job Orgunit from /BI0/QEMPLOYEE
into table itab_emp
For all entries in SOURCE_PACKAGE
where Employee = SOURCE_PACKAGE-PERNR
and objvers = 'M'.
Transformation Routine:
Loop at itab_emp into wa_emp.
* where person = SOURCE_FIELDS-pernr.
read table itab_emp into wa_emp with key person = SOURCE_FIELDS-pernr.
if sy-subrc = 0.
RESULT = wa_emp-person.
endif.
clear wa_emp-person.
*clear RESULT.
endloop.
Note: The Loop becomes indefinite but if i use only read statement it does not scan the full table rows it scanned only 2 rows. I have also tried with End Routine but not able to load the data.
End Routine:
LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.
read table itab_emp into wa_emp with key EMPLOYEE =
<RESULT_FIELDS>-EMPLOYEE.
IF SY-SUBRC = 0.
MOVE: WA_EMP-PERSON TO <RESULT_FIELDS>-PERSON,
WA_EMP-JOB TO <RESULT_FIELDS>-JOB.
ENDIF.
ENDLOOP.
Please help me out to map the correct data. I will appreciate all kind of ideas.
Thanks in advance.