3. Diff between call transaction and batch input

3. Diff between call transaction and batch input

Call Transaction: usually used in Deluxe
Eg) In f_process_detail_rec
Move ‘FB01’ to v_tcode.
Code the dynpro commands here. The values are appended into i_bdc_table
Move c_ready_to_post to v_transaction_status.
What happens now is, the Inbound driver now do Call Transaction
call transaction v_tcode using i_bdc_tbl
update v_updmode
mode c_no_display
messages into i_msg.

Batch Input processing methods.
Batch Input or BDC and Call Transaction

Batch input: Here the ABAP program reads the external data to be
Entered to the SAP System and stores the data in ‘Batch Input sessions’ or batch input queues .A session stores the actions that are required to enter the data using normal SAP transactions. When the program has completed generating sessions, we can run the sessions to execute the SAP transactions in it. We can either explicitly start and monitor the session using ‘Batch Input management function’ or have the session run in the background processing system. This method uses the function modules BDC_OPEN, BDC_INSERT, BDC_CLOSE to generate sessions.

For Batch Input we use structures like BGR00 etc. All the fields in the structure needs to be filled. So for those fields which we need no values need to be filled with something called NODATA which is a ‘/’. There are lots of predefined BDC programs to transfer data to SAP.

Adv. - Transfer data for multiple transactions
During processing, no transaction is started until the previous transaction has bee written to the datbase
A batch input processing log is generated for each session

Call Transaction: In this method, program uses the ABAP CALL TRANSACTION USING statement to run the SAP transaction. Batch input data does not have to be deposited in a session for later processing. Instaed, the entire atch processing takes place inline in the program.

Here the program prepares the data calls the transaction for immediate processing

Adv. - Transfer data for a single transaction
- Synchronous and asynchronous database update possible
- Separate LUW for transaction
- No batch inpur processing log generated

All these data transfer methods uses the same structure called BDCDATA to store the data.

To write a Batch Input program
Read the data, often from a sequential file that has been exported from
another system or created by data transfer program
if necessary perform data formatting or error-checkin
prepare the data for batch Input by storing the data in the batch input data structure BDCDATA.
Generate Batch input session for classical batch input or process the data directly with call transaction

Direct Input
To enhance the batch input procedure, the system offer direct load technique
Especially for transferring large amount of data. In contrast to batch input this technique does not create sessions, but stores data directly. It does not process screens. It updates the corresponding database tables directly by calling lots of function modules. Thiese programs needs to be processed using transaction BMV0.


Example programs for Batch Input and Call Transaction

Program zysapbdc line-size 120.
**** Add a line ina report
parameters: bdctype type c default ‘M’.
“M = Create batch input session
“T = Call transaction

****Only used for batch input sessions
parameters: group(12) type c default ‘BDCTEST’, “ group name of the session user(12) type c default sy-uname, “ user name for starting the session in background keep(1) type c, “ ‘ ‘ = delete session after processing, ‘X’ = delete session holddata like sy-datum.

****used for call transaction
parameters: dmode type c default ‘ “A’. “display modes
“A = display all screens
“E = display error screens
“N = No display
**** batch input data for a single transaction
data: begin of bdcdata occurs 0,
include structure bdcdata,
end of bdcdata.
data: begin of messtab occurs 0,
include structure bdcmsgcoll,
end of messtab.

****generate batch input
case bdctype.
When ‘M’.
Perform create_group.
When ‘T’.
Perform call_transaction.

**** create batch input sessions
form create_group.
****open batch input group
call function ‘BDC_OPEN_GROUP’
Client = sy-mandt
Group = group
User = user
Keep = keep
Holddate = holddate.

**** insert first transaction
perform GEN_BDC_DATA
call function ‘BDC_INSERT’
tcode = ‘SE38’
dynprotab = bdcdata.

**** insert second transaction
perform GEN_BDC_DATA
call function ‘BDC_INSERT’
tcode = ‘SE38’
dynprotab = bdcdata.

**** close batch input group.
Call function ‘ BDC_CLOSE_GROUP’.
Endform. “form create_group

****call transaction using
form call_transaction.
Call transaction ‘SE38’ using BDCDATA mode DMODE messages into MESSTAB.
Write:/ sy-subrc, messages etc…

**** create batch input data for transaction SE38
Refreash bdcdata.
Perform bdc_dynpro using ……
Perform bdc_field using ……

****in the batch input data,start a new screen
form bdc_dynpro using program dynpro.
Clear bdcdata.
Bdcdata-program = program.
Bdcdata-dynpro = dynpro.
Bdcdata-dynbegin = ‘X’.
Append bdcdata.

****in the batch input data, insert the field
form bdc_dynpro using program dynpro.
Clear bdcdata.
Bdcdata-fnam = fnam.
Bdcdata-fval = fval.
Append bdcdata.

No comments: