This article shows how to use an SAP function module to post data to SAP.
The following 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 the function module.

SAP Function Module #

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:

Input Table #

The format of an input table must be compatible with the parameter of the function module.
The following table is stored on an SQl Server:

    [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:

Set Up in SSIS #

For information on how to use Xtract components, see Online Help: Getting Started with Xtract IS.

  1. Add a source to your Data Flow Task. In this example, the source is a table stored on an SQL Server.
  2. Add the Xtract BAPI component to your Data Flow Task and assign a Connection Manager that contains the connection details to your SAP system. For more information, see Connection Manager.
  3. Look up the function module Z_ECS_PRODUCT_CREATE_MULTI.
  4. Connect the source component to the Xtract BAPI component.
  5. Run the SSIS Package and check the results in SAP.