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

Former Member
0 Likes
578

Hi,

is there a way in BDC call transaction where we can go ahead even if some records error out and to capture those records with the same structure as in input file.

thanks,

kranthi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
560

Hi Kranthi

A BDC is like running a standard transaction and if you run any standard transaction then even if one record that you are entering is incorrect , it doesnt allow you to save the transaction. In a similar manner , if your BDC goes into error , you will have to correct your input file and then re-run the transaction so as to save the data in SAP.

That is the reason we output all the error messages into the bdcmsgcoll table so as to know where and why did the data go into error.

Sometimes we give a 'test run' option on the selection-screen to the client so that before he runs the actual BDC to save the data into SAP , he can do a test run to find out if the data he is sending is all correct. If at all there is any error , that will be rectified first and then the actual BDC will be run.

Hope this helps .

Cheers

Shivika

5 REPLIES 5
Read only

Former Member
0 Likes
560

Hi Kranthi,

Yes, you can do that.

loop at it_records.

  • BUild bdcdata structures...

call transaction '<TCODE>' using it_bdcdata ......

if sy-subrc <> 0.

move-corresponding it_records to it_errors.

append it_errors.

endif.

endloop.

use the functionl function 'GUI_DOWNLOAD' to download it_errors.

Regards,

Ravi

.

Read only

Former Member
0 Likes
560

Hello,

You can do it like this,

CALL TRANSACTION <tcode>' USING batch_bdc MODE b_mode UPDATE 'S'

MESSAGES INTO tbl_msg.

in tbl_msg you will get all the info returned by the tcode.

loop on it

hope this helps

Gabriel

Read only

Former Member
0 Likes
560

hi,

Appreciate your response.

apart from getting those error rec's, will the other records get saved?

Thanks,

Kranthi.

Read only

0 Likes
560

Hi Kranthi,

If you are passing one entry at a time from the file to CALL TRANSACTION then all the entries will get processed except those which are errored out.

And as shown in the code above they will be in the it_error table.

Reward points if useful.

Regards,

Atish

Read only

Former Member
0 Likes
561

Hi Kranthi

A BDC is like running a standard transaction and if you run any standard transaction then even if one record that you are entering is incorrect , it doesnt allow you to save the transaction. In a similar manner , if your BDC goes into error , you will have to correct your input file and then re-run the transaction so as to save the data in SAP.

That is the reason we output all the error messages into the bdcmsgcoll table so as to know where and why did the data go into error.

Sometimes we give a 'test run' option on the selection-screen to the client so that before he runs the actual BDC to save the data into SAP , he can do a test run to find out if the data he is sending is all correct. If at all there is any error , that will be rectified first and then the actual BDC will be run.

Hope this helps .

Cheers

Shivika