2007 Aug 07 5:37 PM
Hi,
My scenario will be like this, i have two internal tables which is populated based on certain conditions, now i have to call one bapi to update values that am going to store values in a tree structure say for eg mat01 is header and mat02 and mat03 are item values.
What is the efficient method to call that bapi one time for header creation and consequte times for item creation respectively.
shall i have to loop thro two internal tables i.e header and item?
suggestions are welcomed from the experts...
Thanks in advance...
Regards,
Babu
2007 Aug 07 5:46 PM
HI,
Ensure that you have some relation between header and item..
sort it_vbap by vbeln.
loop at it_vbap.
at new vbeln.
read table it_vbak with key vbeln = it_vbap-vbeln.
endif.
at end of vbeln.
call bapi..
endat.
endloop.
Thanks
mahesh
Hi,
My scenario will be like this, i have two internal tables which is populated based on certain conditions, now i have to call one bapi to update values that am going to store values in a tree structure say for eg mat01 is header and mat02 and mat03 are item values.
What is the efficient method to call that bapi one time for header creation and consequte times for item creation respectively.
shall i have to loop thro two internal tables i.e header and item?
suggestions are welcomed from the experts...
Thanks in advance...
Regards,
Babu
2007 Aug 07 5:42 PM
u need to loop first through header item and internally loop through the item level data which would be a efficient way of posting data into SAP.
2007 Aug 07 5:46 PM
HI,
Ensure that you have some relation between header and item..
sort it_vbap by vbeln.
loop at it_vbap.
at new vbeln.
read table it_vbak with key vbeln = it_vbap-vbeln.
endif.
at end of vbeln.
call bapi..
endat.
endloop.
Thanks
mahesh
2007 Aug 07 5:49 PM
Hi Babu
you can do something like that.
loop it_header.
*Call bapi to create header
loop it_item where field_key = it_header-field_key.
* Call bapi to create item
endloop.
endloop.
The important part is the where sentence in the second loop.
Regards
David N.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |