SAP Connector Guide > Part VI: Data Integration Using IDocs > Mapping and Mapping Configuration Tasks Using IDocs > Outbound Mapping to Read IDocs from SAP Example
  

Outbound Mapping to Read IDocs from SAP Example

You can read material master (MATMAS) IDocs from SAP and write it to a flat file object.
In this example to read the MATMAS IDocs, perform the following steps:
Step 1: Import MATMAS metadata using the SAP Metadata utility.
Perform the following steps to import the MATMAS IDoc:
  1. 1. Launch the SAP Metadata utility and specify the SAP connection properties to connect to the SAP system.
  2. 2. Verify that you select the IDoc option and then connect to the SAP system.
  3. The Next button is enabled only after you establish a connection to the SAP system.
  4. 3. Enter the MATMAS as the message type and MATMAS04 as the IDoc type to fetch the IDoc segments and fields for MATMAS.
  5. 4. To read IDocs, select the Interpreter transformation.
  6. 5. Retain the default output directory for the generated mapplet.
Step 2: Import the generated mapplet to Informatica Cloud.
Login to Informatica Cloud and import the MATMAS mapplet XML file from the output directory.
Step 3: Configure a mapping using the generated mapplet.
Perform the following steps to configure a mapping:
  1. 1. Configure an SAP source. Specify an SAP IDoc Reader connection.
  2. 2. Add the Mapplet transformation. Draw a link to connect the Source transformation to the Mapplet transformation.
  3. 3. Map the incoming IDoc Record field with the IDocData field in the mapplet
  4. 4. Configure the Mapplet transformation. Select the generated Mapplet from the output directory.
  5. 5. Configure a flat file object to which you can write the material master details. Draw a link to connect the Control Output Group in the Mapplet transformation to the flat file Target transformation.
  6. Note: Based on your requirement, you can choose to configure multiple flat file objects for each segment in the IDoc and for the IDoc_Interpreter_Error_Output_Group.

Step 1: Importing MATMAS IDoc Metadata

    1. Navigate to the SAP Metadata utility installation directory and double-click the SAPUtil.bat file.
    The Import SAP IDOC/BAPI/RFC wizard appears.
    2. Select the SAP system to which you want to connect.
    All systems specified in the sapnwrfc.ini file appear in the drop-down list.
    3. Enter the SAP user name.
    4. Enter the password associated with the SAP user.
    5. Enter the client number.
    6. Enter the language code.
    7. Select IDoc and click Connect.
    The SAP Metadata utility establishes a connection to the SAP system.
    The following image shows the Connection Properties dialog box in the SAP Metadata utility:
    Specify the properties to connect to the SAP system
    8. Click Next.
    The Step 2: Select SAP IDoc Prepare Transformation page appears.
    9. Enter the message type as MATMAS and the IDoc type as MATMAS04, and click Fetch.
    You can view the segment and field details of the IDoc.
    10. Select the Interpreter transformation and the scope of the transformation as Transaction.
    The following image shows the SAP IDoc specification dialog box:
    Import the MATMAS metadata using the SAP Metadata utility.
    11. Select the segments you want to include in the mapplet.
    You can click Select All Segments to include all segments in the IDoc. You can click Deselect All Segments to remove all selected segments except required segments from the IDoc.
    12. Retain the default directory for the output files and click OK.
    13. Click Finish.
The MATMAS04_Interpreter_Mapping.xml mapplet for the MATMAS IDoc is created in the <SAP Metadata Utility installation directory>/generatedMappings directory.

Step 2: Importing the MATMAS04_Interpreter_Mapping Mapplet to Informatica Cloud

    1. Select Configure > Mapplets.
    The Mapplets page appears.
    2. Click New.
    The New Mapplet page appears.
    3. Enter an unique name for the IDoc mapplet.
    4. Optionally, enter a description for the IDoc mapplet you want to import.
    The following images shows the New Mapplet page:
    Import the MATMAS04_Interpreter_Mapping Mapplet to Informatica Cloud
    5. Select the mapplet type as Active.
    6. Click Upload to navigate to the XML file you generated using the SAP Metadata utility.
    The Upload Metadata XML File dialog box appears.
    7. Click Choose File.
    8. Navigate to the <SAP Metadata Utility installation directory>/generatedMappings directory, select the MATMAS04_Interpreter_Mapping.xml file, and click Open.
    The following images shows the input and output details of the MATMAS04_Interpreter_Mapping mapplet:
    View the input and output details of the MATMAS04_Interpreter_Mapping mapplet
    9. Click OK.
    You can view the imported mapplet in the Mapplets page.

Step 3: Configuring an Outbound Mapping with the MATMAS IDoc

    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 an SAP 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 select an SAP IDoc Reader connection.
    When you select an SAP IDoc Reader as connection, the source type is a single object and source object is the IDoc Reader Object.
    6. If required, configure the advanced source properties.
    The following image shows the SAP source details:
    Configure an SAP source for the outbound mapping
    7. To add an IDoc mapplet transformation, on the Transformation palette, click Mapplet.
    8. On the General tab, enter a name and description for the mapplet.
    9. Draw a link to connect the Source transformation to the Mapplet transformation.
    10. On the Mapplet tab, click Select.
    The Select Mapplet dialog box appears.
    11. Specify an IDoc mapplet that you imported using the Interpreter transformation and click OK.
    The following image shows the MATMAS mapplet details:
    Import the MATMAS mapplet XML file from the <SAP Metadata Utility installation directory>/generatedMappings directory
    12. To preview the incoming single IDoc Reader Object, click Incoming Fields.
    The following image shows the incoming single IDoc Reader object:
    View the incoming single IDoc Reader object to the IDoc mapplet
    13. Click Field Mappings to map the incoming IDoc Record field with the IDocData field in the mapplet.
    14. To add a flat file Target transformation, on the Transformation palette, click Target.
    15. On the General tab, enter a name and description.
    16. 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 Target Type.
    3. c. Click Select to specify the target object.
    4. The Target Object dialog box appears.
    5. d. Select the Create New at Runtime option, specify a name for the flat file object, and click OK.
    6. e. Optionally, you can choose to forward rejected rows in the Advanced Target options.
    7. The following images shows the target transformation details:
      Specify the Target transformation details for the mapping
    17. Draw a link to connect the mapplet groups to the flat file target object.
    18. Save and run the mapping.