SAP ABAP BDC-Interview Questions With Answers-5.



21. How To Capture Messages While Processing Call Transaction In BDC?

System messages issued during the transaction can be stored in the as shown below. This internal table must be declared as TYPE TABLE OF BDCMSGCOLL.

DATA: gt_bdcdata TYPE TABLE OF bdcdata WITH HEADER LINE,
gt_msgtab TYPE TABLE OF bdcmsgcoll WITH HEADER LINE.


CALL TRANSACTION 'xxxx' USING gt_bdcdata
MODE 'N''
UPDATE 'S'
MESSAGES INTO gt_msgtab.

Internal table gt_msgtab contains only message no and message Id and not the actual message. In order to extract the exact message FORMAT_MESSAGE function module can be used.

FORMAT_MESSAGE function module gives the actual message based on the message id, message no, and message variables.

LOOP AT gt_messtab.
   CALL FUNCTION 'FORMAT_MESSAGE'
   EXPORTING
      id = gt_bdcdata -msgid
      lang = gt_bdcdata -msgspra
      no = gt_bdcdata -msgnr
      v1 = gt_bdcdata -msgv1
      v2 = gt_bdcdata -msgv2
   IMPORTING
      msg = lv_msg
   EXCEPTIONS
      others = 0.

ENDLOOP.


22. Differentiate Between Synchronous & Asynchronous Update Mode in BDC?

Synchronous update indicates that an update is completed for the transaction before processing returns to the calling program whereas Asynchronous update indicates that processing returns to the calling program immediately after the transaction is completed, even before the update is completed.

Moreover these two updates can be differentiated on two basis: One on Execution Speed and the other on Return Code.

  • Synchronous update is slower than asynchronous update because processing does not return to the calling program until the update is complete (update mode when processing batch input sessions is always synchronous).
  • The return code value i.e. SY-SUBRC value after synchronous update indicates the success or failure of the actual update (0 for success and non-zero value for failure). The return code after asynchronous updating only indicates the success or failure of the transaction, not the update.


23. Which Of The Following Method Of BDC Allow Multiple Transactions To Be Processed By SAP? Call Transaction Or Call Session?

The CALL TRANSACTION method always allows only a single transaction to be processed by SAP.

In Session Method, the BDC_INSERT function module allows multiple transactions to be processed by SAP. However BDC_OPEN_GROUP function module allows only a single session to be opened at a time. It means one BDC session can process multiple transactions.


24. Which Mode Of CALL TRANSACTION Method Allows Background Processing?

No Screen Mode (N) is the only mode that allows background processing.


25. What Should Be The Step By Step Approach For Writing A BDC Program?

The approach for writing a BDC program should be:

  • Go to SHDB and record the transaction for which the data is to be uploaded into the SAP System.
  • Save the recording and Transfer the recording routine to a program.
  • Now modify that program as per your need. Say if you are uploading an excel file available in presentation server then use function modules to upload excel file data into internal table. 
  • Then put a loop on internal table and pass required data to the recording routine and save data into BDCDATA table. 
  • Finally CALL TRANSACTION statement can be used to process the data present in the BDCDATA table.
  • This way data can be uploaded into SAP System.