Skip to end of metadata
Go to start of metadata

Overview

BDC stands for Batch Data Communication and is also referred to as Batch Input. It is a technique for mass input of data by simulating user inputs in screens of existing transactions. Screens are not displayed, it can be run in the background. You do not bypass any of the standard SAP consistency checks, authorizations, etc.

BDC was a great way of uploading data into SAP in a pre-BAPI era, now SAP is making available BAPIs for most of the functionalities, some one should first look out for BAPI if it is not available then go for BDC. Other methods of update include direct update SAP programs and IDocs.

There are two main methods of BDC, these are:

  • Call Transaction Using (CTU)
  • Batch Input Session (BI session)
    See the FAQ below to know the differences between CTU and BI session methods.

Both must be programmed in an ABAP program. First do a recording of the transaction using SHDB transaction, see SAP Library - Transaction recorder. Then embed the recording into your program, then trigger it by using either CTU or BI session method.

The CTU method requires to use CALL TRANSACTION statement, see ABAP documentation - CALL TRANSACTION.

The BI session method requires to call BDC_OPEN_GROUP, BDC_INSERT and BDC_CLOSE_GROUP function modules, and end them with a COMMIT WORK, then start manually the BI session using SM35 transaction (see SAP Library - Managing Batch Input Sessions, or start it automatically by calling either RSBDCSUB or RSBDCBTC program.

For snippets of code, see wiki Sample codes for BDC methods - CTU and BI session.

Display mode

  • CTU: either CALL TRANSACTION ... USING ... MODE <dismode> ..., or ls_ctu_params-dismode = <dismode>. CALL TRANSACTION ... USING ... OPTIONS FROM ls_ctu_params ...
  • BI session: you can choose it only by running the session interactively (SM35), a popup dialog is displayed with many options.

dismode

Meaning

N

Screens are not displayed. You must choose this mode when you run the BDC in a background job.

A

All screens are displayed. On each screen, a little popup is displayed with the next recorded function, the user has to press Enter to execute it.

E

By default, screens are not displayed, except if an error occurs, or if the end of BDC data is reached although the recorded transaction was not exited

P

Same as N. The difference is that if a breakpoint is reached and the classic debugger is used, then P will avoid the error 00344 concerning screen SAPMSSY3 0131 (or other SAPMSSY3 screen). For more information, see Note 72551 CALL TRANSACTION USING and DEBUGGER. Since the new debugger has been introduced, mode P is more or less obsolete

Others

Like A

Since SAP WAS 6.10, there are 4 additional execution modes, for more information see note 433137 - Batch input: Simulating background mode:

dismode

Meaning

Q

Same as N + the execution is run with SY-BATCH = 'X'

D

Same as A + the execution is run with SY-BATCH = 'X'

H

Same as E + the execution is run with SY-BATCH = 'X'

S

Same as P + the execution is run with SY-BATCH = 'X'

Update mode

It indicates how the function modules in the update task will be run.

  • CTU: either CALL TRANSACTION ... USING ... UPDATE <updmode> ..., or ls_ctu_params-updmode = <updmode>. CALL TRANSACTION ... USING ... OPTIONS FROM ls_ctu_params ...
  • BI session: you can choose it only by running the session interactively (SM35), a popup dialog is displayed with many options.

updmode

Meaning

A

Asynchronous. Update function modules are executed in UPD workprocess. A is the default mode.

S

Synchronous. Update function modules are executed in UPD workprocess BUT all COMMIT WORK are processed as if they were COMMIT WORK AND WAIT.

L

Local update task. Update function modules are executed as if SET UPDATE TASK LOCAL has been executed at the start of each LUW, i.e. they are executed in the same workprocess as the main program.

FAQ

Refer to the FAQ here: Batch Input FAQ

  • No labels
  1. Guest

    Using SHDB we can record and then generate a program.

    If the client is not open then export the shdb recording and import in the client which is open and then generate program or function module.
    - Sanjay

  2. Hi Sanjay,

    Don't be afraid to directly change the page as you see fit. I tried with your comment, but you may have a better way and can go in and change it.

    We will move the comments to a separate tab soon.

    Thanks for contributing, Mark.