Code: Alles auswählen.
TYPES: BEGIN OF abart, " Detail-Liste
pernr LIKE pernr-pernr,
ename LIKE p0001-ename,
infty LIKE p2001-infty,
subty LIKE p2001-subty,
atext LIKE t554t-atext,
begda LIKE p2001-begda,
endda LIKE p2001-endda,
tage(5) TYPE p DECIMALS 2,
END OF abart.
*
DATA: abart TYPE TABLE OF abart WITH HEADER LINE.
FORM abwesenheiten.
*
rp-read-all-time-ity zbegda zendda.
LOOP AT p2001 WHERE awart IN awart_s.
IF p2001-begda LE zbegda. " Höchstens ab ZBEGDA zählen
p2001-begda = zbegda.
ENDIF.
IF p2001-endda GE zendda. " Höchstens bis ZBEGDA zählen
p2001-endda = zendda.
ENDIF.
IF p2001-endda GE p2001-begda.
tage_abwes = p2001-endda - p2001-begda + 1.
abart-tage = tage_abwes.
tage = tage - tage_abwes.
SELECT SINGLE atext FROM t554t INTO abart-atext
WHERE sprsl = 'D'
AND moabw = '01'
AND awart = p2001-awart.
MOVE pernr-pernr TO abart-pernr.
MOVE p0001-ename TO abart-ename.
MOVE p2001-infty TO abart-infty.
MOVE p2001-subty TO abart-subty.
MOVE p2001-begda TO abart-begda.
MOVE p2001-endda TO abart-endda.
APPEND abart. CLEAR abart.
ENDIF.
*
ENDLOOP.
*
ENDFORM. "