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: 

SAP query HR

anupam_srivastava2
Participant
0 Kudos
81

Hi All

I am trying to fetch records for wage type range between 8100 to 8214 for a particular finacial period .

I have written this provide statement.

e.g say a emp A which has 3 wage types 8110, 8150 , 8214 which are valid for the current period.

but this provide returns only one 8110. any idea how can I return all the three wage types.

provide * into wa_p0002 from p0002

  • into wa_p0014 from p0014 between pn-begda and pn-endda

where p0014-lgart between s_lgart-low and s_lgart-high.

rgds

C

8 REPLIES 8

Former Member
0 Kudos
42

Replace Between by IN.

where p0014-lgart IN s_lgart.

Edited by: harsh bhalla on Mar 27, 2009 4:53 PM

amit_khare
Active Contributor
0 Kudos
42

provide * into wa_p0002 from p0002

  • into wa_p0014 from p0014 between pn-begda and pn-endda

where p0014-lgart IN s_lgart.

0 Kudos
42

I tried using

provide * into wa_p0002 from p0002

  • into wa_p0014 from p0014 between pn-begda and pn-endda

where p0014-lgart in s_lgart.

but still not working returns only one record.

0 Kudos
42

As Pradhu mention use Internal Table in place of wor area.

0 Kudos
42

Hi Amit

I tried using internal table but it doesnt works, thing is I am getting the value between provide and end provide so it doesnt makes diff if I use WA or internal table.

what do you suggest, how we can extract all the relevant wagetype for particular pernr.

0 Kudos
42

used function CU_READ_RGDIR,

read table rgdir into wa_rgdir with key srtza = 'A'

ABKRS = 'GM'

fpbeg = pn-begda fpend = pn-endda.

function PYXX_READ_PAYROLL_RESULT

loop at payroll-inter-rt

Former Member
0 Kudos
42

hi ,

try this...

write the statment between provide , end provide.


provide * into wa_p0002 from p0002
* into wa_p0014 from p0014 between pn-begda and pn-endda
where p0014-lgart between s_lgart-low and s_lgart-high.
append wa_p0014 to t_poo14.

endprovide.

you are using work are..

always work area contains one field.

Regards,

Prabhudas

anupam_srivastava2
Participant
0 Kudos
42

thanks