SAP ABAP BDC-Interview Questions With Answers-4.



16. What Are The Difference Between Call Session Method & Call Transaction Method?

Differences between Call Session Method & Call Transaction Method are:


  • In CALL SESSION method, the SAP database is updated during the processing of the batch input session, not the execution of the BDC program. In CALL TRANSACTION method, the SAP database is updated during the execution of the BDC program.

  • In CALL SESSION method, errors are handled automatically by the system during the processing of the batch input session. Errors are recorded in a log and with the batch input session, error is kept. In CALL TRANSACTION method, errors are not handled automatically by the system. Errors must be handled explicitly in the BDC program.

  • In CALL SESSION method - Asynchronous Processing and Synchronous Database update. During processing, no transaction is started until the previous transaction has been written to the database. In CALL TRANSACTION method - Synchronous Processing and database update can be done either synchronously or asynchronously. One just need to specify the mode in the program.

  • CALL TRANSACTION method is faster than CALL SESSION Method.


17. On What Basis Do You Decide When To Use Call Session Method & When To Use Call Transaction Method?

Both the methods have their own pros and cons. However I would look at the following parameters for deciding upon which method to use.

  • Size Of Data: Call Session method supports both small amount of data as well as large amount of data whereas Call transaction method should exclusively be used only for small amount of data.

  • Type Of processing The User Wants (Foreground/Background): Call Transaction method doesn’t support background processing whereas Call Session method supports both foreground as well as background process.


18. What Is The Syntax For Call Transaction Statement?

To perform batch input with the CALL TRANSACTION statement, the USING addition is required to send the contents of the BDC table to the transaction:

CALL TRANSACTION <transaction code>
USING <bdc table>
[MODE <display mode>]
[UPDATE <update mode>]
[MESSAGES INTO <msg table>] .

  • The <bdc table> must be declared TYPE TABLE OF BDCDATA.
  • The <display mode> determines how the transaction will be processed: ‘A’ (display all), ‘E’ (display errors only), or ‘N’ (no display). The default is ‘A’.
  • The <update mode> determines how database update will occur: ‘S’ (synchronous) or ‘A’ (asynchronous) or L (local update). The default is ‘A’.
  • System messages issued during the transaction can be stored in the <msg table>. This internal table must be declared TYPE TABLE OF BDCMSGCOLL.


19. What Is The Difference Between The Different Update Modes Available For Call Transaction Statement?

There are 3 update modes available for call transaction mode. They are Synchronous (S), Asynchronous (A) and Local (L).

  • Synchronous (S) update indicates that an update is completed for the transaction before processing returns to the calling program.
  • Asynchronous (A) update indicates that processing returns to the calling program immediately after the transaction is completed, even before the update is completed.
  • Local (L) update indicates that updates of the called program are executed in such a way as if the SET UPDATE TASK LOCAL statement had been executed in it.


20. How Do You Handle BDC For A Table Control?

Issue can be resolved by using the BDC OKCODE ‘=P+’ . It’s the BCD_OKCODE for Page down that can be used for scrolling down in table control.

To populate data into a row of internal table, an index is added to the field name to indicate which line or row is to be populated (Line Index).


Take the below example:

When BDCDATA table is being filled with the records, then keep on incrementing the count variable by 1 as it represents the line number of the table control. Concatenate the field name with the count to represent the row and column of the table control.

When the last line of the table control is reached then again reset the value of the count as one and set the command of page up i.e. ‘=P+’ inside the loop only. This is done only for that screen where table control is being used.

LOOP AT ITAB.
   LV_COUNT1 = LV_COUNT1 + 1.
   LV_COUNT = LV_COUNT1.
   CONDENSE LV_COUNT.

   perform bdc_dynpro using 'SAPLZVBAK' '0001'.
*perform bdc_field using 'BDC_CURSOR'
* 'ZVBAK-SPART(01)'.
   CLEAR V_CHAR.
   CONCATENATE ‘ZVBAK-VBELN(‘ L V_COUNT ‘)’ INTO V_CHAR.
   perform bdc_field using V_CHAR
   ITAB-VBELN.

   IF LV_COUNT1 = 10.
       LV_COUNT1 = 1.
       perform bdc_field using 'BDC_OKCODE'
       '=P+'.
   ENDIF.
ENDLOOP.



No comments:

Post a Comment