SAP adapter sample setup instructions

In order to run the SAP adapter sample, follow the instructions below.

Before you begin

  1. Make sure you have a clean workspace.
  2. You need to obtain these files from your SAP server administrator:
    • sapidoc3.jar
    • sapjco3.dll
    • sapjco3.jar

About this task

After you import the sample:

To create and run the SAP adapter sample:

Procedure

  1. If the Java™ EE icon, Java EE perspective , does not appear in the top right tab of the workspace, you need to switch to the Java EE perspective. From the menu bar, select Window > Open > Perspective > Other.
  2. The Select Perspective window opens. Select Java EE.
  3. Click OK. The Java EE perspective opens.
  4. Add required file dependencies: Drag and drop sapjco.jar, librfr32.dll, and sapjcorfc.dll from your file system to theconnectorModule folder of the CWYAP_SAPAdapter connector project. Add this file to the classpath. You can do this in the Properties view for the project.
  5. To associate the sample with your SAP server, you need to change the connection information in Bean implementation class. Open up the CustomerImpl.java in a Java editor, change the following section in the code to use your SAP server connection information.
    /**
     * @j2c.managedConnectionFactory class="com.ibm.j2ca.sap.SAPManagedConnectionFactory"
     * @j2c.managedConnectionFactory-property name="adapterID" value="001"
     * @j2c.managedConnectionFactory-property name="applicationServerHost" value="applicationServerHost"
     * @j2c.managedConnectionFactory-property name="client" value="001"
     * @j2c.managedConnectionFactory-property name="language" value="EN"
     * @j2c.managedConnectionFactory-property name="moduleName" value="BAPI"
     * @j2c.managedConnectionFactory-property name="password" value="password"
     * @j2c.managedConnectionFactory-property name="userName" value="userName"
     * @j2c.connectionSpec class="com.ibm.j2ca.sap.SAPConnectionSpec"
     * @generated
     */
  6. Testing the application:
    1. Select the Servers View, right-click WebSphere® Application Server v7.0, v8.0, or v8.5and select Start.
    2. Select File > New > Other > J2C > Web Page, Web Service, or EJB from J2C Java Bean. Click Next.
    3. On the Java bean selection page, click Browse.
    4. On the Find J2C Bean page, Type C in the top text field, and CustomerImpl - sample.bapi shows up in the Matching items field. Select CustomerImpl - sample.bapi and click OK.
    5. Click Next.
    6. On the Deployment Information page, select Simple JSP, and click Next.
    7. On the Simple JSP Creation page, click New to launch the Web project wizard.
    8. On the New Web Project page, type a name in the Project name field (for example, TestWebProject). Ensure that Target Runtime selected is WebSphere Application Server v7.0 or v8.0. Select Add project to an EAR, and click Finish.
    9. On the Simple JSP Creation page, type a name in the in the JSP folder field (for example, SampleJSP), and click Finish..
    10. When the server is started, navigate to your<Web Project>/WebContent/SampleJSP/TestClient.jsp. Right-click TestClient.jsp and select Run as > Run on Server.


    11. The application opens in a web browser. Input a value and click Invoke.

Feedback