‎2007 Jun 05 9:51 PM
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.
‎2007 Jun 05 11:31 PM
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
‎2007 Jun 05 10:07 PM
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
.
‎2007 Jun 05 10:35 PM
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
‎2007 Jun 05 11:19 PM
hi,
Appreciate your response.
apart from getting those error rec's, will the other records get saved?
Thanks,
Kranthi.
‎2007 Jun 05 11:50 PM
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
‎2007 Jun 05 11:31 PM
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