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 errors

Former Member
0 Likes
237

Hey friends,

I am developing BDC for MM01,using call transactions.How do i handle errors in it? i need to select the error files and give an email to the users that these were the material number that failed.

Then those errors along with the other new materials to be created should be processed the nextday.

Please give me an idea to proceed with this.

Thanks in advance

Rinky.

1 REPLY 1
Read only

Former Member
0 Likes
210

I am assuming you are reading your current file into an internal table, then loop at it, prepare BDC and call transaction. You can implement a logic like below.

loop at file_recs.

.....

.....

prepare bdc data.

.....

.....

call transacton ... messages into bdcmsgcoll_tab.

read table bdcmsgcoll_tab with key msgty = 'E'.

if sy-subrc = 0.

*-- error occured

move file_recs to error_recs.

if first_error_rec = 'Y'.

open dataset errorfile....

endif.

transfer error_recs to errorfile.

endif.

....

....

endloop.