Application Development and Automation 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: 
Read only

Wage type problem.

Former Member
0 Likes
466

Hi All,

I have problem for pick the wage type in pa0008

Here i took two fields ,LGART BET01.

i want particular LGART = 1001,1008 1500.

i am using do 20 times varying . but thing is what i mention lgart = 1001 .it's pick the data but others also is coming.

here what iam writen code i past it here plz help me .

REPORT ZKK .

TABLES:PERNR.

INFOTYPES:0008,0001,0014.

DATA:IT_P0008 LIKE P0008 OCCURS 0 WITH HEADER LINE.

select-options:spernr for p0008-pernr.

START-OF-SELECTION.

select pernr

lga01

bet01

from pa0008

into CORRESPONDING FIELDS OF table it_p0008

where pernr in spernr.

if sy-subrc ne 0.

message E000(1) WITH 'NO DATA'.

endif.

DATA:LGART TYPE LGART,

BETRT TYPE P0008-BET01.

DO 20 TIMES VARYING lgart FROM IT_P0008-lga01 NEXT IT_p0008-lga02

VARYING betrt FROM IT_p0008-bet01 NEXT IT_p0008-bet02.

case LGART.

when '1001'. " HOURLY RATE.

write:/ IT_p0008-PERNR,IT_P0008-BET01.

when '1008'. " HOURLY RATE.

write:/ IT_p0008-PERNR,IT_P0008-BET01.

when '1500'. " RED CIRCULE HOURLY RATE.

write:/ it_p0008-PERNR,IT_P0008-BET01.

endcase.

ENDDO.

LOOP AT IT_P0008.

write:/ it_p0008-pernr,it_p0008-lga01,it_p0008-bet01.

ENDLOOP.

Regards,

Kumar.

3 REPLIES 3
Read only

Former Member
0 Likes
437

hello Krishna,

u can take the values from the payroll result fn mod,, then loop it

Read only

Former Member
0 Likes
437

Hi

Why you are selecting the first Wage Type fields lga01 bet01 with select statement from PA0008?

Use the following simple code:

REPORT RPABAP06.

TABLES:PERNR.

INFOTYPES: 0008.

DATA: BEGIN OF WAGETYPES,

LGA LIKE P0008-LGA01,

BET LIKE P0008-BET01,

ANZ LIKE P0008-ANZ01,

EIN LIKE P0008-EIN01,

OPK LIKE P0008-OPK01,

END OF WAGETYPES.

data itab like wagetypes occurs 0 with header line.

GET PERNR.

RP_PROVIDE_FROM_LAST P0008 SPACE PN-BEGDA PN-ENDDA.

DO 20 TIMES VARYING WAGETYPES

FROM P0008-LGA01

NEXT P0008-LGA02.

case WAGETYPES-LGA .

when '1001'.

move-corresponding wagetypes to ITAB.

when '1008'.

move-corresponding wagetypes to ITAB.

when '1500'.

move-corresponding wagetypes to ITAB.

ENDIF.

append ITAB.

clear ITAB.

ENDDO.

display the ITAB as per your requirement

reward points

regards

Anji

Read only

Former Member
0 Likes
437

Hi kirshna,

1. First of all use select *

2. We are using wrong variables for WRITE, inside DO.

write:/ IT_p0008-PERNR,IT_P0008-BET01.

It should be

<b>write:/ lgart, betrt.</b>

(Bcos, inside DO, the values come in this field in dynamic fashion)

regards,

amit m.