This document provides a code sample for programmatically processing a BDC session that was created in a program, capturing any errors, instead of manually using transaction SM35. The code sample shows how to post the BDC session programmatically using function module SUBMIT with parameters to specify the session. It then selects the queue ID for the session log and submits another function module to display the session's error log if a queue ID was found.
This document provides a code sample for programmatically processing a BDC session that was created in a program, capturing any errors, instead of manually using transaction SM35. The code sample shows how to post the BDC session programmatically using function module SUBMIT with parameters to specify the session. It then selects the queue ID for the session log and submits another function module to display the session's error log if a queue ID was found.
This document provides a code sample for programmatically processing a BDC session that was created in a program, capturing any errors, instead of manually using transaction SM35. The code sample shows how to post the BDC session programmatically using function module SUBMIT with parameters to specify the session. It then selects the queue ID for the session log and submits another function module to display the session's error log if a queue ID was found.
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.