BAPI

This topic describes how to send the Customer number from Excel to SAP and retrieve Customer Name, City, Region, Country Key, and Customer Account Group data elements for those customers and place that data in Excel in the different columns using BAPI_CUSTOMER_GETDETAIL2. This Business API (BAPI) is provided by SAP in most SAP releases.

For information about BAPI recording, see Video Tutorial of BAPI.

To record and run a BAPI/RFM Process file

  1. To record the Process file, perform the following steps:
    1. Select File > New Process > New RFM/BAPI or select BAPI/RFM (BA) available on the left side of the New Process window.
    2. Enter BAPI_CUSTOMER_GETDETAIL2 in the BAPI/RFM Name box.
    3. Optionally, select More.... Additional recording options are displayed.
    4. Select Start Recording. The Magnitude Connector for SAP window is displayed. Perform the following steps:
      1. Select the SAP system, select Logon, and enter the information for Client, User, Password, and Language.
      2. Select OK. Process Runner displays a progress bar to indicate that the recording is in progress.
  2. Process Runner builds the BAPI interface as defined in that SAP system and opens the [BAPI_Customer_Getdetail2 | *New*] Process file as a new file with the Mapper tab open.
  3. To configure the additional settings for BAPI, download the sample data Excel file from BAPI_Download_Customer_Master.xlsx and perform the following steps:
    1. On the Home tab, browse to the Excel file in the Excel File box and select Sheet1 in Sheet name. The results are retrieved in sheet 1 of the Excel file.
    2. To determine the range of numbers that you want to run the retrieval for, enter the Start row and End row.
    3. Set the required options in the Logon And Control Parameters window.
  4. To map the data elements between Excel and SAP, such as instructing Process Runner where to place the customer information that it receives from SAP when a call is made, perform the following steps:
    1. Select Mapper and select the CUSTOMERNO field in Parameter Name column or Customer Number 1 in Field Description column.
    2. Select the mapping type to Excel To SAP.
    3. If the list of the customer numbers is in column A in Excel, assign Map Value to A.
    4. Switch to Advanced View and go to the Dynamic Formula column. For the CUSTOMERNO field, set Add leading zeroes and Length to 10 because the field accepts a 10-digit field. If the customer number is not a 10-digit, leading zeroes are appended to make it a 10-digit code.
    5. In the mapper grid, select the Download from SAP tab and change the mapping type of the Name 1 column to SAP to Excel.
    6. Change the mapping type of the City column to SAP to Excel and save the changes.
    7. Optionally, map the other fields.
  5. To save the Process file, select FileSaveSave As Local, enter the name for the Process file, and select Save. The file is saved with the current date and time. Optionally, you can change the file name and save it.
  6. To run the file, select Run. The customer number from Column A in Excel is taken and this BAPI is run. When SAP returns the result, the selected fields are placed in the various columns in Excel.