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

Call Transaction problem

Former Member
0 Likes
879

Hi Experts,

I'm an ABAP beginner.

I'd like to insert more than 1 record in BDC program.

Please suppose that there are more than 1 records in BDCDATA itab 'BDC_TAB' in this code below.

CALL TRANSACTION 'SE11'

USING BDC_TAB

MODE 'A'

UPDATE 'S'

MESSAGES INTO MESSAGE_BDC.

The result was that only One record is inserted into DB.

How can I possiblly insert more than 1 records into DB?

Do I have to put this code in LOOP and REFRESH each time?

I think there is a better way in your Brain. Help me please

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
826

Hi,

your assumption of putting a loop is correct wht u ned to do is i hope u have declared the internal table for the fileds which u want to record the transaction .. So loop tht internal table and refresh the internal table and use the insert syntax such that u can insert the records ..

Regards,

Sana....

7 REPLIES 7
Read only

Former Member
0 Likes
827

Hi,

your assumption of putting a loop is correct wht u ned to do is i hope u have declared the internal table for the fileds which u want to record the transaction .. So loop tht internal table and refresh the internal table and use the insert syntax such that u can insert the records ..

Regards,

Sana....

Read only

gopi_narendra
Active Contributor
0 Likes
826

Yes, you are supposed to do it in a loop.

Loop at BDC_TAB.
.........
CALL TRANSACTION 'SE11'
USING BDC_TAB
MODE 'A'
UPDATE 'S'
MESSAGES INTO MESSAGE_BDC.
<Show messages>
refresh : BDC_TAB
endloop.

Regards

Gopi

Read only

Former Member
0 Likes
826

You should put the code inside the loop only and use referesh statement after the call transaction syntax.

Regards

Read only

Former Member
0 Likes
826

Hi,

Record the transaction thru SHDB. Keep the processing perfrom's in Loop. Then u can insert many records.

Reward if Helpful.

Iyswarya

Read only

Former Member
0 Likes
826

Hi,

Just have a look at the code below it is inserting multiple recodr in BGM1

loop at it_tab5.

perform bdc_dynpro using 'SAPLBG00' 0101 .

perform bdc_field using 'BDC_OKCODE' '/00' .

perform bdc_dynpro using 'SAPLBG00' 1000 .

perform bdc_field using 'BDC_OKCODE' '=BUCH' .

perform bdc_field using 'BDC_SUBSCR'

'SAPLBG00 1101KOPF_1000'.

perform bdc_field using 'GBGMK-GAART' '2' .

perform bdc_field using 'GBGMK-GAERB' 'X' .

perform bdc_field using 'BDC_SUBSCR'

'SAPLBG00 1103TAB_SUB_1000'.

perform bdc_field using 'BDC_CURSOR' 'GBGMP-LSTNR(01)' .

perform bdc_field using 'GBGMP-LSTNR(01)' it_tab5-material .

call transaction 'BGM1' using it_tab3 mode 'A' messages into it_tab2.

endloop.

Do reward if it helps you

Read only

Former Member
0 Likes
826

hi,

you have to keep in a loop and the work .

Regards,

Sindhu

Read only

Former Member
0 Likes
826

Ok guys I see.

but the answer means that we use DBCDATE itab only for using the first record of itab.

I'm still curious about it but it's just made to do so..

Thanks