Oracle® Application Server Adapter for SAP User's Guide 10g Release 3 (10.1.3.1.0) Part Number E10044-01 |
|
|
View PDF |
This chapter contains the following examples:
The scenarios shown in this chapter require the following prerequisites.
Prerequisites
The following are installation and configuration requirements:
OracleAS Adapter for MySAP ERP must be deployed to Oracle Application Server.
mySAP ERP must be configured for outbound processing. See Appendix A, "Configuring mySAP ERP for Inbound and Outbound Processing" for more information.
Oracle BPEL PM Server must be properly configured and running.
Oracle JDeveloper must be properly installed.
See Also:
Oracle Application Server Adapters Installation GuideThe examples in this chapter present the configuration steps necessary for demonstrating service and event integration with MySAP ERP. Prior to using this material, you must be familiar with the following:
How to create a J2CA configuration, as BPEL PM is only compatible with the J2CA Connector. See "Creating a Configuration for J2CA" for more information.
How to configure OracleAS Adapter for mySAP ERP for services and events using Application Explorer. See Chapter 2, "Configuring OracleAS Adapter for mySAP ERP" for more information.
See Also:
Oracle BPEL Process Manager Developer's GuideAdapter integration with Oracle BPEL Process Manager is a two-step process:
Design Time: OracleAS Adapter for MySAP ERP is configured in Application Explorer for services and events, as described in Chapter 2, "Configuring OracleAS Adapter for mySAP ERP". Integration logic is modeled using JDeveloper.
Runtime: After you deploy the BPEL process you designed in JDeveloper, you can test your service configuration or see newly received events in the BPEL Console.
This example demonstrates MySAP ERP service integration. It describes design-time, followed by runtime configuration.
Before you design a process for MySAP ERP service integration, you must generate its respective WSDL file using Application Explorer.
Generating WSDL for Request/Response Service
Perform the following steps:
Start Application Explorer and connect to a defined mySAP ERP target (a J2CA configuration).
See "Defining a Target to mySAP ERP" for more information on defining a target and connecting to mySAP ERP.
Expand the mySAP ERP target to which you are connected.
Expand Remote Function Modules, Financial Accounting, 0002 -- Company Code Business Object, and then select BAPI_COMPANYCODE_GETDETAIL.
The following image shows a connected and expanded target.
Right-click the BAPI_COMPANYCODE_GETDETAIL node.
The following menu is displayed:
Click Create Outbound JCA Service (Request/Response).
The Export WSDL dialog box is displayed.
Click OK.
You can now design a BPEL process in JDeveloper.
Creating a BPEL PM Server Connection in JDeveloper
Before you design an outbound BPEL process, you must configure a new Application Server and Integration Server connection in Oracle JDeveloper. For more information, see Chapter 4, "Integration with Oracle BPEL Process Manager".
Creating a BPEL Project for a Synchronous BPEL Process
To create a BPEL Project for a synchronous BPEL process:
At the bottom of the upper left pane, click the Applications Navigator tab and select an application for your project.
Right-click the application and select New Project.
The New Gallery window displays a list of available items.
From the Items list, select BPEL Process Project and click OK.
The BPEL Project Creation Wizard - Project Settings dialog box is displayed.
Perform the following steps:
Specify a name for the BPEL process, for example, SAP_GetCCDetail.
The Namespace field is updated automatically.
From the Template list, select Synchronous BPEL Process.
Click Next.
The BPEL Project Creation Wizard - Input/Output Elements dialog box is displayed.
Review the input/output schema elements that are created by the BPEL Project Creation Wizard and click Finish.
Designing the BPEL Process for BAPI_COMPANYCODE_GETDETAIL
From the Services pane on the right, drag and drop a PartnerLink to the visual editor.
The Create Partner Link dialog box is displayed.
Click the Service Explorer icon (second icon from the left preceding the WSDL File field).
The Service Explorer dialog box is displayed.
Expand your new connection under Adapter Services, followed by adapters, and then applications.
The WSDL tree displayed in the Service Explorer dialog box lists any WSDL files you have created using Application Explorer. The WSDL tree is generated by a WSDL servlet, which is automatically deployed as part of the BPEL Server installation.
Select BAPI_COMPANYCODE_GETDETAIL_invoke.wsdl and click OK.
The WSDL File field in the Create Partner Link dialog box displays the name and location of the selected WSDL file. The Partner Link Type field specifies the PartnerLink defined in the WSDL file.
Perform the following steps:
Leave the My Role field unspecified. The role of the PartnerLink is null, as it will be synchronously invoked from the BPEL process.
From the Partner Role list, select the default value GetDetailRole. This is the role of the BPEL process.
Click OK.
Select Save from the File menu.
From the Process Activities pane on the right, drag an Invoke activity to the visual editor and place it between the Receive activity (receiveInput
) and the Reply activity (replyOutput
).
The Invoke process activity is shown in the diagram view.
Extend a connection between the Invoke activity and your newly-created PartnerLink.
The Edit Invoke dialog box is displayed.
Perform the following steps:
In the Name field, enter Get_CCDetail.
Click the first icon to the right of the Input Variable field, then click OK in the Create Variable window that is displayed.
Repeat the previous step to create a default variable for Output Variable.
Click OK.
Drag an Assign process activity and drop it between receiveInput
and SAP_GetCCDetail
.
The following image shows the new Assign activity in JDeveloper visual editor.
Double-click the Assign activity icon.
The Assign dialog box is displayed.
In the Copy Operation tab, click Create and select Copy Operation.
The Create Copy Operation dialog box is displayed.
In the From pane, expand Variables, then inputVariable, and then highlight payload.
In the To pane, expand Variables, then Invoke_1_GetDetail_InputVariable, and then highlight input_GetDetail.
Your Create Copy Operation dialog box should look as follows:
To close the Create Copy Operation dialog box and the Assign dialog box, click OK.
From the Process Activities pane on the right, drag another Assign activity to the visual editor and place it between the Invoke activity (SAP_GetCCDetail
) and the Reply activity (replyOutput
).
Double-click the Assign activity icon and click Create.
Map Invoke_1_GetDetail_OutputVariable, output_GetDetail to outputVariable, payload.
Verify that you have mapped all variables as follows:
Click OK, then click OK again.
Select Save from the File menu.
You have completed the design of this BPEL process.
Deploying the BPEL Process for BAPI_COMPANYCODE_GETDETAIL
JDeveloper deploys the outbound BPEL process for BAPI_COMPANYCODE_GETDETAIL directly to Oracle BPEL Console.
To deploy your BPEL process in JDeveloper:
Right-click your process flow in the Applications - Navigator pane.
Select Deploy, then Your BPEL PM Server connection, and then Deploy to default domain.
The Password Prompt dialog box is displayed.
Enter your BPEL PM Server password in the Password Prompt dialog box.
The deployment process starts automatically after you enter the correct password.
Observe the Messages log at the bottom of the window.
The Messages log displays the deployment status. In this example, it shows a successful deployment message for the process.
If deployment was not successful, click the Compiler tab to view all error and warning messages generated during the deployment process.
To invoke the BAPI_COMPANYCODE_GETDETAIL process from Oracle BPEL Console:
Start the Oracle BPEL Console by entering the following URL in a browser:
http://host:port/BPELConsole
Select a domain and provide a valid password.
The Oracle BPEL Console main page is displayed.
The Initiate tab enables you to test your BPEL process.
Perform the following steps:
From the Initiating a test instance menu, select XML Source.
Enter the following code in the text area provided for XML input:
<?xml version="1.0" encoding="UTF-8"?> <CompanyCode.GetDetail CompanyCodeId="1000"/>
Click Post XML Message.
The response received from the mySAP ERP system is displayed in the Initiate window.
This example demonstrates how OracleAS Adapter for MySAP ERP integrates with MySAP ERP to receive event data. In this example, an MySAP ERP event occurs when a customer record is added to a MySAP ERP system.
The design-time and runtime procedures are outlined in the following sections.
You must create a separate channel for every inbound J2CA service and select that channel when you generate WSDL for inbound interaction using Application Explorer.
Note:
If two or more events share the same channel, event messages may not be delivered to the right BPEL process.Creating a Channel
To create a channel:
Start Application Explorer and connect to a J2CA configuration.
In the left pane, expand the Events node.
Expand the mySAP node.
The Ports and Channels nodes appear in the left pane.
Right-click Channels and select Add Channel.
The Add Channel dialog box is displayed.
Perform the following steps:
Enter a name for the channel, for example, SAP_Channel
.
Enter a brief description (optional).
From the Protocol list, select SAP Channel--App Server.
Click Next.
The Application Server dialog box is displayed. The following tabs are available:
User (Required)
System (Required)
Security
Advanced
For the User tab, enter the appropriate information for your mySAP ERP channel based on the information in the following table.
Table 5-1 User Tab Parameters
Target Parameter | Description |
---|---|
Client |
The client number defined for the mySAP ERP application for client communications. |
User |
A valid user ID for the mySAP ERP application. |
Password |
A valid password for the mySAP ERP application. |
Language |
A language key. EN (English) is the default. |
Code page |
A character code page value. |
Authentication Mode |
The authentication mode you want to use when connecting to your mySAP ERP system. By default, Password is selected from the drop-down list. If you are using a Secure Network Communications (SNC) adapter with SAP, select Logon ticket (SSO2). If you are using an SNC adapter with SAP, select Logon ticket (X509). |
Click the System tab.
For the System tab, enter the appropriate information for your mySAP ERP channel based on the information in the following table.
Table 5-2 System Tab Parameters
Target Parameter | Description |
---|---|
Gateway host |
A host name for the mySAP ERP Gateway. |
Gateway service |
A service for the mySAP ERP Gateway. |
Program ID of the server |
A mySAP ERP program ID you want to use for this channel. |
Message Server |
A host name for the message server. |
Application Server |
A name of the mySAP ERP application server you are using. |
System Number |
A mySAP ERP system number. |
For the Security tab (optional), enter the appropriate information for your mySAP ERP channel based on the information in the following table.
Table 5-3 Security Tab Parameters
Target Parameter | Description |
---|---|
SNC mode |
By default, SNC is disabled. To enable SNC, select 1 from the list. |
SNC partner |
Enter the name of the RFC server or message server (load balancing) that provides the SNC services. |
SNC level |
From the list select the version of the SNC library. |
SNC name |
Enter the name of the SNC library you are using. |
SNC library path |
For the Advanced tab (optional), enter the appropriate information for your mySAP ERP channel based on the information in the following table.
Table 5-4 Advanced Tab Parameters
Target Parameter | Description |
---|---|
IDOC Format |
Select an IDOC type from the list. |
IDOC release |
The IDOC versioning you want to use for your connection. |
IDOC release provider |
The IDOC release provider for your connection. Select IDOC DOCREL field (default), SAP release, or user input from the drop-down list. |
SAP trace |
Select this option to enable traces. |
Processing Mode |
Select the type of synchronous processing from the list. Possible values include REQUEST and REQUEST_RESPONSE. |
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.
Generating WSDL for Event Notification
After you create a channel and verify that it is not started, you must generate WSDL for the event using Application Explorer.
Start Application Explorer.
A list of all adapters is displayed.
Perform the following steps:
Expand the mySAP node.
A list of your available targets is displayed.
Click a target name under the mySAP node, for example, SAPTarget..
Verify your connection parameters.
Provide the required password.
Right-click the target name and select Connect.
The x icon disappears, indicating that the node is connected.
Expand the ALE(IDOCS) node and select DEBMAS.
The DEBMAS list is displayed.
Right-click DEBMAS05 from the DEBMAS list.
Select Create Inbound JCA Service (Event).
The Export WSDL dialog box is displayed.
Perform the following steps:
In the WSDL File Name field, specify a name and location of the WSDL file.
In the Channel field, select the channel you created for this inbound service.
Important: You must create a separate channel for every event. Verify that the channel is stopped before runtime.
If you are using the optional port feature, you must select a port from the Port list.
If you are not using event ports for schema validation, skip this step. In this case, the default value of no port is selected automatically.
Creating a BPEL PM Server Connection in JDeveloper
Before you design a BPEL process using the WSDL you generated in Application Explorer, you must configure a new Application Server and Integration Server connection in Oracle JDeveloper. For more information, see Chapter 4, "Integration with Oracle BPEL Process Manager".
Designing the BPEL Process for the SAP_DEBMAS05 Event
To design a BPEL process for inbound interaction:
Click the Applications Navigator tab and select an application for your project.
Right-click the application and select New Project.
The New Gallery window is displayed.
From the Items list, select BPEL Process Project and click OK.
The BPEL Process Project Creation Wizard dialog box is displayed.
Perform the following steps:
Specify a name for the process.
The Namespace field is updated automatically.
From the Template list, select Empty BPEL Process.
Click Finish.
An empty BPEL process project template is created.
From the Services pane on the right, drag and drop a PartnerLink to the visual editor.
The Create Partner Link dialog box is displayed.
Click the Service Explorer icon (second icon from the left preceding the WSDL File field).
The Service Explorer dialog box is displayed.
Expand your new connection under Adapter Services, followed by adapters, and then applications.
The WSDL tree displayed in the Service Explorer dialog box lists any WSDL files you have created using Application Explorer. The WSDL tree is generated by a WSDL servlet, which is automatically deployed as part of the BPEL Server installation.
Select DEBMAS05_receive.wsdl and click OK.
The Create Partner Link dialog box is displayed.
The WSDL File field displays the name and location of the selected WSDL file. The Partner Link Type field specifies the PartnerLink defined in the WSDL file.
Perform the following steps:
From the My Role list, select the default value DEBMAS05Role.
Leave the Partner Role field unspecified.
Click Apply, and then OK.
The new SAP PartnerLink appears in the visual editor.
From the Process Activities pane on the right, drag a Receive activity to the visual editor and place it in the designated placeholder labeled Drop Activity Here.
Connect the Receive activity to the SAP PartnerLink.
The Edit Receive dialog box is displayed.
Perform the following steps:
Specify a name for the Receive Activity, for example, Receive_DEBMAS05.
Click the first icon to the right of the Variable field, then click OK in the Create Variable dialog box that is displayed.
Verify that the Create Instance check box is selected.
Click Apply.
The Receive dialog box should no longer display any warnings or errors.
Click OK.
Your completed process looks as follows.
Select Save from the File menu.
Deploying the BPEL Process for the SAP_DEBMAS05 Inbound Service
Right-click your process flow in the Applications - Navigator pane.
Select Deploy, then Your BPEL PM Server connection, and then Deploy to default domain.
When prompted, enter your BPEL PM server password and click OK.
The deployment process starts automatically after you enter the correct password.
Events are generated as a result of activity in an application system. For example, mySAP ERP may generate an event as customer information is updated in the system. For more information on events, see "Configuring an Event Adapter"
Triggering an Event in mySAP ERP
The following topics describe how to trigger an event in mySAP ERP and verify event integration using OracleAS Adapter for MySAP ERP.
To trigger an event in mySAP ERP:
Start the SAP Workbench and log in to the mySAP ERP system.
Enter the following information in the Send Customers window:
In the Customer field, enter a customer number with a range from 1 to 3.
In the Output type field, enter DEBMAS.
In the Logical system field, specify the logical system you are using with mySAP ERP.
Click the check mark icon in the upper left-hand corner.
Ensure DEBMAS appears in the Message type column.
Click the Execute button.
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 mySAP ERP.
Verifying the Results
To verify your results:
Log in to Oracle BPEL Console at
http://host:port/BPELConsole
Enter the password for your BPEL domain.
The default password is bpel
.
Click the Instances tab.
Recently received runtime events are displayed in the Instances tab.
Click the SAP_DEBMAS05 instance, then click Audit to see the received SAP_DEBMAS05 event message.