SAP Connector Guide > Part V: Data Integration Using BAPI/RFC Functions > Mapping and Mapping Configuration Tasks Using BAP/RFC Functions > Mappings with BAPI/RFC Function Example
  

Mappings with BAPI/RFC Function Example

You can use the bapi_salesorder_createfromdat1 BAPI function to create sales order details for a customer in your organization.
In this example to create a sales order, perform the following tasks:
Step1: Generate a BAPI/RFC mapplet in Informatica Cloud for the bapi_salesorder_createfromdat1 BAPI function.
Log in to Informatica Cloud and generate a BAPI/RFC mapplet that contains the metadata of the bapi_salesorder_createfromdat1 BAPI function.
Step: 2 Configure a mapping using the generated mapplet.
Perform the following steps to configure a mapping:
  1. 1. Specify source objects to enter the order header data from the ORDER_HEADER_IN structure, the partner data using the ORDER_PARTNERS table, and item data using the ORDER_ITEMS_IN table as input parameters.
  2. 2. Add the Mapplet transformation. Draw a link to connect the flat file Source transformation to the Mapplet transformation. Draw the following links:
  3. 3. Configure the mapplet transformation.
    1. a. Select the generated mapplet. Verify that you specify an SAP RFC/BAPI Interface connection for the mapplet.
    2. b. Map the incoming source fields with the BAPI parameter properties.
  4. 4. Configure a flat file object to which you can write the sales order details. Draw a link to connect the Table Output in the Mapplet transformation to the flat file Target transformation. Create multiple flat file target objects to write the sales order. Create the following target objects and map them to the associated output ports in the BAPI mapplet:

Step 1: Generating a BAPI/RFC Mapplet in Informatica Cloud for the BAPI_SALESORDER_CREATEFROMDAT1 BAPI Function

Perform the following steps to generate a BAPI/RFC mapplet:
    1. Select Configure > Mapplets in the Informatica Cloud home page.
    The Mapplet page appears.
    2. Click New > New SAP Mapplet.
    The New SAP Mapplet page appears. The following image shows the New SAP Mapplet page:
    Specify a mapplet name, connection, transformation scope, and the BAPI/RFC function name to generate the mapplet.
    3. Enter a unique name for the BAPI/RFC mapplet.
    4. Optionally, enter a description for the BAPI/RFC mapplet you want to generate.
    5. Select the transformation type as BAPI.
    6. Select the BAPI/RFC connection that you want to use.
    7. Select the scope of the transformation.
    In real time, select the transformation option as Transaction. For batch processing and validating in non-production environment, select ALL INPUT as the transformation scope.
    8. Enter the name of the BAPI/RFC function.
    Note: Verify that you enter the exact name of the BAPI/RFC function that you want to retrieve.
    9. Click Get Objects.
    You can view the import, export, and table parameter details of the BAPI/RFC function.
    10. Specify the direction for the tables to indicate if the table parameters in the BAPI are input, ouput, or both.
    11. Click OK.
    The mapplet for the specified BAPI/RFC function is created. You can create a mapping for the generated mapplet.

Step 2: Configuring a Mapping with the bapi_salesorder_createfromdat1 Mapplet

    1. To create a mapping, click Design > Mappings, and then click New Mapping.
    The New Mapping dialog box appears.
    2. Enter a name and description for the mapping, and click OK.
    3. To configure the flat file source, on the Transformation palette, click Source.
    4. In the Properties panel on the General tab, enter a name and description.
    5. Click the Source tab and configure the source details.
    1. a. Select a flat file connection.
    2. b. Select Single Object as the Source Type.
    3. c. Click Select to specify a flat file that contains the source fields.
    4. The following image shows the flat file source details:
      Specify a flat file object as the mapping source
    6. Add order header, order items, and order partners as flat file source objects for the mapping.
    7. To add a BAPI/RFC mapplet transformation, on the Transformation palette, click Mapplet.
    1. a. On the General tab, enter a name and description for the mapplet.
    2. b. Draw a link to connect the flat file Source transformation to the Mapplet transformation.
    3. c. On the Mapplet tab, click Select.
    4. The Select Mapplet dialog box appears.
    5. d. Select the bapi_salesorder_createfromdat1 mapplet and click OK.
    6. e. Click Connection to specify an SAP RFC/BAPI Interface connection.
    7. The following image shows the bapi_salesorder_createfromdat1 mapplet details:.
      Select the BAPI/RFC connection for the bapi_salesorder_createfromdat1 mapplet.
    8. f. To preview fields, configure the field rules, or rename fields, click Incoming Fields.
    9. g. Click Field Mapping and map the incoming source fields with the appropriate mapplet input fields.
    10. The following image shows the field mapping of the incoming source fields with the mapplet input fields:
      Map the source fields with the integration ID and other mapplet fields
    8. To add a flat file target, on the Transformation palette, click Target.
    9. On the General tab, enter a name and description for the target.
    10. Click the Target tab and configure target details.
    1. a. Select a flat file connection for the target.
    2. b. Select Single Object as the Source Type.
    3. c. Click Select to specify the target object.
    4. The Target Object dialog box appears.
    5. d. Select the flat file object, and click OK.
    6. e. Optionally, you can choose to forward rejected rows in the Advanced Target options.
    7. f. Repeat the above steps to add all the flat file target objects.
    8. The following images shows the target transformation details:
      Specify the Target transformation details for the mapping
    11. Draw a link to connect the output ports in the Mapplet transformation to the flat file Target transformation.
    The following image shows the mapping configured for the bapi_salesorder_createfromdat1 mapplet:
    Mapping with the bapi_salesorder_createfromdat1 mapplet
    12. Save and run the mapping.