Skip to Content
Author's profile photo Former Member

Calling RFC BAPI within SAP Data Services

Published By : Satish Boda, SAP Global Delivery | SAP Consulting.

Technology: SAP Data Services, SAP Bank Analyzer.

Below are the End-to-End steps for writing legacy “Financial Transaction” data to SAP Bank Analyzer by calling RFC BAPI “FIN_TRANS_MODIFY”.

Establish connectivity :-

Install R/3 functions on SAP BANK ANALYZER Web Application Server (WAS).

Establish RFC connectivity between SAP BANK ANALYZER and SAP DATA SERVICES.

Build SAP Data Services Job :-

Login to the SAP Bank Analyzer system. Launch “BAPI Explorer” via T-code “BAPI” in SAP Bank Analyzer.

/wp-content/uploads/2012/07/b1_122034.png

Create DATASTORE of type “SAP Applications” by entering the parameters of BANK ANALYZER system.

/wp-content/uploads/2012/07/b_2_122035.png

Import BAPI metadata in SAP DATA SERVICES.

B_3.png

The BAPI metadata looks like below with input and output parameters.

/wp-content/uploads/2012/07/b_4_122037.png

The input parameters are of 2 types : Scalar & Table parameters.

B_5.png

Create a nested NRDM structure for the source data similar to BAPI Input structure.

B_6.png

Make a “new function call” to call the BAPI.

/wp-content/uploads/2012/07/b7_122040.png

Map the input columns to the BAPI scalar parameters using the wizard. Take the help of scrolling option.

/wp-content/uploads/2012/07/b8_122041.png

Map the input schema to the BAPI Table parameters as below.

Prerequisite:-

  • Ø The column names of the input schema should match to the names of the BAPI input table. The input columns are mapped automatically to the BAPI table columns by matching column names.
  • Ø The input data type of columns should to be similar to the column data type of BAPI.

/wp-content/uploads/2012/07/b9_122045.png

Select the RETURN table as output schema.

/wp-content/uploads/2012/07/b10_122046.png

After hitting finish, the query appears as below.

/wp-content/uploads/2012/07/b11_122047.png

Un-nest the RETURN table to write the details to a database table.

/wp-content/uploads/2012/07/b12_122048.png

Run the Job :-

The RETURN table captures the messages returned by BAPI. This data can be analyzed to find successful entries.

/wp-content/uploads/2012/07/b13_122049.png

Assigned Tags

      9 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      It was nice topic! It is pretty good.

      Can you please tell me the how to call oracle stored procedure in sap bods?

      Author's profile photo Former Member
      Former Member

      Soumen Roy  

      Hi Satish ,nice tute,but I need more doc to clear BAPI concept .So please post some material for BAPI with screen cap.

      T&R

      Soumen

      soumenroym2007@yahoo.in

      Author's profile photo Johann Cornelius
      Johann Cornelius

      Nice write up, I however have a problem with the output table. I get a"Unknown SAP Output Data error" which appears to happen when there are too many output parameters. I can not change the function to reduce the number of parameters so do you have any other solution.

      Author's profile photo Former Member
      Former Member

      Nice write up! When you create your nested structure, do you do any joins?

      "Create a nested NRDM structure for the source data similar to BAPI Input structure."

      Currently I'm calling material creation bapi which has header and then tables. And my tables appear to be including data for every material. How do I ensure the bapi call includes only one item at a time?

      Author's profile photo SRINIVAS K
      SRINIVAS K

      HI,

      Nice document.

      I have one query here that how to pass table data to RFC/BAPI through BODS.

      Thanks In advance...

      Author's profile photo Rajesh Sinha
      Rajesh Sinha

      Very helpful article on calling BAPI from BODS

      Author's profile photo Lavneet Tambey
      Lavneet Tambey

      Adding details steps for calling BAPI in bods :-

      Steps to call BAPI into BODS

      1 – Import BAPI (BAPI_CUSTOMER_HIERARCHIE_INS)  into SAP datastore – Function – Import by name .

      2 – Open the BAPI by right click and open .

      3 – Copy Node (Table) by right click and copy :-

      4 – Add query transform into dataflow and double click it and right click on output schema and paste it  :-

      5 – Complete the mapping by making Node as Current (Right click and select Make Current) :-

      6 – Right click and Make current to Query and apply where clause as Gen_row_num=1 to populate duplicate records into target (Gen_Row_Num function must be use into previous qry transform of calling BAPI) :-

      7 – From clause should be checked for all nodes  (This is mandatory else bods will give error) :-

      8 – Call BAPI into query by right click and selecting “New Function call” :-

      9 – Map all input required parameters and select on Next and select Return parameter as target and RFC_Retcode.

      10 – Add new qry transform and drag RFC_Retcode and Nodelist as return parameter .

      11 – If return parameter is in format of Table (nodes) then right click and select on Unnest  (It is mandatory else bods will give error) :-

      12 – Add target table and validate the job and execute it .

      Author's profile photo Jayaraju Krishnamurthy
      Jayaraju Krishnamurthy

      Lavneet , Thanks for the detailed steps.

      Can you please provide screen shots for steps 5 , 6 and 7. I am not able to follow, Thanks much...

      Author's profile photo Lavneet Tambey
      Lavneet Tambey

      Just added all screenshot . Thanks for suggestion .