Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BDC call transaction method

Former Member
0 Likes
1,652

Should 'call transaction' be called inside the loop or outside the loop in BDC?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,330

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

7 REPLIES 7
Read only

ferry_lianto
Active Contributor
0 Likes
1,330

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

Read only

Former Member
0 Likes
1,330

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.

Read only

Former Member
0 Likes
1,330

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

Read only

Former Member
0 Likes
1,330

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.

Read only

Former Member
0 Likes
1,330

Hi Sangeeta,

Pl go thro the following document.

http://www.sappoint.com/abap/bdcconcept.pdf

It will be helpful to you.

Regards

Elini.P

Read only

Former Member
0 Likes
1,330

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.

Read only

Former Member
0 Likes
1,331

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