Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Deep structure /1PYXXFO/SAP_PAYSLIP_KSA, How to fetch PERNR Field.

Former Member
0 Kudos

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.


1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

7 REPLIES 7

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

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.

0 Kudos

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

nabheetscn
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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