‎2008 Apr 04 7:17 AM
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
‎2008 Apr 04 7:22 AM
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....
‎2008 Apr 04 7:22 AM
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....
‎2008 Apr 04 7:23 AM
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
‎2008 Apr 04 7:24 AM
You should put the code inside the loop only and use referesh statement after the call transaction syntax.
Regards
‎2008 Apr 04 7:25 AM
Hi,
Record the transaction thru SHDB. Keep the processing perfrom's in Loop. Then u can insert many records.
Reward if Helpful.
Iyswarya
‎2008 Apr 04 7:27 AM
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
‎2008 Apr 04 7:27 AM
‎2008 Apr 04 7:56 AM
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