You are on page 1of 1

How to process BDC session programmatically and

capture errors instead of manual sm35


You can create BDC session through your program... and then process it using transaction
SM35. You can now check the error log for errors if any. After you have created BDC
code to create session, the code sample below enables you to process the session you
have created in your program, and captures errors if any programatically.

* Post BDC session programatically


SUBMIT rsbdcsub WITH mappe EQ v_session "v_session contains the session name
you have created in your program
WITH von EQ sy-datum
WITH bis EQ sy-datum
AND RETURN.

* Displaying session for errors


* selection for qid to display session log
SELECT SINGLE qid
INTO v_qid FROM
apqi WHERE
datatyp = 'BDC'
AND groupid = v_session
AND progid = sy-repid
AND userid = sy-uname
AND credate = sy-datum.
IF v_qid IS NOT INITIAL.
* submit the program for BDC session error log
SUBMIT rsbdc_protocol
WITH session EQ v_session
WITH user EQ sy-uname
WITH queue_id EQ v_qid
AND RETURN.

You might also like