Skip to Content
0
Former Member
Apr 12, 2012 at 07:47 AM

Inserting data into ztable along with line item

569 Views

Hi experts,

i have created ztable and i m inserting data into ztable at ehnacement V45A0003.

here i m getting sales order and line item No. But the problem only sales order with last line item no.

is inserted. I want to insert all the sales order along with all the line items.

I m using following Syntax

data: it_vbap type table of vbap,

wa_vbap type vbap.

it_vbap[] = xvbap[].

loop at it_vbap into wa_vbap.

wa_vbap-vbeln = xvbak-vbeln.

wa_vbap-posnr = xvbap-posnr.

wa_vbap-zdate = sy-datum.

wa_vbap-cuobj = xvbap-cuobj.

"wa_vbap-flag = 'A'.

" MOVE-CORRESPONDING wa_vbap TO zvbap.

"INSERT INTO zvbap VALUES wa_vbap. "TRANSPORTING vbeln posnr cuobj flag.

MODIFY zvbap FROM wa_vbap.

ENDLOOP.

kindly provide me the syntax for inserting sales order along with all line item.

regards,

Viraj