Mapping and mapping tasks using BAPI/RFC functions
You can generate a BAPI/RFC mapplet in Data Integration. You can then configure a mapping with the mapplet to manage data in SAP systems.
For example, to update sales order data in SAP, generate a BAPI/RFC mapplet from the BAPI_SALESORDER_CHANGE function and configure a mapping using the mapplet.
You can configure a mapping with a BAPI/RFC mapplet to pass input data to BAPI/RFC function input parameters.
In advanced mode, the Mapping Designer updates the mapping canvas to include transformations and functions that enable advanced functionality.
To access the BAPI/RFC functionality through Data Integration, perform the following tasks:
1Generate a BAPI/RFC mapplet in Data Integration.
2Configure a mapping using the generated BAPI/RFC mapplet. Map the Integration ID field and other inputs and outputs. Save and run the mapping or create a mapping task using this mapping.
Configuring SAP BAPI Connector as a Business Service
You can configure SAP BAPI Connector as a business service within a mapping or a mapping task for SAP BAPI data integration.
You can generate a BAPI/RFC mapplet in Data Integration and use the mapplet in a mapping.
Perform the following steps to generate a BAPI/RFC mapplet:
1To create a mapplet, click Data Integration > New > Mapplets > Mapplet - SAP BAPI and then click Create.
To edit a mapplet, on the Explore page, navigate to the mapplet. In the row that contains the mapplet, click Actions and select Edit.
2Enter a unique name for the BAPI/RFC mapplet.
3Optionally, enter a description for the BAPI/RFC mapplet that you want to generate.
4Select the transformation type as BAPI.
5 Select the BAPI/RFC connection that you want to use.
6Select the scope of the transformation.
For real-time processing, select the transformation scope as Transaction. For batch processing and validation in a non-production environment, select the transformation scope as All Input.
7 Enter the name of the BAPI/RFC function.
You can also search for a BAPI/RFC function by entering % as a wildcard character along with the search string. For example, to search for all BAPI/RFC functions whose names start with the term Customer, enter the search string as Customer%. To search for all BAPI/RFC functions whose names end with the term Customer, enter the search string as %Customer.
8Click Get Objects.
The Select Source Object dialog box appears displaying the search results. You can drill down the search results further by entering a search string in the Select Source Object dialog box.
9Click the required BAPI/RFC function name and click Select.
The import, export, and table parameter details of the BAPI/RFC function appear.
10Specify the direction for the tables to indicate if the table parameters in the BAPI are input, ouput, or both.
11Click Save.
The mapplet for the specified BAPI/RFC function is created. You can create a mapping for the generated mapplet.
Configuring a mapping with a BAPI/RFC mapplet
1To create a mapping, click Data Integration > New > Mappings. Select Mapping and click Create.
2Enter a name and description for the mapping, and click OK.
You can use alphanumeric characters and underscores (_) in the mapping name.
3To configure a source, on the Transformation palette, click Source.
4In the Properties panel, on the General tab, you can enter a name and description.
5Click the Source tab and configure the source details.
Source details and advanced source properties appear based on the connection type.
6To add a BAPI/RFC mapplet transformation, on the Transformation palette, click Mapplet.
aOn the General tab, enter a name and description for the mapplet.
bDraw a link to connect the previous transformation to the mapplet transformation.
cOn the Mapplet tab, click Select.
The Select Mapplet dialog box appears.
dSpecify a BAPI/RFC mapplet that you generated in Data Integration and click OK.
eClick Connection to specify an SAP RFC/BAPI Interface connection. You can create a connection, select a connection, or specify a parameter name for the connection.
fTo preview fields, configure the field rules, or rename fields, click Incoming Fields.
gClick Field Mapping and map the incoming source fields with the Integration ID in the BAPI/RFC mapplet.
7To add any other transformation, on the Transformation palette, click the transformation name. Or, drag the transformation onto the mapping canvas.
aOn the General tab, enter a name and description for the transformation.
bDraw a link to connect the previous transformation to the transformation.
When you link transformations, the downstream transformation inherits the incoming fields from the previous transformation.
For a Joiner transformation, draw a master link and a detail link.
cTo preview fields, configure the field rules, or rename fields, click Incoming Fields.
dConfigure additional transformation properties, as needed.
The properties that you configure vary based on the type of transformation you create.
eTo add another transformation, repeat these steps.
8To add a Target transformation, on the Transformation palette, click Target.
aOn the General tab, you can enter a name and description.
bDraw a link to connect the previous transformation to the Target transformation.
cClick the Target tab and configure target details. If necessary, configure the advanced target properties.
Target details and advanced target properties appear based on the connection type.
dTo preview fields, configure the field rules, or rename fields, click Incoming Fields.
eClick Field Mapping and map the fields that you want to write to the target.
fTo add another Target transformation, repeat these steps.
9Save and run the mapping or save and create a mapping task.
For more information about transformations, see Transformations.
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 Data Integration for the bapi_salesorder_createfromdat1 BAPI function.
Log in to Data Integration 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:
1Specify 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.
2Add the Mapplet transformation. Draw a link to connect the flat file Source transformation to the Mapplet transformation. Draw the following links:
▪ ORDER_HEADER_IN source object to the Scalar_Input input port of the BAPI mapplet.
▪ ORDER_ITEMS_IN source object to the Table_Input_Order_Items_IN input port of the BAPI mapplet.
▪ ORDER_PARTNERS source object to the Table_Input_Order_partners input port of the BAPI mapplet.
3Configure the mapplet transformation.
aSelect the generated mapplet. Verify that you specify an SAP RFC/BAPI Interface connection for the mapplet.
bMap the incoming source fields with the BAPI parameter properties.
4Configure 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:
▪ ORDER_CFGS_BLOB, ORDER_CFGS_INST, ORDER_CFGS_PART_OF, ORDER_CFGS_REF, and ORDER_CFGS_VALUE to write item configuration data.
▪ ORDER_ITEMS_OUT to write detailed item data.
▪ ORDER_CCARD to write the credit card details.
▪ ORDER_SCHEDULE_EX to write the structure of VBEP with English field names.
▪ Scalar_Output to write the Scalar_Output from the mapplet.
▪ Error_Output to write the Error_Output from the mapplet.
Step 1: Generating a BAPI/RFC mapplet in Data Integration for the BAPI_SALESORDER_CREATEFROMDAT1 BAPI function
Perform the following steps to generate a BAPI/RFC mapplet:
1To create a mapplet, click Data Integration > New > Mapplets > Mapplet - SAP and then click Create.
To edit a mapplet, on the Explore page, navigate to the mapplet. In the row that contains the mapplet, click Actions and select Edit.
The New SAP Mapplet page appears. The following image shows the New SAP Mapplet page:
2Enter a unique name for the BAPI/RFC mapplet.
3Optionally, enter a description for the BAPI/RFC mapplet you want to generate.
4Select the transformation type as BAPI.
5 Select the BAPI/RFC connection that you want to use.
6Select 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.
7Enter 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.
8Click Get Objects.
You can view the import, export, and table parameter details of the BAPI/RFC function.
9Specify the direction for the tables to indicate if the table parameters in the BAPI are input, ouput, or both.
10Click 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
1To create a mapping, click Data Integration > New > Mappings. Select Mapping and click Create.
2Enter a name and description for the mapping, and click OK.
3To configure the flat file source, on the Transformation palette, click Source.
4In the Properties panel on the General tab, enter a name and description.
5Click the Source tab and configure the source details.
aSelect a flat file connection.
bSelect Single Object as the Source Type.
cClick Select to specify a flat file that contains the source fields.
The following image shows the flat file source details:
6Add order header, order items, and order partners as flat file source objects for the mapping.
7To add a BAPI/RFC mapplet transformation, on the Transformation palette, click Mapplet.
aOn the General tab, enter a name and description for the mapplet.
bDraw a link to connect the flat file Source transformation to the Mapplet transformation.
cOn the Mapplet tab, click Select.
The Select Mapplet dialog box appears.
dSelect the bapi_salesorder_createfromdat1 mapplet and click OK.
eClick Connection to specify an SAP RFC/BAPI Interface connection.
The following image shows the bapi_salesorder_createfromdat1 mapplet details:
fTo preview fields, configure the field rules, or rename fields, click Incoming Fields.
gClick Field Mapping and map the incoming source fields with the appropriate mapplet input fields.
The following image shows the field mapping of the incoming source fields with the mapplet input fields:
8To add a flat file target, on the Transformation palette, click Target.
9On the General tab, enter a name and description for the target.
10Click the Target tab and configure target details.
aSelect a flat file connection for the target.
bSelect Single Object as the Source Type.
cClick Select to specify the target object.
The Target Object dialog box appears.
dSelect the flat file object, and click OK.
eOptionally, you can choose to forward rejected rows in the Advanced Target options.
fRepeat the above steps to add all the flat file target objects.
The following image shows the target transformation details:
11Draw 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:
12Save and run the mapping.
SAP mapplet properties
You can commit data, cache data, and handle errors for the target in an SAP BAPI/RFC mapping task.
To configure the SAP mapplet properties for the target, click the Runtime Options tab of the SAP BAPI/RFC mapping task. Expand the SAP Mapplet Properties section, and configure the mapplet properties.
The following table describes the commit properties you can configure in an SAP BAPI/RFC mapping task:
Property
Description
Perform Commit
Issues a commit with a BAPI commit function.
If you disable this option, Data Integration does not call a commit function. It also ignores the commit interval and does not wait for a commit to continue to run the mapping task.
Default is enabled.
Perform Commit Wait
Waits until the commit is complete to continue to run the mapping task. SAP sends a return call to Data Integration when the commit is complete.
If you disable this option, Data Integration continues to process data during the commit.
Default is enabled.
Commit Interval
Number of BAPI/RFC calls after which Data Integration issues a commit. To issue a commit, Data Integration makes a BAPI/RFC commit call.
If you disable the Perform Commit option, Data Integration ignores this value.
Default is 1000.
Commit Function
Determines how Data Integration makes a BAPI/RFC call when it issues a commit.
Data Integration makes the call either from outside SAP or from within BAPI based on the following options you select:
- ABAP4_COMMIT_WORK. Makes a BAPI/RFC call from ABAP and then issues a commit.
- BAPI_TRANSACTION_COMMIT. Makes call from outside SAP and then issues a commit.
If you disable the Perform Commit option, Data Integration ignores this value.
Default is BAPI_TRANSACTION_COMMIT.
The following table describes the data caching properties you can configure in an SAP BAPI/RFC mapping task:
Property
Description
Cache Directory
Default directory used to cache BAPI data. By default, the cache files are created in a directory specified by the variable $PMCacheDir.
If you override the directory, make sure the directory exists and contains enough disk space for the cache files.
Cache Size
Total memory in bytes allocated to Data Integration to cache data prepared for BAPI/RFC mapplets.
Default is 10 MB.
The following table describes the error handling properties you can configure in an SAP BAPI/RFC mapping task:
Property
Description
Duplicate Parent Row Handling
Determines how Data Integration handles duplicate parent rows in a mapping task.
Select one of the following options:
- First Row. Passes the first duplicate row to the target. Data Integration rejects rows with the same primary key that it processes after this row.
- Last Row. Passes the last duplicate row to the target.
- Error. Data Integration passes the first row to the target. Rows that follow with duplicate primary keys increment the error count. The mapping task fails when the error count exceeds the error threshold.
Default is First Row.
Orphan Row Handling
Determines how Data Integration handles orphan rows in a mapping task.
Select one of the following options:
- Ignore. Ignores orphan rows.
- Error. The mapping task fails when the error count exceeds the error threshold.
Default is Ignore.
Continue on Error
Determines if you want to continue to run the mapping task when a BAPI/RFC error is encountered.