Code: Alles auswählen.
SELECT pernr reinr pdatv pdatb accdt pdvrs abrec FROM ptrv_perio
INTO CORRESPONDING FIELDS OF TABLE lt_ptrv_perio
WHERE ( abrec EQ '2'
AND pdatv GE pa_begda
AND pdatb LE pa_endda )
OR ( abrec EQ '3'
AND accdt GE pa_begda
AND accdt LE pa_endda ).
Code: Alles auswählen.
SELECT p~pernr p~reinr p~pdatv p~pdatb p~accdt p~pdvrs p~abrec
FROM ptrv_perio AS p INNER JOIN ptrv_head AS h ON p~reinr = h~reinr
INTO CORRESPONDING FIELDS OF TABLE lt_ptrv_perio
WHERE ( p~abrec EQ '2'
AND p~accdt GE pa_begda
AND p~accdt LE pa_endda )
OR ( p~abrec EQ '3'
AND h~dates GE pa_begda
AND h~dates LE pa_endda ).