Oldschool abap…
DATA: BEGIN OF i0008,
lgart LIKE p0008-lga01,
betrg LIKE p0008-bet01,
anzhl LIKE p0008-anz01,
eitxt LIKE p0008-ein01,
opken LIKE p0008-opk01,
indbw LIKE p0008-ind01,
END OF i0008.
rp-provide-from-last p0008 space pn-begda pn-endda.
DO 40 TIMES
VARYING i0008-lgart FROM p0008-lga01 NEXT p0008-lga02
VARYING i0008-betrg FROM p0008-bet01 NEXT p0008-bet02
VARYING i0008-anzhl FROM p0008-anz01 NEXT p0008-anz02
VARYING i0008-eitxt FROM p0008-ein01 NEXT p0008-ein02
VARYING i0008-opken FROM p0008-opk01 NEXT p0008-opk02
VARYING i0008-indbw FROM p0008-ind01 NEXT p0008-ind02.
IF i0008-lgart = '2001'.
EXIT.
ENDIF.
ENDDO.