BDC (Batch Data Communication) is a technique in SAP used to transfer or upload large volumes of data into the system by automating transactions.
- It simulates manual data entry (like recording keystrokes).
- Commonly used during data migration or mass updates.
- Works by preparing a “session” of transaction data and then processing it.
There are two main methods of BDC:
- Call Transaction Method → Processes data immediately (online).
- Session Method → Creates a batch session, which can be processed later.
Common Function Modules for BDC
-
BDC_OPEN_GROUP
- Opens a BDC session (used in Session Method).
- Parameters: session name, client, user, etc.
-
BDC_INSERT
-
Inserts a transaction with its BDC data into the opened session.
-
-
BDC_CLOSE_GROUP
-
Closes the session after inserting all transactions.
-
-
CALL TRANSACTION ... USING
(not a FM, but a statement)-
Used in Call Transaction method.
-
Executes transaction immediately with given BDC data.
-
Example:
DATA: lt_bdcdata TYPE TABLE OF bdcdata,
ls_bdcdata TYPE bdcdata.
” Populate BDC data for transaction (e.g., MM01, FB01 etc.)
ls_bdcdata-program = ‘SAPMM03’.
ls_bdcdata-dynpro = ‘0100’.
ls_bdcdata-dynbegin = ‘X’.
APPEND ls_bdcdata TO lt_bdcdata.
” Open session
CALL FUNCTION ‘BDC_OPEN_GROUP’
EXPORTING
client = sy-mandt
group = ‘ZBDCSAMPLE’
user = sy-uname.
” Insert transaction into session
CALL FUNCTION ‘BDC_INSERT’
EXPORTING
tcode = ‘MM01’
TABLES
dynprotab = lt_bdcdata.
” Close session
CALL FUNCTION ‘BDC_CLOSE_GROUP’.
Example: Using Call Transaction
CALL TRANSACTION ‘MM01’ USING lt_bdcdata MODE ‘A’.
-
MODE 'A'
→ All screens displayed. -
MODE 'N'
→ No screens (background). -
MODE 'E'
→ Errors only.