‎2006 Mar 31 4:49 AM
Should 'call transaction' be called inside the loop or outside the loop in BDC?
‎2006 Mar 31 6:22 AM
to put it simply....it depends on the data that is available to you....
if you have data for which you will need to execute a given transaction multiple times,you call it inside the loop, else u will need to do it only once ...:-)
rgds,
PJ
‎2006 Mar 31 4:52 AM
Hi,
It depends on the requirement.
You may call two different call transaction while you validate a record at looping internal table.
For example, if the record exits, perform change_material_mm02 else perform create_material_mm01.
Do you have an example code/requirement?
Hope this will help.
Regards,
Ferry Lianto
‎2006 Mar 31 4:53 AM
Sangeeta,
Loop at your data table and fill the BDCDATA table.
You do a call transaction outside the loop by passing the BDCDATA table to it.
Regards,
Ravi
Note : Please mark the helpful answers.
‎2006 Mar 31 4:57 AM
Hi sangetha,
In BDC usually CALL TRANSACTION is called only outside the loop.
Only to popultae all the necessary data we use LOOP and then call it once at the end..
regards
satesh
‎2006 Mar 31 5:04 AM
It can be anything. Let us say I have an internal table containing data for only one sales order. So I build the BDC data inside the loop and then do a call transaction VA01 outside the loop.
But if the same internal table has data for several sales order, then I do the call transaction inside the loop only but do it only at some logical control break such as AT NEW, AT END or some custom control break.
It will be wrong just to say one way or the other without knowing what is the content of the internal table.
‎2006 Mar 31 5:46 AM
Hi Sangeeta,
Pl go thro the following document.
http://www.sappoint.com/abap/bdcconcept.pdf
It will be helpful to you.
Regards
Elini.P
‎2006 Mar 31 5:55 AM
Hi Sangeeta,
It depends on the scenario in which your going to call the transaction. Consider a situation in which I was required to write a BDC program for Task List dependency editor (IA06 transaction). Every Task List can have a number of operations and operation can have suboperations. I was required to call the transaction for only the Task List Number and not for individual operations and suboperations. In such a scenario , we populate the BDCDATA internal table inside a loop . The process of calling the transaction can be done in the loop itself (using some flags and ON CHANGE and IF statements) or after the Task List Number changes exit the loop(using the EXIT statement) and then do the call transaction. So its just the ease with which you can implement your logic, that you call the transaction inside the loop or outside the loop. The only thing to be remembered is that BDCDATA internal table should be populated before you call the transaction.
‎2006 Mar 31 6:22 AM
to put it simply....it depends on the data that is available to you....
if you have data for which you will need to execute a given transaction multiple times,you call it inside the loop, else u will need to do it only once ...:-)
rgds,
PJ