Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

vbak and vbap fields in one internal table

Hi,

it is my first program in abap, iam getting errors in my program

i take one internal table for vbak (both vbak avbap fields)and another internal table for vbap(only vbap fields)

I want both fields in vbak internal table. How cal i get it.

In this program iam getting runtime error. Pls any one correct this program

tables: vbak,vbap.

types:begin of it_vbak,

vbeln like vbak-vbeln,

audat like vbak-audat,

auart like vbak-auart,

posnr like vbap-posnr,

arktx like vbap-arktx,

end of it_vbak.

types:begin of it_vbap,

vbeln like vbap-vbeln,

posnr like vbap-posnr,

arktx like vbap-arktx,

end of it_vbap.

data:i_vbak type standard table of it_vbak with header line initial size

0,

i_vbap type standard table of it_vbap with header line initial size

0.

select-options: s_audat for vbak-audat.

select vbeln audat auart from vbak into corresponding fields of table

i_vbak where audat in s_audat.

select vbeln posnr arktx from vbap into corresponding fields of table

i_vbap where vbeln = i_vbak-vbeln.

loop at i_vbak.

read table i_vbap with key vbeln = i_vbak-vbeln.

if sy-subrc = 0.

i_vbak-posnr = i_vbap-posnr.

i_vbak-arktx = i_vbap-arktx.

clear i_vbap.

endif.

append i_vbak.

endloop.

loop at i_vbak.

write:/ i_vbak-vbeln,i_vbak-audat,i_vbak-posnr,i_vbak-arktx.

endloop.

Former Member
Not what you were looking for? View more on this topic or Ask a question