2008 Jun 17 3:04 PM
Hi,
The following code is taking more time to execute...
Kindly assist..
check wagetype selection
REFRESH it_p8wage.
CLEAR: it_p8wage, wa_p8wage, p8wage_flag.
LOOP AT p0008.
DO 20 TIMES
VARYING wa_p8wage-lgart FROM p0008-lga01 NEXT p0008-lga02
VARYING wa_p8wage-betrg FROM p0008-bet01 NEXT p0008-bet02.
IF wa_p8wage-lgart IN lgartahm
AND NOT wa_p8wage IS INITIAL.
MOVE: 'X' TO p8wage_flag,
p0008-waers TO wa_p8wage-waers.
INSERT wa_p8wage INTO TABLE it_p8wage.
CLEAR wa_p8wage.
ENDIF.
ENDDO.
ENDLOOP.
no wagetype mathing found
IF p8wage_flag IS INITIAL.
READ TABLE lgartahm.
IF sy-subrc EQ 0.
REJECT.
ENDIF.
ENDIF.
2008 Jun 17 3:08 PM
set a breakpoint in your code and find out where the bottle neck is.
2008 Jun 17 3:19 PM
Hi,
For each end every employye there may not be data for all the 20 wage types from lga01 bet01..................lga20 and bet20.
in your code it is better to exit the do loop IF wa_p8wage-lgart IS INITIAL rather than looping 20 times even there is no data.
Because wage types will be assigned to an employee in the same sequence form 1,2......20
if the lga03 is initial there there will not be data for lga04 to lga 20.
This may not be the excat reason for slow response time of ur report but may be usefull.
look at the below code for the chane i suggested
LOOP AT p0008.
DO 20 TIMES
VARYING wa_p8wage-lgart FROM p0008-lga01 NEXT p0008-lga02
VARYING wa_p8wage-betrg FROM p0008-bet01 NEXT p0008-bet02.
IF wa_p8wage-lgart IS INITIAL.
exit. " this will exit the do loop
ENDIF.
IF wa_p8wage-lgart IN lgartahm
AND NOT wa_p8wage IS INITIAL.
MOVE: 'X' TO p8wage_flag,
p0008-waers TO wa_p8wage-waers.
INSERT wa_p8wage INTO TABLE it_p8wage.
CLEAR wa_p8wage.
ENDIF.
ENDDO.
ENDLOOP.