Skip Headers
Oracle® Application Server Adapter for SAP R/3 User's Guide
10g Release 2 (10.1.2)
B14061-02
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

6 InterConnect Integration Examples

This chapter contains the following examples:

The event and service scenarios shown depend on the following prerequisites and configuration steps:

Prerequisites


See Also:

Oracle Application Server Adapters Installation Guide

Configuration Steps

The examples present all the configuration steps necessary for demonstrating service and event integration with SAP. See the following for more information:

  1. Configure SAP for outbound processing. See Appendix A, "Configuring SAP for Inbound and Outbound Processing" for more information.

  2. Configure the OracleAS Adapter for SAP for services and events. See Chapter 2, "Configuring OracleAS Adapter for SAP" for more information.

  3. Configure OracleAS Integration InterConnect iStudio for service and event interactions. For more information, see the service and event steps that follow.

Creating Events

The following example describes how to create events for DEBMAS05 and how to create a channel and a port.

  1. Open Application Explorer.

  2. Expand the Adapters node.

    Disconnected SAPTarget node
    Description of the illustration connect1.gif

    Perform the following steps:

    1. Expand the SAP node.

    2. Click the target name, for example, SAPTarget, under the SAP node.

    The Connection dialog box opens, populated with values you entered.

  3. Verify your connection parameters. If required, provide the password.

  4. Right-click the target name and select Connect.

    The x icon disappears, indicating that the node is connected.

    select SAP node
    Description of the illustration select_sap.gif

  5. Expand the ALE(IDOCS) node and select DEBMAS.

    select DEBMAS05
    Description of the illustration selectdebmas.gif

  6. Expand the DEBMAS list and select DEBMAS05.

Creating Events for DEBMAS05

To create events for DEBMAS05:

Create Event Port
Description of the illustration selecteventport.gif

  1. Right-click the DEBMAS05 node and select Create Event Port.

    The Create Event Port dialog box is displayed.

    Create Event Port dialog box
    Description of the illustration eventportdialog.gif

    Perform the following steps:

    1. Type a name for the event port and provide a brief description.

    2. From the list, select the required disposition, for example, RMI.

    3. Type the disposition URL.

    4. Type (or browse to) the path containing the DTD directory.

  2. Click OK.

    The port appears under the ports node in the left pane.

    ports node
    Description of the illustration eventportadded.gif

    In the right pane, a table appears that summarizes the information associated with the event port you created.

    detailed port information
    Description of the illustration eventportdetail.gif

    You can now associate the event port with a channel.

Creating a Channel

To create a channel:

  1. In the left pane, click the Events node.

  2. Expand the SAP node.

    The ports and channels nodes appear in the left pane.

    add channel
    Description of the illustration addchannel.gif

  3. Right-click Channels and select Add Channel.

    The Add Channel dialog box opens.

    Add Channel dialog box
    Description of the illustration addchanneldialog.gif

    Perform the following steps:

    1. Type a name for the channel, for example, TEST_CHANNEL.

    2. Type a brief description.

    3. From the Protocol list, select SAP Channel.

    4. Select an event port from the list of available ports. To select more than one, hold down the Ctrl key and click the ports.

    5. To transfer the ports to the list of selected ports, click the double right (>>) arrow button.

  4. Click Next.

    The Application Server dialog box opens.

    system tab
    Description of the illustration channelsystemtab.gif

    The following tabs are available:

    • System (Required)

    • User (Required)

    • Advanced

  5. For the System tab, type the appropriate information for your SAP channel, based on the information in the following table.

    Table 6-1 System Tab Parameters

    Target Parameter Description

    Gateway host

    A host name for the SAP Gateway.

    Gateway service

    A service for the SAP Gateway.

    Program ID of the server

    An SAP program ID you want to use for this channel.

    Application Server

    A host name for the application server.

    System number

    A system number for SAP.


  6. Click the User tab.

    user tab
    Description of the illustration channelusertab.gif

  7. For the User tab, type the appropriate information for your SAP channel, based on the information in the following table.

    Table 6-2 User Tab Parameters

    Target Parameter Description

    Client

    The client number defined for the SAP application for client communications.

    User

    A valid user ID for the SAP application.

    Password

    A valid password for the SAP application.

    Language

    A language key. EN (English) is the default.

    Code page

    A character code page value.


  8. For the Advanced tab (optional), type the appropriate information for your SAP channel, based on the information in the following table.

    Table 6-3 Advanced Tab Parameters

    Target Parameter Description

    IDoc Format

    Select an IDoc type from the list.

    User Defined Function Modules

    Enter the path to the user-defined function module you created.

    SAP trace

    Select this check box if you want to enable SAP traces for troubleshooting purposes.

    Unicode

    Select this check box if you are expecting your response in Unicode format.

    Synchronous Processing

    Select the type of synchronous processing from the list.


  9. Click OK.

    The channel appears under the channels node in the left pane.

    An X over the icon indicates that the channel is currently disconnected. You must start the channel to activate your event configuration.

    channel added
    Description of the illustration channelstarted.gif

  10. Right-click the channel node and select Start.

    The channel you created becomes active.

    The X that was over the icon in the left pane disappears.

  11. To stop the channel, right-click the connected channel node and select Stop.

SAP Event Integration

This topic illustrates how OracleAS Adapter for SAP integrates with SAP to receive event data. The procedures describe design time and runtime. The example demonstrates how OracleAS Adapter for SAP integrates with SAP to receive event data. In this example, an SAP event occurs when a customer record is added to an SAP system. The adapter receives the SAP event customer data and disposes the data to an RMI event port. The RMI server resides on the OracleAS Integration InterConnect Hub. An OracleAS Database adapter on the OracleAS Integration InterConnect Hub subscribed to this event receives the customer data, transforms the event data, and then inserts the data into a database table. The design time and runtime procedures are outlined in the following sections.

OracleAS Integration InterConnect Design Time

The following procedures describe how to start the repository and create a common view and then publish and subscribe an event.

Starting the Repository

To start the repository, double-click the start.bat file located in the following directory:

D:\oracle\ora92InterCon\oai\9.0.4\repository\start.bat

Creating a Common View

To create a Common View:

  1. Start Oracle iStudio.

    Oracle iStudio with Design tab
    Description of the illustration new_proj.gif

  2. Open a new project.

  3. Open Common Views and Business Objects.

  4. Create a Business Object called CustomerFL and a new event under CustomerFL.

Create event
Description of the illustration image004.gif


Note:

The event name must be the root element of the DTD generated from Application Explorer. In this example, the root element in the DTD is DEBMAS05.

  1. Click Import and select XML from the list.

    Open DTD
    Description of the illustration image006.gif

  2. Open the DTD generated from Application Explorer.

    Select root element
    Description of the illustration image008.gif

  3. Select the root element, which must be identical to the event name specified earlier.

    Edit event
    Description of the illustration image010.gif

  4. Click Save.

Publishing an Event

To publish an event:

  1. Create a new application called SAPFL.

  2. Expand SAPFL.

  3. Right-click Publish Events and select New.

    Select event
    Description of the illustration image012.gif

  4. Select XML as the message type and select DEBMAS05 under the CustomerFL business object as the event.

  5. Click Next.

    Define Application View
    Description of the illustration image014.gif

  6. Click Import and select Common View from the list.

    The structure from the selected Common View loads.

    Define Application View
    Description of the illustration image016.gif

  7. Ensure you enter the root element of the XML message, for example, DEBMAS05.

  8. Click Next.

  9. Click New to create a mapping between the Common View and Application View.

    In this example, the Application View and Common View have the same structure. All the attributes can be mapped by using the ObjectCopy transformation.

    Mapping Parameters
    Description of the illustration image018.gif

  10. Click Apply, OK, and then Finish.

    The application definition for a published event is now complete.

Subscribing an Event

To subscribe an event:

  1. Create a new application called DBAPP.

  2. Expand DBAPP.

  3. Right-click Subscribe Events and select New.

    Select Event
    Description of the illustration image020.gif

    Perform the following steps:

    1. Select Database as the message type.

    2. Under the CustomerFL business object, select DEBMAS05 as the event.

  4. Click Next.

    Define Application View
    Description of the illustration image022.gif

  5. Click Import and select Database from the list.

    The Database Login dialog box is displayed.

    Database Login
    Description of the illustration image024.gif

  6. Type the appropriate login credentials and click Login.

    Oracle Database Browser
    Description of the illustration image026.gif

    Perform the following steps:

    1. Expand the DBAPP schema.

    2. Select the previously defined table, in this example, DBAPP.CUSTOMER2.

  7. Click Next.

  8. Click New to define mapping between the Application View and the Common View.

    Mapping Parameters
    Description of the illustration image028.gif

    Perform the following steps:

    1. Define the mapping for each field.

    2. After you map each field, click Apply.

  9. When you have finished the mapping process, click OK.

    The SQL code window is displayed.

    1. Select sub_DEBMAS05_OAI_V1 from the SQL code list.

      The procedure details are displayed.

    2. Enter the appropriate code, if necessary.

      In the following example, the INSERT statement is entered between BEGIN and END to insert received event data into the Customer2 table.

      This script must be executed to insert event data into the database table.

      SQL Code
      Description of the illustration image030.gif

  10. Click Finish.

    The application definition for a subscribed event is now complete.

OracleAS Integration InterConnect Runtime

The following topic describes how to trigger an event in SAP to verify event integration using OracleAS Adapter for SAP.

Triggering an Event

To trigger an event in SAP:

  1. Start the SAP Workbench and log in to the SAP system.

    SAP Workbench
    Description of the illustration image032.gif

  2. Execute the bd12 transaction.

    Send Customers
    Description of the illustration image034.gif

    Perform the following steps:

    1. In the Customer field, enter a customer number with a range from 1 to 3.

    2. In the Output type field, enter DEBMAS.

    3. In the Logical system field, specify the logical system you are using with SAP.

  3. Click the check mark icon in the upper left-hand corner.

    Message Type
    Description of the illustration image036.gif

  4. Ensure DEBMAS appears in the Message type column.

    Customer master data is sent to the logical system specified. If a channel in Application Explorer defined the Program ID with the same value, the channel receives this customer master data from SAP.

SAP Service Integration

This topic illustrates SAP service integration. The procedures describe design time and runtime.

OracleAS Integration InterConnect Design Time

The following procedures describe how to start the repository and create a common view, and then define invoked and implemented procedures. The following also describes how to export PL/SQL code from iStudio.

Starting the Repository

To start the repository, double-click the start.bat file located in the following directory:

D:\oracle\ora92InterCon\oai\9.0.4\repository\start.bat  

Creating a Common View

To create a Common View:

  1. Start Oracle iStudio by double-clicking the start.bat file located in the following directory:

    D:\oracle\ora92iStudio\oai\9.0.4\istudio\iStudio.bat  
    
    

    iStudio is started.

    iStudio Open dialog box
    Description of the illustration new_proj.gif

  2. Open a project.

  3. Open Common Views and Business Objects.

  4. Create a Business Object called SAPGetDetailFL.

    Create Procedure dialog box with XML selected
    Description of the illustration get_detail_sapfl.gif

  1. Create a new procedure under SAPGetDetailFL and type GetDetail as the procedure name.

  2. Open the DTD generated from Application Explorer and load it.

    The Choose Root Element dialog box is displayed.

    select root element
    Description of the illustration sel_root_element.gif

  3. Select the root element, BAPI_COMPANYCODE_GETDETAIL, for this example.

  4. Click OK.

    Choose Import Type dialog box
    Description of the illustration in_arguments.gif

  5. Select IN arguments as the import type for the request DTD and click OK.

    Choose Root Element Dialog
    Description of the illustration root_element.gif

  6. Import the response DTD, select the root element, and click OK.

    The Choose Import Type dialog box is displayed.

    Choose Import Type dialog box
    Description of the illustration out_argument.gif

  7. Select OUT arguments as the import type for the response DTD and click OK.

    Out parameters screen
    Description of the illustration out_parms.gif

  8. Manually enter all the OUT parameters as shown in the previous image.

  9. To save the new procedure, click Save.

Creating an Invoked Procedure

To create an invoked procedure:

  1. Create a new application called DBAPP_SAP.

  2. Right-click Invoked Procedures and select New.

    The Invoke Wizard - Select a Procedure window is displayed.

    Invoke Wizard - Select a Procedure dialog box
    Description of the illustration get_detail.gif

    Perform the following steps:

    1. From the Message Type list, select DATABASE.

    2. Expand the SAPGetDetailFL business object as the event and select GetDetailFL.

  3. Click Next.

    The Invoke Wizard - Define Application View window is displayed.

    Invoke Wizard-Define Application View. Common View selected
    Description of the illustration sel_common_view.gif

    Perform the following steps:

    1. Click Import.

    2. Select Common View.

      Information appears in the right pane.

      synchronous check box
      Description of the illustration check_sync.gif

    3. Select the Synchronous check box, because this is a request and a response.

  4. Click Next.

  5. Click New to create a mapping between the Common View and the Application View for the IN parameters. Mapping Parameters window
    Description of the illustration map_params.gif

    In this example, the Application View and the Common View have the same structure. All the attributes can be mapped by using ObjectCopy Transformation.

    Mapping Parameters - GetDetailOUT
    Description of the illustration get_detail_out.gif

  6. Click Apply and then OK.

    iStudio generates SQL code.

    Invoke Wizard - Define Stored Procedure dialog box
    Description of the illustration invoked_proc.gif

  7. Click Finish.

    The application definition for the invoked procedure is now complete.

Defining an Implemented Procedure

To define an implemented procedure:

  1. Create a new application called SAPCompanyCodeFL.

  2. Expand SAPCompanyCode_FL.

  3. Right-click Implemented Procedure and select New.

    The Implement Wizard - Select a Procedure window is displayed.

    Implement Wizard - Select a Procedure dialog box
    Description of the illustration generic_msg.gif

    Perform the following steps:

    1. From the Message Type list, select Generic.

    2. Expand the SAPGetDetailFL business object and select GetDetail as the procedure.

  4. Click Next.

    1. Click Import.

    2. Select XML.

    3. Select the request and response DTDs generated by Application Explorer.

  5. Import the request and response DTDs into iStudio.

    Choose Root Element Dialog
    Description of the illustration root_element_dialog.gif

  6. Select BAPI_COMPANYCODE_GETDETAIL as the root element of the request DTD.

    The Choose Import Type dialog box is displayed.

    Choose Import Type dialog box
    Description of the illustration in_arguments.gif

  7. Select IN arguments as the import type for the request DTD and click OK.

    The Implement Wizard - Define Application View window is displayed.

    Implement Wizard - Define Application View dialog box
    Description of the illustration obj_name_field.gif

  8. Type the root element of the request DTD in the Object Name field, if it is not automatically populated after importing the request DTD and click Import.

    The Choose Root Element dialog box is displayed.

    Choose Root Element Dialog
    Description of the illustration bapi_cc_getdetail.gif

  9. Select BAPI_COMPANYCODE_GETDETAIL as the root element and click OK.

    Choose Import Type dialog box
    Description of the illustration out_argument.gif

  10. Select OUT arguments as the import type for the response DTD and click OK.

    Both the request and response DTDs are now imported into iStudio.

    Implement Wizard - Define Application View dialog box
    Description of the illustration imported_dtds.gif

  11. To define a mapping between the Application View and the Common View, click Next and then New.

    Mapping Parameters window
    Description of the illustration mapping_params.gif

    Because the Common View IN and the Application View IN have the same structure, ObjectCopy transformation is used for the mapping.

    Mapping Parameters window
    Description of the illustration custom_trans.gif

  12. Click Apply and then OK.

  13. To complete the definition of the implemented procedure, click Next and then Finish.

Exporting PL/SQL Code from iStudio

You must export the PL/SQL code created in "Defining an Implemented Procedure" and execute it against the appropriate schema. In this example, the schema used is DBAPP_SAP.

To export PL/SQL code from iStudio:

File menu - Export PL/SQL selected
Description of the illustration export_plsql.gif

  1. In iStudio, click File and Export PL/SQL.

    The Export Application dialog box is displayed.

    Export Application dialog box
    Description of the illustration export_msg.gif

    Perform the following steps:

    1. Select the application from which to export PL/SQL.

    2. Type or browse to the file prefix (path to the application).

  2. Click OK.

    In this example, two SQL scripts are created:

    • DBAPP_SAP_SAPGetDetailFLTYPES.sql

    • DBAPP_SAP_SAPGetDetailFL.sql

  3. Log on to the database with the appropriate privileges (in this example, DBAPP_SAP) and execute the following in the order given:

    1. DBAPP_SAP_SAPGetDetailFLTYPES.sql

    2. DBAPP_SAP_SAPGetDetailFL.sql

  4. Create another stored procedure, COMPANYGETDETAIL_EXE, in the same schema. It executes at runtime to create the database message that is sent to the hub.

CREATE OR REPLACE  PROCEDURE "DBAPP_SAP"."COMPANYGETDETAIL_EXE" (
servicename LONG,
methodname  LONG,
license     LONG,
customerid  LONG
)
AS
  moid NUMBER;
  aoid NUMBER;
  coid NUMBER;
  businessname LONG;
  address LONG;
  city LONG;
  state LONG;
  phone LONG;
  country LONG;
  detailid NUMBER;
BEGIN
  SAPGetDetailFL.crMsg_GetDetail_OAI_V1(moid, aoid);
  detailid := SAPGetDetailFL.cr_BAPI_COMPANYCODE_GETDETAIL_(servicename,methodname,license,customerid,moid,aoid);
  coid := SAPGetDetailFL.inv_GetDetail_OAI_V1(moid,'DBAPP_SAP','',businessname,address,city,state,phone,country);
COMMIT;
END;

Editing the adapter.ini File

To edit the adapter.ini file:

  1. Open the adapter.ini file.

  2. Add the following two lines to adapter.ini for the adapter:

  3. // Bridge class
    bridge_class=com.iwaysoftware.iwbridge.IWBridge
     
    // IBSE URL	
    ibse_url=http://hostname:7777/ibse/IBSEServlet/XDSOAPRouter
    
    

Where hostname is the URL of the server and 7777 is the port number.

OracleAS Integration InterConnect Runtime

The following topic describes how to verify service integration using the OracleAS Adapter for SAP.

Verifying Service Integration

To verify service integration:

  1. Start the Oracle Application Server or ensure that the server is running.

  2. Restart OC4J, if required, by executing the following command:

    \OracleAS_home\opmn\bin\opmnctl  stopproc process-type=home
    \OracleAS_home\opmn\bin\opmnctl  startproc process-type=home
    
    
  3. Check the status of OC4J by executing the following command:

    \OracleAS_home\opmn\bin\opmnctl  status
    
    
  4. Invoke and implement the adapter by executing the following commands:

    \InterConnect_HOME\oai\9.0.4\adapters\SAPCompanyCode_FL\start.bat
    \InterConnect_HOME\oai\9.0.4\adapters\DBAPP_SAP\start.bat
    
    
  5. Log on to SQL*Plus with DBAPP_SAP and execute the following command:

    exec
    companygetdetail_exe
    ('BAPI_COMPANYCODE_GETDETAIL','BAPI_COMPANYCODE_GETDETAIL','test','0001');
    
    

    The following image shows the SAPCompanyCode_FL example. It receives a reply from SAP and returns the reply to the hub.

    SapCompanyCode_FL in a command window
    Description of the illustration sapcompanycode_fl.gif

    The following image shows the DBAPP_SAP example. It receives a reply from the hub and writes the data to the database table.

    DBAPP_SAP in command window
    Description of the illustration dbapp.gif