Inbound Processing Tutorial

In this tutorial, BAPI of SAP system is executed from DataSpider Servista script. RFC, IDoc can be executed in the same flow.
As a concrete process, SAP was to get banking information system for the BAPI "Bank. GetList "run, the acquired data to an XML file.

Configuration in Tutorial

In this tutorial, the following configuration is assumed. Please change it according to the actual environment.

Item name Value
R/3 server DEVECC2
System Number 00
Client Number 300

Preparation in Advance

  1. Prepare RFC User
    Registers RFC user for DataSpider Servista to the client to connect. If already registered, it is not necessary to register again.
    In general, creates user with type of "Communications data" or "System".

    Prepare RFC User

SAP Business Connector Settings

SAP Business Connector need to be set to execute inbound processing.
For more information about SAP BC settings, please refer to the manual of SAP BC.
  1. Check SAP BC startup
    Access to SAP BC by Web browser with the URL below.
    "http://<hostname>:<port>/"

    Item name Description
    hostname The host name or IP Address of the OS on which SAP BC operates
    port The port number that SAP BC is started.

    By default, the following is set.

    Item name Value
    Port number 5555
    User name Administrator
    Password manage

  2. Create SAP BC user
    Create user for DataSpider Servista in SAP BC. If already created, it is not necessary to create again.

    Press "Security"-"Users and Groups" of SAP BC to open ""Users and Groups" screen.

    User/Group Menu

    Press "Add and Remove Users" to open Create New User screen.

    Create User

    Enter the user name and password, press "Create Users" button.

    Crate User Succeeded

  3. Connection settings to SAP system
    Set connection to SAP system in SAP BC. If already set, it is not necessary to set again.

    Press "Adapters" - "SAP" to open SAP server setting screen.

    SAP Menu

    SAP server

    Press "Add SAP Server" and enter the information of the SAP system to connect. The settings are as follows.

    Item name Description
    Name Name on display
    User User name to log in to SAP system
    For tutorial, enter "RFC".
    Password Password of the user to log in to SAP system
    Client Client Number
    For tutorial, enter "300".
    Application Server The host name or IP address of the SAP system
    For tutorial, enter "DEVECC2".
    System Number System Number
    For tutorial, enter "00".

    Add SAP Server

    Enter the required information and press "Save" button.

    Press the names of the added SAP system to open SAP system setting screen.

    SAP server list

    Press "Test Connection" button of the SAP system setting screen to test connection.

    Connection test

  4. Get XML template
    Gets XML template as the input schema of SAP BC adapter.

    Press "Adapters" - "SAP" to open SAP server setting screen.

    SAP Menu

    Press "Lookup" to open the module searching screen.

    Lookup Menu

    Enter the following information on the module searching screen and press "bXML" button.

    Item name Value
    Business Object Bank
    BAPI GetList

    Bank.Lookup of GetList

    Bank.bXML of GetList

    When getting XML template of RFC general module, enter the RFC general module name to execute to "Function Name" and press "RFC-XML" button.
    Please contact SAP corporation about how to get XML template of IDoc.

  5. Action Check on SAP BC
    Check the action on SAP BC.

    Enter the following test value to the shown XML template.

    Element name Value
    BankCtry JP
    MaxRows 10

    Test value changes depending on the used module or customization of SAP system. For more information, please contact the application consultant of SAP

    Bank.GetList test execution

    Press "Invoke" button to test execution.

    Invoke button

    Bank.GetList test execution succeed


  6. Store XML template for Input data
    Create input data of SAP BC from the XML template data.

    Select from <doc> element to </doc> element of XML template, copy it, and save as a file under the directory below. Create the directory if necessary.

    Item name Value
    Pass /data/sapbc/bapi_inbound/bank_getlist_input.xml

    Bank.GetList Input Schema

    Use from <rfc> element to </rfc> element when creating input data for RFC general module.
    Input data for IDoc is all IDoc type elements. When executing ALEREQ01, uses all ALEREQ01 elements including control record/data record.

Call from SAP BC Adapter

BAPI "Bank.GetList" call from the adapter to the SAP BC.
  1. Completed Script Image
    XML input data retrieved by the adapter, SAP BC through the adapter BAPI "Bank. GetList" passes, SAP system data to an XML result returned by the adapter.

    Completed Script

  2. Create Global Resource
    Create global resource of SAP BC adapter in the [Global Resource Settings] of [Control Panel].

    Sets the following value on the Global Resource Setting screen of SAP BC adapter. Uses default value for other property settings.
    For more information about the settings, refer to "Global Resource Properties" .

    Item name Value
    Name SAP BC 4.8 Connection Settings
    Hostname For tutorial, enter "sapbc".
    Port number For tutorial, enter "5555".
    User name For tutorial, enter "user".
    Password Enter the password of the user to connect to SAP BC system.
    SAP system name For tutorial, enter "SAPSYSTEM".

    Create SAP BC Global Resource

  3. Create Project and Script
    Creates project and script of the follows.

    Item name Value
    Project Name SAP BC Adapter Tutorial
    Script Name Inbound BAP

  4. Edit XML template for Input data
    Edit XML template for input data stored in "/data/sapbc/bapi_inbound/bank_getlist_input.xml" and enter the following data.

    Element name Value
    BankCtry JP
    MaxRows 3

    <?xml version="1.0" encoding="Shift_JIS"?>
    <doc:bBank.GetList xmlns:doc="urn:sap-com:document:sap:business" xmlns="">
      <BankCtry>JP</BankCtry>
      <MaxRows>3</MaxRows>
    </doc:Bank.GetList>
    

  5. Test value changes depending on the used module or customization of SAP system. For more information, please contact the application consultant of SAP.

  6. Create Read XML File
    Place "File" - "XML" - "Read XML file" of tool palette on Script Canvas.
    Set the following values in the property settings dialog of Execute Inbound.

    Category Item name Value
    Basic settings Name Read XML file
    Required settings File /data/sapbc/bapi_inbound/bank_getlist_input.xml

  7. Create Execute Inbound
    Place "Application" - "SAP BC" - "Execute Inbound" of Tool Palette to Script Canvas.
    Set the following values in the property settings dialog of Execute Inbound.
    For more information on each property item, please refer to "Execute Inbound" .

    Category Item name Value
    Basic settings Name Bank.Inbound run GetList
    Input data Read XML file
    Required settings Destination SAP BC 4.8 Connection Settings
    Interface BAPI
    Sender For tutorial, enter "External".
    Receiver For tutorial, enter "SAP".

    Execute Inbound Required Settings

  8. Create Write XML File
    Place "File" - "XML" - "Write XML file" of tool palette on Script Canvas.
    Set the following values in the property settings dialog of Write XML File.

    Category Item name Value
    Basic settings Name Write XML File
    Input data Bank.Inbound run GetList
    Required settings File /data/sap/bapi_inbound/bank_getlist_output.xml

  9. Process Flow Settings
    Connect each created operation with process flow in the following order.

    Order Name
    1 Read XML file
    2 Bank.Inbound run GetList
    3 Write XML File

    Completed Script

    This completes the script setting.

  10. Routing Rules setting
    To call SAP system processing from SAP BC, routing rules need to be set in SAP BC. By executing the created script, the routing rules can be easily set.

    Executes the created script "BAPI Inbound" and routing rules are registered to SAP BC.
    Press "Routing..."-"Routing Rules" to open the routing rules list.

    Routing Menu

    Bank.GetList Routing

    Press the "Edit" button of the registered routing rule and open the editing screen of routing rules. Enter the following values and press "Save" button.

    Edit routing button

    Item name Value
    Transport BAPI

    Bank.GetList Routing Transport

    When executing RFC general module, set "RFC" to "Transport"
    When executing IDoc, set "ALE (R/3 IDOC)" to "Transport".

    Bank.Edit GetList Routing Completed

    Press "No" of "Enabled?" column to set to "Yes".

    Enable Routing

    Bank.Enable GetList Routing Completed

  11. Execute script
    Execute script "Inbound BAPI".

    "/data/sapbc/bapi_inbound/bank_getlist_output.xml" file BAPI "Bank.GetList" output is a result of running.

    <?xml version="1.0" encoding="Shift_JIS"?>
    <biztalk_1 xmlns="urn:biztalk-org:biztalk:biztalk_1">
      <header>
        <delivery>
          <message>
            <messageID>A9FE3725F70D8DB5000021F9</messageID>
            <sent>2010-06-02T22:30:42</sent>
          </message>
          <to>
            <address>urn:sap-com:logical-system:SAP</address>
          </to>
          <from>
            <address>urn:sap-com:logical-system:External</address>
          </from>
        </delivery>
      </header>
      <body>
        <doc:Bank.GetList.Response xmlns:doc="urn:sap-com:document:sap:business" xmlns="">
          <BankList>
            <item>
              <BANK_CTRY>JP</BANK_CTRY>
              <BANK_KEY>0000001</BANK_KEY>
              <BANK_NAME>Test Bank 1</BANK_NAME>
              <CITY>TOKYO</CITY>
            </item>
            <item>
              <BANK_CTRY>JP</BANK_CTRY>
              <BANK_KEY>0000002</BANK_KEY>
              <BANK_NAME>Test Bank 2</BANK_NAME>
              <CITY>TOKYO</CITY>
            </item>
            <item>
              <BANK_CTRY>JP</BANK_CTRY>
              <BANK_KEY>0000003</BANK_KEY>
              <BANK_NAME>Test Bank 3</BANK_NAME>
              <CITY>TOKYO</CITY>
            </item>
          </BankList>
          <Return>
            <TYPE/>
            <ID/>
            <NUMBER>000</NUMBER>
            <MESSAGE/>
            <LOG_NO/>
            <LOG_MSG_NO>000000</LOG_MSG_NO>
            <MESSAGE_V1/>
            <MESSAGE_V2/>
            <MESSAGE_V3/>
            <MESSAGE_V4/>
            <PARAMETER/>
            <ROW>0</ROW>
            <FIELD/>
            <SYSTEM/>
          </Return>
        </doc:Bank.GetList.Response>
      </body>
    </biztalk_1>