Pages

Wednesday, April 8, 2009

BDC error when processing in Background

What is BDC?
BDC (Batch Data Communication) is an ABAP programming technique, which allows to record and playback SAP user transactions using an ABAP program
More information on BDC can be accessed at the following SDN Wiki link :
https://wiki.sdn.sap.com/wiki/display/ABAP/BDC

Various Modes of BDC execution ?
Once an BDC has been recorded using SHDB it can be run in an ABAP program by using statement CALL TRANSACTION
for example :
CALL TRANSACTION l_c_tcode USING i_bdcdata
UPDATE l_c_update
MODE l_c_mode
MESSAGES INTO i_bdcmsg

More details on the "CALL TRANSACTION" statement are available at the following SAP Help link :http://help.sap.com/abapdocu/en/ABAPCALL_TRANSACTION.htm

BDC Modes
An ABAP program may use one of the following common mode options for the call transaction statement
A - Execution of the transaction with display of each transaction screen
E - Execution in background with display of transaction screen only in the case of an error
N - Execution in background without display of transaction screens

A mode is generally used to run the BDC while the program is in development to test the exeuction of each screen of the transaction under various conditions. while the N mode is generally used for integration or performance test

Issues
Certain messages, like the ones listed below may appear as an information or warning message while a BDC is executed in A mode.
example : Field BSEG-ZTERM. is not an input field

Solution
A consultant should check all the conditions where the ABAP program may try to enter data in a field which may or may not be available for input depending upon inputs in previous screens of the transaction or otherwise.
All such inputs should be avoided or controlled by adding adequate program logic conditions in the ABAP code.
For Example :In transaction F-32, if no residual item is created, the Payment Term field ( BSEG-ZTERM) for the first line item of the FI document would not be available for input. but when a residual item is going to be created, the first line item would contain the residual amount to be posted and its Terms of Payment would be editable (depending upon field status group and document layout settings)Hence the above logic of determining the residual amount needs to added to the program logic

No comments:

Post a Comment