BDC error handling

Question : Subject : BDC FAQ

Dear Friends:
1.How to handle errors in call transaction method and session method.

2.where can i get good examples of call transaction & session method in sap r/3 system,on internet or in books?

3. What is the criteria to select call transaction method or session method for data upload?

All your answers will be greatly appreciated.

Regards


Reply : Subject : BDC FAQ

You can try this code to handle your BDC errors and display the corresponding error messages:

if session ne 'X'.
call transaction tcode using itab_bdc mode 'N' UPDATE 'S' MESSAGES INTO i_errors.

* N - no display
* E - errors only
* A - display ALL screens
elseif session = 'X'.
call function 'BDC_INSERT'
exporting
tcode = tcode
tables
dynprotab = itab_bdc
exceptions
internal_error = 1
not_open = 2
queue_error = 3
tcode_invalid = 4
printing_invalid = 5
posting_invalid = 6
others = 7

*Check SY-SUBRC
if sy-subrc <> 0. "Unsuccessful
loop at i_errors.
MESSAGE ID i_errors-msgid TYPE i_errors-msgtyp NUMBER
i_errors-msgnr WITH i_errors-msgv1 i_errors-msgv2
i_errors-msgv3 i_errors-msgv4 INTO i_error_messages-message.

append i_error_messages.
endloop.
endif.
endif.

0 comments: