Skip to content

Write Product Data to SAP

The following article shows how to use the Xtract BAPI component to write product data to SAP.
The depicted example uses the custom function module Z_ECS_PRODUCT_CREATE_MULTI to add new products to SAP. A table that contains the product information and is stored on an SQL Server is used as input for the function module.

Custom Function Module Z_ECS_PRODUCT_CREATE_MULTI

The SAP custom function module Z_ECS_PRODUCT_CREATE_MULTI has a table parameter T_PRODUCTS that can be used for input.
The table has the following structure:
ssis-write-sap-01

Input Table

When creating input tables, the format (column names and data types) of the table must be compatible with the table parameters of the function module. The custom function module Z_ECS_PRODUCT_CREATE_MULTI uses the following SQL server table as input:

Input Table for Z_ECS_PRODUCT_CREATE_MULTI
CREATE TABLE [SAP Products] (
    [MANDT] nvarchar(3), 
    [PRODUCTNR] nvarchar(18),
    [DESCTEXT] nvarchar(40),
    [PRODTYPE] nvarchar(4),
    [STOCKQUAN] numeric(18,3),
    [MEINS] nvarchar(3),
    [ERDAT] nvarchar(8),
    [ERZET] nvarchar(6)
)

The table has the following content:
ssis-write-sql-01

Setup in SSIS

  1. Add a data source to your Data Flow Task. The depicted example uses a table stored on an SQL Server, see Input Table.
  2. Add an Xtract BAPI component to your Data Flow Task and assign a Connection Manager that contains the connection details to your SAP system.
  3. Look up the function module Z_ECS_PRODUCT_CREATE_MULTI.
    ssis-write-xtractis-fuba-01
  4. Connect the input table to the Xtract BAPI component.
    The input table is automatically mapped to the corresponding table in the Xtract BAPI component.
    ssis-write-xtractis-fuba-02
  5. Run the SSIS package and check the results in SAP.


Last update: July 6, 2024