SAP BW BEx Query Connector > Mappings and mapping tasks with SAP BW BEx > Mapping and mapping task example with SAP BW BEx Query
  

Mapping and mapping task example with SAP BW BEx Query

You are a financial consultant and you want to use SAP BW BEx Query Connector to read data from an SAP BW BEx query that extracts a financial planning report in SAP BW. You want to configure a filter to extract a specific project plan from the financial report.
To configure a mapping and mapping task to extract a specific project plan from SAP BW BEx Query and write to a flat file, perform the following tasks:
  1. 1Create an SAP BW BEx Query connection. Select SAP as the authentication method, select Application as the connection type, and enter the SAP connection properties.
  2. The following image shows the configured SAP BW BEx Query connection:
    You can view the configured run-time environment and the SAP connection properties.
  3. 2Create a flat file connection to write data to the flat file.
  4. 3Create an SAP BW BEx Query mapping in the Cloud Mapping Designer.
  5. The following image shows the SAP BW BEx Query mapping:
  6. 4Add a Source transformation, specify a name and description in the general properties.
  7. 5On the Source tab, perform the following steps:
    1. aIn the Connection field, select the configured SAP BW BEx Query connection to connect to SAP BW BEx Query.
    2. bIn the Operation field, select query REP_20161212094150 as the operation to extract the financial planning report from SAP BW BEx Query.
    3. The following image shows the queries from the list of read operations:
      The list of queries appear in the Read Operations list.
      You can view the SAP BW BEx source and flat file target in the mapping.
    4. cIn the Request Options section, configure the request message in the following XML format, specify the attributes in the message, and validate the message:
    5. <!--1 or more repetitions:-->
      <proc:REP_20161212094150_INPUT xmlns:proc="http://xml.schemas/infa/procedure/">
      <!--Optional:-->
      <REP_20161212094150>
      <!--Optional:-->
      <var_temp>$$Param_variable</var_temp>
      </REP_20161212094150>
      </proc:REP_20161212094150_INPUT>
    6. The request message specifies the criteria to include the financial planning report query REP_20161212094150 and includes a parameter to filter a particular project plan within the financial planning report. You need to define the parameter $$Param_variable=PR00004446 entry in a parameter file, parameterfile_name.txt, and save the file in the following directory: <Secure Agent installation directory>/apps/Data_Integration_Server/data/userparameters. Later, enter the parameter file name on the Runtime Options and Advanced Options page of the Mapping Task wizard.
    7. dIn the Advanced Properties section, set the tracing level to Normal, and use the default cache size of 1024.
  8. 6On the Field Mapping tab, map all descendants from the incoming fields of the SAP BEx query response structure to the output fields.
  9. The following image shows the response structure on the left pane and the output fields on the right pane:
    You can view the mapped fields from the response structure to the output fields.
  10. 7Add a flat file Target transformation and specify the target object for the transformation. Perform the following steps:
    1. aSelect a flat file connection for the target transformations to write data to the flat file.
    2. bDraw a link to connect the previous transformation to the Target transformation.
    3. cCreate a target object Bex_query.csv file to write data to the target.
    4. dMap the fields that you want to link to the target fields.
  11. 8Click Save and New Mapping Task to save and create a mapping task.
  12. The following image shows the Mapping Task wizard with the applied mapping:
  13. The Mapping Task wizard shows the applied mapping that you can run.
  14. 9Under Advanced Options on the Runtime Options tab, specify the parameter file name parameterfile_name.txt in which you configured the filter parameter value for the request XML
  15. 10When you save and run the mapping, the Secure Agent retrieves the specified project plan from SAP BW BEx Query and writes the data to the corresponding flat file.
  16. The target flat file shows the following data extracted from the specified project plan after you run the task:
    "Document_Number__CPD_FDOCNUM","Structure_Element__CPD_FPID","Profile__CPD_FPROFILE","Resource__CPD_FRES","Resource_Type__CPD_FRTYP","Client_0CLIENT",
    "Calendar_Year_Month_0CALMONTH","UOM_Converted__CPD_FCUOM","UoM__CPD_FUOM","Margin_DB8FOYXR0W5E3AMR9959IG0ER","Quantity_DB8FOYXR0W5E3AMR9959IGJDF",
    "Cost__Plan__DB8FOYXR0W5E3AMR9959IGD1V","Revenue__Plan__DB8FOYXR0W5E3AMR9959IG6QB","Cost__EAC__DB8FOYXR0W5E3AMR9959IGPOZ","Var_Temp"
    ,"800PR00004446",,"800ZMRS0MRS1429","800ZMRS0MRS",,,,,-12,0,1200,0,20000,"PR00004446"
Note: You can also read data from an SAP BW BEx query by using a Web Services transformation.
For more information, see the Informatica How-To Library article, "Configuring a Web Services Transformation in Informatica Cloud Data Integration to Read Data from an SAP BW BEx Query". To get the Informatica How-To Library article, contact Informatica Global Customer Support.