VeloX Docs

SAP plugins

Batch Input - BDC

Record an SAP transaction and replay it as a batch input (BDC) session with your source data.

Overview

The Batch Input - BDC plugin loads data into SAP by replaying a recorded transaction. You record a transaction once (for example MM02), and the plugin builds a mapping structure from the recorded screens and fields. At run time it fills the recorded fields with your source data and calls the transaction for every source record.

You can find the plugin in the SAP Targets group on the left panel of the Designer section. It works as a target: you map fields from a source plugin (Excel, database, SAP table, Python, and so on) to the screen fields.

Use this plugin when no BAPI or function module covers your migration object. For objects with a dedicated plugin, such as Material Master, prefer that plugin.

Connecting to SAP

Open the Connection section of the plugin and fill in Connection Parameters. You can connect in three ways:

  • Password Manager: select the SAP System and the Server Type. The entries come from the Password Manager.
  • Application Server: enter Server Host, System Number, SAPRouter (optional), User, Password, Client, and Language.
  • Message Server: enter SID, Server Host, Logon Group, Server Service, SAPRouter, User, Password, Client, and Language.

A Password Manager entry should have the following keys in its Options: App Server Host, Client, Language, SAP Router, System Number, System ID. You can take all of them from the SAP System options template.

See SAP Read Table for details and screenshots of each connection type. Then click Connect.

Connection settings

The Settings tab contains the connection pool settings IDLE_TIMEOUT, POOL_SIZE, and MAX_POOL_SIZE. Use Notes to keep project notes with the plugin.

Recording a transaction

After you connect, the Record New Batch Input Session section becomes available.

  1. Set the recording options

    Expand Recording Settings and adjust the options if needed. See the table below.

  2. Enter the transaction code

    Type the code in Transaction Code, for example MM02.

  3. Record

    Click Record. SAP GUI opens the transaction with all screens displayed. Go through the transaction as you would for one record and save it.

  4. Review the structure

    When the recording finishes, the plugin shows the recorded screens and their fields. The plugin caption shows the selected transaction code and description.

If the plugin already has a recording, a new recording replaces it, and the plugin asks for confirmation first (All items will be deleted.). If the transaction code does not exist or cannot be called, the plugin shows Transaction "..." is not available. If SAP returns errors during recording, they are shown and the recording is discarded.

From the recording, the plugin builds the field structure. It reads screen, structure, and transaction descriptions from the SAP tables D020T, DD02T, and TSTCT with RFC_READ_TABLE, and field labels with DDIF_FIELDINFO_GET, in the logon language with English as fallback.

Recording uses the function module BDC_RECORD_TRANSACTION and requires SAP GUI on your computer.

Recording settings

Setting Description
Process Mode How screens are displayed during recording. The only option is All screens are displayed.
Update Mode Asynchronous update, Synchronous update, or Local update.
CATT Mode No CATT mode, CATT without single screen control, or CATT with single screen control.
Default size Use the standard window size.
Cont. after commit COMMIT WORK does not end the CATT procedure.
No batch input mode The recording is not run as a batch input session.
NOBIEND No batch input mode after the BDC data has been read.
Save Cursors Record cursor positions. Usually not important in BDC processing.
Save Subscreens Record subscreens. Usually not important in BDC processing.

Processing options

Below the recording section you set how the plugin runs the transaction and formats data:

Setting Description
Decimal Format Decimal notation used in the SAP user settings: _.___.___,__, _,___,___.__, or _ ___ ___,__.
Date Format Date format used in the SAP user settings: dd.MM.yyyy, MM/dd/yyyy, MM-dd-yyyy, yyyy.MM.dd, yyyy/MM/dd, or yyyy-MM-dd.
Call transaction mode Screens are not displayed, DEBUG Mode - All screens are displayed, Screens are not displayed, except if an error occurs, or DEBUG Mode - Screens are not displayed (with the classic debugger).

Set Decimal Format and Date Format to match the defaults of the SAP user in the connection. Batch input enters values as a user would type them, so the formats must match.

Excel template file

The Excel Template File section creates an Excel file that matches the recorded structure. You can fill it with data and use it as a source with the Excel Import plugin.

  • Turn on Add Key Field Automatically to add a group key column to each sheet.
  • If you turn it off, the Keys Selection window opens when you create the file. Select the key fields to add to the table sheets. If you select no keys, a key field is added automatically.
  • Click Create Excel Template and choose where to save the file.

The file has a Header sheet with one column per selected single field, and one sheet per selected table, named after the table. The automatic key column is named _*Group_Key*_. Use the key to link table rows to the header row of the same record.

Fields and mapping

Open the Fields section. The Import tab lists the recorded screens. Select the screens you want to map, or click Select All.

Each screen shows its fields on two tabs:

  • Fields: single fields of the screen.
  • Objects: structures and tables (table controls) of the screen.

Select Use Data from Transaction on a screen or object to replay the recorded values and ignore the mapping for it. Screens without fields are always replayed with the recorded values.

Map the fields you need from any source plugin using drag and drop.

Field options

Each mapped field has these options:

Option Description
Default Value A value for the field. Choose No Default Value., Ignore Source. (always use the default value), or Only If Source Empty. (use the default value only if the source value is empty).
Convert To Upper Case Convert the value to upper case.
Add Leading Zeros Pad the value with leading zeros.
Use User Data format Convert the value to the SAP user data format set in Decimal Format and Date Format.
Truncate Cut the value to the field length.

Table fields can span several rows. Since version 1.0.3.0 the plugin also supports tables that span multiple screens and fields without a structure (variables).

Fields without a structure are mapped as text values. Structure fields take the type, length, and decimals from the SAP Data Dictionary.

Tables

  • Table on one screen (table control): the plugin writes one row per source row, starting at the first recorded row index, on the same screen.
  • Table over several screens: if the same screen with table fields appears more than once in the recording, the plugin treats it as one table that is filled row by row. For each source row it repeats the screen, uses the OK code recorded for the first row, and uses the OK code of the last recorded row for the last source row. Screens recorded between two table rows (for example a detail screen for each item) are repeated for every row.

Run-time behavior

For each source record, the plugin builds the batch input data from the recorded screens and your mapping. It then calls the transaction with the function module RFC_CALL_TRANSACTION_USING in the selected call transaction mode.

  • The technical log shows the transaction code, plugin version, and the SAP messages returned by the transaction.
  • Error messages are added to the log row with their message class and number. The plugin reads the message text and long text from SAP (T100 and RPY_MESSAGE_COMPOSE).
  • If the transaction call ends with a non-zero return code, all returned messages are treated as errors.
  • The record is successful if the transaction returns no error messages.

The transaction runs in the SAP session of the connection with a hidden SAP GUI, so SAP GUI must be installed on the computer that runs the load.

Simulation mode

Batch input has no general test mode. Simulation mode is available only if the last recorded screen is a confirmation popup (program SAPLSPO1), for example a save confirmation popup. In simulation mode, the plugin answers that popup with No, so the data is not saved. Outside simulation mode it answers Yes.

If the last recorded screen is not a confirmation popup, the Simulation checkbox is disabled for the project. Test with a few records in a non-production system first.

Notes

  • For MM01 and MM02, the view selection structure MSICHTAUSW is replayed from the recording and is not mapped.
  • If you get SYSTEM_PREPARE_ATTACH_GUI or SYSTEM_FINISH_ATTACH_GUI errors, see SAP Note 1258724. These errors stop the load.
  • Before the load starts, the plugin checks that a transaction is recorded (Record the Transaction.) and that it is connected (Connect to SAP server.).

Prerequisites

  • SAP Connector for .NET (SAP NCo) and SAP GUI installed on the computer that runs VeloXm.
  • An SAP user with RFC access, authorization for the recorded transaction, and authorization to record batch input (BDC_RECORD_TRANSACTION runs with an authority check).
  • The SAP user's decimal and date formats must match Decimal Format and Date Format.

Our experienced team of experts has the capability to develop customized solutions to fit your individual needs.

We understand that each situation is unique and thus can provide services tailored to those requirements. Our goal is to provide the best possible service and to ensure the most successful outcome for the project.

Please contact us for more information on how we can help you.

Esc