How to loop a table part of VA01 transaction, if number of rows for input more than number of rows on a screen?

20 pts.
Tags:
ABAP
SAP FI
VA01
Hеllo Mr.Billingham, I have just read the topic in which somebody ask you How to looping BDC?. Mr.Billingham I have the same problem. I'm trying to BDC input VA01 transction. It's my first task in ABAP/4 programming. The problem: I created ABAP loop which cycles only so many times how many rows has the table part of a screen. I'm truing to cycle apprximatly such code ... perform bdc_field using 'RV45A-MABNR(ZZZ)' '016900608'. " there will be cycle data perform bdc_field using 'RV45A-KWMENG(ZZZ)' ' 200'. " there will be cycle data perform bdc_field using 'KOMV-KBETR(ZZZ)' ' 7,8'. " there will be cycle data perform bdc_dynpro using 'SAPMV45A' '4001'. perform bdc_field using 'BDC_OKCODE' '/00'. ... mentioned ZZZ as row index, but it doesn work properly. if a screen has 9 rows, cycle inputs 9 rows, if 12 then 12 ( I suppose that there are some solutions How to "insert new page of rows"? Would you be so kind to consult me in this question? I appreciate your time. Best wishes, Oleg Suntsov

Answer Wiki

Thanks. We'll let you know when a new response is added.

I am assuming you mean ITEM rows.

If that is the case then it doesn’t matter how many rows there are.
You need to have two internal tables. Lets call them i_orders and i_items.

data: begin of i_orders occurs 10 with header line, “all the VBAK fields needed
order_num like VBAK- VBELN,
sold_to like VBAK- KUNNR,
ship_to like VBAK- VBELN,
PO_num like VBKD- BSTKD,
PO_DATE like VBKD- BSTDK,
.
.
.
end of i_orders .

data: begin of i_items occurs 10 with header line, “all the VBAP (item) fields needed
order_num like VBAK- VBELN,
item_num like VBAP- POSNR,
item_num like VBAP- MATNR,
item_num like VBAP- KWMENG,
item_num like VBAP- VRKME,
.
.
.
end of i_items .

fill i_orders:
i_orders – VBELN = ‘12345’.
i_orders – VBELN = ‘22334’.

fill i_items:
i_items–VBELN = ‘12345’. i_items– POSNR = ‘10’. i_items– MATNR = ‘445544’.
i_items–VBELN = ‘12345’. i_items– POSNR = ‘20’. i_items– MATNR = ‘555555’.
i_items–VBELN = ‘12345’. i_items– POSNR = ‘30’. i_items– MATNR = ‘666666’.
i_items–VBELN = ‘12345’. i_items– POSNR = ‘40’. i_items– MATNR = ‘777777’.
i_items–VBELN = ‘12345’. i_items– POSNR = ‘50’. i_items– MATNR = ‘888888’.

i_items–VBELN = ‘22334’. i_items– POSNR = ‘10’. i_items– MATNR = ‘232323’.
i_items–VBELN = ‘22334’. i_items– POSNR = ‘20’. i_items– MATNR = ‘343434’.
i_items–VBELN = ‘22334’. i_items– POSNR = ‘30’. i_items– MATNR = ‘454454’.
Etc.

Loop at i_orders.
Perform header_BDC using i_orders-vbeln .

Loop at i_items where vbeln = i_orders-vbeln
Perform items_BDC.
Endloop.

call transaction ‘VA01′ using bdcdata.
Endloop.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following