Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

do 20 times varying

hi all,

can anyone plz tell me the use of Varying? tell me with example. actually i m using statement like below but i m getting only 0 values.--

DATA: BEGIN OF WAGETYPES,

LGA LIKE P0008-LGA01,

BET LIKE P0008-BET01,

END OF WAGETYPES.

DO 20 TIMES VARYING WAGETYPES

FROM P0008-LGA01

NEXT P0008-LGA02.

IF WAGETYPES-LGA IS INITIAL.

EXIT.

endif.

DO 15 TIMES VARYING WAGETYPES

FROM P0589-LGA01

NEXT P0589-LGA02.

IF WAGETYPES-LGA IS INITIAL.

EXIT.

endif.

problem is that i m not getting any value in output only showing 0 value. can anyone please solve this issue?

regards Nitin.

Tags:
Former Member
Former Member replied

hi,

check the following code.

RP_PROVIDE_FROM_LAST P0589 SPACE PN-BEGDA PN-ENDDA.

DO 15 TIMES
VARYING WAGETYPES-LGA
FROM P0589-LGA01
NEXT P0589-LGA02
VARYING WAGETYPES-BET
FROM P0008-BET01                "instead of P0008, it should be P0589
NEXT P0008-BET02.                "instead of P0008, it should be P0589

Edited by: vikram shah on Sep 22, 2008 12:28 PM

added formatting to code.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question