Code: Alles auswählen.
DATA:
it_itab TYPE TABLE OF vbap,
wa_itab LIKE LINE OF it_itab.
SELECT *
FROM vbak AS a
INNER JOIN vbap AS b
ON a~vbeln = b~vbeln
INTO CORRESPONDING FIELDS OF TABLE it_itab
WHERE a~vbeln EQ '...'.
LOOP AT it_itab INTO wa_itab.
UPDATE vbap
SET vbeln = wa_itab-vbeln
WHERE vbeln EQ wa_itab-vbeln
AND posnr EQ wa_itab-posnr.
ENDLOOP.