Code: Alles auswählen.
exec sql.
insert into ZTEST_VBAKP
( mandt, bname, vbeln, posnr,
objnr, vtweg, kunnr, knumv )
select :sy-mandt, :sy-uname, vbak.vbeln, vbap.posnr,
vbap.objnr, vbak.vtweg, vbak.kunnr, vbak.knumv
from vbak vbak, vbap vbap
where vbak.vbeln = vbap.vbeln
and ( vbak.vtweg = '01' or vbak.vtweg = '02' )
and vbak.vdatu <= :datum_vgl
endexec.
Code: Alles auswählen.
exec sql PERFORMING INSERT_RESULT.
insert into ZTEST_VBAKP
( mandt, bname, vbeln, posnr,
objnr, vtweg, kunnr, knumv )
select :sy-mandt, :sy-uname, vbak.vbeln, vbap.posnr,
vbap.objnr, vbak.vtweg, vbak.kunnr, vbak.knumv
from vbak vbak, vbap vbap
where vbak.vbeln = vbap.vbeln
and ( vbak.vtweg = '01' or vbak.vtweg = '02' )
and vbak.vdatu <= :datum_vgl
endexec.
FORM INSERT_RESULT.
APPEND ZTEST_VBAKP.
ENDFORM.