cancel
Showing results for 
Search instead for 
Did you mean: 

infotype PA0001.

Former Member
0 Kudos
119

hi all,

I am developing a report but i m facing some performance issues.

1. I have used logical database PNP and i am using loop at P0001 to get data after Get Pernr. Now i m having an internal table, itab_CSKS, that contains a list of cost centers. I want to fetch only those records from PA0001 that have the value of cost centre in itab_CSKS. That means all the values that i fetch should have cost centre equals to one if entry of itab_CSKS. I am providing you with the code i m having rite now. Please see if you can help writing me this code.

Get pernr.

loop at P0001 where bukrs = Pnpbukrs-low.

Move P0001-pernr to itab_hr-pernr.

*Move P0000-stat2 to itab_hr-stat2.

Move P0001-Kostl to itab_hr-kostl.

Move P0001-begda to itab_hr-begda.

Move P0001-endda to itab_hr-endda.

Move P0001-bukrs to itab_hr-bukrs.

append itab_hr.

*endif.

*EndProvide.

endloop.

end-of-selection.

thanks and regards,

Reeena.

Accepted Solutions (1)

Accepted Solutions (1)

suresh_datti
Active Contributor
0 Kudos

Pl Make these changes to ur code..


sort  itab_CSKS by kostl.
Get pernr.
loop at P0001 where bukrs = Pnpbukrs-low.
read table  itab_CSKS with key kostl = p0001-kostl
    binary search.
check sy-subrc eq 0.
Move P0001-pernr to itab_hr-pernr.
Move P0001-Kostl to itab_hr-kostl.
Move P0001-begda to itab_hr-begda.
Move P0001-endda to itab_hr-endda.
Move P0001-bukrs to itab_hr-bukrs.
append itab_hr.
endloop.
end-of-selection

~Suresh

Former Member
0 Kudos

thank you suresh..

Answers (0)