Code: Alles auswählen.
LOOP AT tab_kostl.
SELECT * FROM zqp_av_qamr WHERE verarbeitet <> 'X'
AND kostl EQ tab_kostl-kostl.
PERFORM mailtext.
perform tab_aktualisieren.
ENDSELECT.
endloop.
Code: Alles auswählen.
UPDATE zqp_av_qamr SET verarbeitet = 'X'
WHERE merknr = zqp_av_qamr-merknr AND
vornr = zqp_av_qamr-vornr AND
prueflos = zqp_av_qamr-prueflos AND
werk = zqp_av_qamr-werk AND
aufnr = zqp_av_qamr-aufnr AND
kurztext = zqp_av_qamr-kurztext AND
erstelldav = zqp_av_qamr-erstelldav AND
kostl = zqp_av_qamr-kostl.
UPDATE zqp_av_qamr SET dat_mail_vers = sy-datum
WHERE merknr = zqp_av_qamr-merknr AND
vornr = zqp_av_qamr-vornr AND
prueflos = zqp_av_qamr-prueflos AND
werk = zqp_av_qamr-werk AND
aufnr = zqp_av_qamr-aufnr AND
kurztext = zqp_av_qamr-kurztext AND
erstelldav = zqp_av_qamr-erstelldav AND
kostl = zqp_av_qamr-kostl.