12-14-2013 10:41 PM
Hi Friends,
The Deep Structure /1PYXXFO/SAP_PAYSLIP_KSA is found in the debug mode and I need to fetch the value of Personal number (PERNR).
The path is as follows for that Deep structure.
STAR_PAY_PERS_STRUCT-EMPLOYEE_KEY-PERSONNEL_NUMBER
Please share your expertise.
The above screen shot is taken from the debug mode. In which the structure Contains structure and contains a table then structure. and i want to capture the last field "personal number".
thanks.
12-31-2013 10:19 AM
Thanks friends for the above help, which was indeed helpful.
The solution looks like this. This code is working fine.
data : it_STAR_PAY_PERS_STRUCT type table of /1PYXXFO/ZPAYSLIP_KSA____U0011.
data : it1_STAR_PAY_PERS_STRUCT type TABLE OF /1PYXXFO/ZPAYSLIP_KSA____M0011.
data : wa2_STAR_PAY_PERS_STRUCT type /1PYXXFO/ZPAYSLIP_KSA____M0011.
data : st_employee_key type /1PYXXFO/ZPAYSLIP_KSA____K0005.
data : v_employee_key type /1PYXXFO/ZPAYSLIP_KSA____K0005.
data : v_personal_num type char8.
append hrdata-STAR_PAY_PERS_STRUCT[] to it_STAR_PAY_PERS_STRUCT.
loop at it_STAR_PAY_PERS_STRUCT into it1_STAR_PAY_PERS_STRUCT[].
loop at it1_STAR_PAY_PERS_STRUCT[] into wa2_STAR_PAY_PERS_STRUCT.
st_employee_key = wa2_STAR_PAY_PERS_STRUCT-employee_key.
v_personal_num = st_employee_key-PERSONNEL_NUMBER.
exit.
ENDLOOP.
exit.
ENDLOOP
12-16-2013 6:23 AM
Hi,
If you want to use in write statement then, code it as follows.
Write : ST_HRDATA-STAR_PAY_PERS_STRUCT-EMPLOYEE_KEY-PERSONNEL_NUMBER.
Regards.
12-16-2013 6:51 AM
Hello Obaid,
you can access like this,
Read statement over ST_HRDATA-STAR_PAY_PERS_STRUCT-EMPLOYEE_KEY table into another work area say LWA_EKEY.
PERNR = LWA_EKEY-PERSONNEL_NUMBER.
there is internal table exist in the deep structure so we cant directly make a statement as you suggested.
Please correct me if I am wrong anywhere.
Thanks and Regards,
Bhaskar
12-16-2013 7:58 AM
Hi bhaskar,
If employee_key is an internal table then yes you are right. But in the screen shot it can be seen that employee_key is a flat structure so i suggested it like this.
So it depends on Rehman what he wants.
Regards.
12-16-2013 10:58 AM
Hi Amranatha,
It was my mistake the table is STAR_PAY_PERS_STRUCT.
We need to loop over this and get the required one into a work area.
Thanks,
bhaskar
12-16-2013 7:18 AM
Create LWA_STRUCT work area of type STAR_PAY_PERS_STRUCT
Create LWA_EMPLY work are of type EMPLOYEE_KEY
Loop at ST_HRDATA-STAR_PAY_PERS_STRUCT into LWA_STRUCT.
LWA_EMPLYOEE = LWA_STRUCT-EMPLOYEE_KEY
"Use LWA_EMPLOYEE
Endloop.
12-17-2013 6:52 PM
Hi Obaid,
You can try this:
DATA: | ls_star_pay_pers_struct LIKE LINE OF st_hrdata-star_pay_pers_struct, |
ls_employee LIKE st_hrdata-star_pay_pers_struct-employee_key.
LOOP AT st_hrdata-star_pay_pers_struct INTO ls_start_pay_pers_struct. |
WRITE ls_start_pay_pers_struct-employee_key-personnel_number.
"or
ls_employee = ls_start_pay_pers_struct-employee_key.
WRITE ls_employee-personnel_number.
ENDLOOP.
12-31-2013 10:19 AM
Thanks friends for the above help, which was indeed helpful.
The solution looks like this. This code is working fine.
data : it_STAR_PAY_PERS_STRUCT type table of /1PYXXFO/ZPAYSLIP_KSA____U0011.
data : it1_STAR_PAY_PERS_STRUCT type TABLE OF /1PYXXFO/ZPAYSLIP_KSA____M0011.
data : wa2_STAR_PAY_PERS_STRUCT type /1PYXXFO/ZPAYSLIP_KSA____M0011.
data : st_employee_key type /1PYXXFO/ZPAYSLIP_KSA____K0005.
data : v_employee_key type /1PYXXFO/ZPAYSLIP_KSA____K0005.
data : v_personal_num type char8.
append hrdata-STAR_PAY_PERS_STRUCT[] to it_STAR_PAY_PERS_STRUCT.
loop at it_STAR_PAY_PERS_STRUCT into it1_STAR_PAY_PERS_STRUCT[].
loop at it1_STAR_PAY_PERS_STRUCT[] into wa2_STAR_PAY_PERS_STRUCT.
st_employee_key = wa2_STAR_PAY_PERS_STRUCT-employee_key.
v_personal_num = st_employee_key-PERSONNEL_NUMBER.
exit.
ENDLOOP.
exit.
ENDLOOP