VeloX Docs

SAP plugins

Any SAP FM

Call any remote-enabled SAP function module or BAPI and map its import, export, changing and table parameters.

The Any SAP Function Module plugin calls any remote-enabled (RFC) SAP function module or BAPI. You find it in the SAP Targets group on the left panel of the Designer.

Use it to send data to SAP, for example document numbers, types and descriptions from an Excel file, an SAP table, a database table or a third-party system, and to read the data the function module returns. The plugin calls the function module once per migration entry.

Connection

Connect to SAP in the Connection Parameters. You can use an entry from the Password Manager, or enter the connection data for an Application Server or a Message Server. The connection fields are the same as in the SAP Read Table plugin.

Expand Settings in the connection parameters to change the connection pool settings (IDLE_TIMEOUT, POOL_SIZE, MAX_POOL_SIZE) or to open the plugin Notes.

How to use

  1. Add the Any SAP FM plugin to the canvas.
  2. Open the Connection Parameters.
  3. Select the SAP system, for example through the Password Manager (see example).
  4. In Function Module, enter the name of the function module. The field suggests names as you type.
  5. Set the commit and simulation options (see below).
  6. Click Connect.
  7. Select the import fields and map them to a source (required). Map the export fields to a target (optional).

If the function module isn't remote-enabled, VeloXm shows the message that it "cannot be used for 'remote' calls".

Call options

Field Description
Function Module Name of the function module or BAPI to call.
Commit type Commit Work calls BAPI_TRANSACTION_COMMIT after the function module. Commit Work and Wait calls it with WAIT = X. Without Commit Work doesn't commit; use this for function modules that only read data or commit by themselves.
Rollback in Simulation Mode In simulation mode, calls BAPI_TRANSACTION_ROLLBACK after the function module. In simulation mode the plugin never commits.
SAP GUI Not Use SapGui, Use SapGui or Use SapGui - Hidden. Select an SAP GUI option for function modules that need an SAP GUI session.

Import and export fields

Depending on the function module (for example BAPI_DOCUMENT_GETDETAIL2), the plugin offers single fields, structures and tables as import and export parameters.

The plugin structure, depending on the function module, can include:

  • Input field parameters (1)
  • Input table parameters (2)
  • Output structure parameters (3)
  • Output table parameters (4)

Open Fields and select the parameters you need on the Import, Export, Changing and Tables tabs. Click Select All to select all parameters on a tab. The drop-down list shows the description of each parameter. Use the search if there are many parameters, see Image 2.

Image 2: Open Fields and select the parameters you need on the Import, Export, Changing and Tables tabs. Click Select All to…

Image 2

To use this plugin, create a mapping between a source and the Any SAP FM plugin. The source can be the Excel plugin, a database, the SAP Read Table plugin, the Python plugin and so on.

For example, if the source is the Excel plugin, map the fields between the Excel plugin and the Any SAP FM plugin with drag and drop, as shown below:

Image 3: For example, if the source is the Excel plugin, map the fields between the Excel plugin and the Any SAP FM plugin with…

Image 3

Field options

Open the details of a field to set how its value is converted:

Option Description
Default Value Choose No Default Value., Ignore Source. (always use the default value) or Only If Source Empty. (use the default value only when the source value is empty). A D marker shows that a default value is set. The input mask depends on the SAP data type.
Convert To Upper Case Converts the value to upper case. Marked with U.
Add Leading Zeros Pads the value with leading zeros. Enter the target length in the box next to the check box; it can't be longer than the field. Not offered for decimal, floating-point, date, time and raw (byte) fields. Marked with Z.
Truncate For decimal fields, cuts extra decimal places instead of rounding. Marked with T.
Remove Leading Zeros For export fields, removes leading zeros from the returned value.

Mandatory parameters are marked with M. You can remove mandatory parameters from the plugin if you don't need them.

Run-time behavior

  • Values are converted to the SAP internal format before the call.
  • The plugin reads the SAP messages from the RETURN, ES_RETURN, ET_RETURN or ET_RETURNS parameter, if the function module has one, and shows errors in the migration log.
  • For ABAP exceptions, the log shows a detailed error description.

How parameters are filled

  • Single fields and structures take one value from the mapped source field, or the default value.
  • Table parameters get one row for every row the mapped source returns for the current migration entry. For example, if an Excel source returns five rows for an entry, the table parameter gets five rows, all sent in the same call. If all fields of a table row use Ignore Source., the table gets one row with the default values.
  • Changing and Tables parameters are both sent and returned, so you can map them on the import side and on the export side.
  • Export fields of a returned table give all rows to the next plugin. Single export fields and structure fields give one value.

SAP calls per entry

For each migration entry the plugin opens one SAP session context and makes these calls in it:

  1. The selected function module.
  2. Outside simulation mode: BAPI_TRANSACTION_COMMIT if the commit type is Commit Work, or BAPI_TRANSACTION_COMMIT with WAIT = X if it is Commit Work and Wait. Nothing is called for Without Commit Work.
  3. In simulation mode: BAPI_TRANSACTION_ROLLBACK if Rollback in Simulation Mode is selected; otherwise nothing.

The commit is sent even if the function module returned error messages. Function modules that follow the BAPI rules don't write data when they return an error.

Simulation mode

When you run the project in simulation mode, the plugin still calls the function module with the real data, but it never commits. Whether data is written depends on the function module:

  • For BAPIs and other function modules that leave the commit to the caller, select Rollback in Simulation Mode so that the changes are rolled back.
  • Function modules that commit by themselves (or call COMMIT WORK inside) write data even in simulation mode. If the function module has its own test-run parameter, set it with a default value instead.

Simulation mode is safe only for function modules that don't commit by themselves. Check the function module before you run a simulation against a production system.

Log and errors

  • A migration entry is marked as an error if any returned message has type E, A or X. All returned messages, including warnings and success messages, are shown with the entry.
  • The technical log shows the simulation, commit and rollback settings, the import parameters sent and the export parameters returned.
  • For an ABAP exception, the error shows the exception text, the message class and the message number.
  • If the function module tries to open an SAP GUI screen (SYSTEM_PREPARE_ATTACH_GUI or SYSTEM_FINISH_ATTACH_GUI), the error refers to SAP Note 1258724 and the migration stops. Select an SAP GUI option for such function modules.
  • When you analyze the project, VeloXm stops with "Connect to SAP server." or "Select Function Module and Connect to SAP server." if the plugin isn't connected or no function module is loaded.

Prerequisites

  • SAP .NET Connector installed on the VeloXm computer. Without it, VeloXm shows "SAP Connector is not installed."
  • An SAP user with RFC authorization for the function module and the business authorizations the function module checks.
  • When you click Connect, the plugin checks whether the function module is remote-enabled by reading table TFDIR with RFC_READ_TABLE, so the user also needs authorization to call RFC_READ_TABLE and read that table.
  • For the Use SapGui options, SAP GUI must be installed on the VeloXm computer.

Templates

Click Create Template in Settings to save the configured plugin as a reusable template. In the Template window you set the Icon Background, PluginName, Description, Url, Version and GroupName, and add notes. Select Is Closed to hide the function module name in plugins created from the template.

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