Home

 

Creating a Connector Project and J2C bean

To create the SAP connector project and related J2C Beans for creating and retrieving information to and from SAP system, follow these steps:

Open the Java EE perspective.

In the Workbench, select File Æ New Æ Other Æ J2C Æ J2C Bean.

In the New J2C Bean dialog (Figure | 0-28), select IBM WebSphere Adapter for SAP Software (IBM: 6.1.0.3ifix001w) and click Next.

Figure 20-28 New J2C Bean: Resource Adapter Selection

In the Connector Import dialog (Figure | 0-29):

Type CWYAP_SAPAdapter in the connector project name field.
For Target server, select WebSphere Application Server 7.0.
Click Next.

Figure 20-29 New J2C Bean: Connector Import

In the Connector Settings dialog (Figure | 0-30), click Browse for each file required to access to SAP server, navigate to the sapjco.jar, librfc32.dll, and sapjcorfc.dll that we copied to the server folders. Click Next.

Figure 20-30 New J2C Bean: Connector Setting

In the Adapter Style dialog (Figure | 0-31), select Outbound and click Next.

Figure 20-31 New J2C Bean: Adapter Style

In the Discovery Configuration dialog (Figure | 0-32), enter your SAP Server connection information. For this sample, select BAPI® as SAP interface name. Click Next. The wizard retrieves the objects discovered by the query.

Figure 20-32 New J2C Bean: Discovery Configuration

In the Object Discovery and Selection dialog (Figure | 0-33), select RFC from the Objects discovered by query tree, then click Create or edit filter .

In the Filter Properties for `RFC' dialog, enter BAPI_CUSTOMER_* for Find objects with this pattern field, and click OK.

Figure 20-33 New J2C Bean: Object Discovery and Selection

In the Object Discovery and Selection dialog (Figure | 0-34);

Expand RFC (filtered), select BAPI_ CUSTOMER _CREATEFROMDATA1 and BAPI_ CUSTOMER _GETDETAIL
Click to add them to Objects to be imported.

Figure 20-34 New J2C Bean: Object Discovery and Selection

In the Configuration Parameters dialog, accept the defaults and click OK.
Click Next.

In Configure Composite Properties dialog (Figure | 0-35):

Type RAD75BAPI for Business objects name for service operations field.
Click Add, in the Add Value dialog, select Create and click OK.
Select BAPI_ CUSTOMER _CREATEFROMDATA1 from RFC function for selected operation list.

Figure 20-35 New J2C Bean: Configure Composite Properties

Repeat the previous step by selecting Retrieve, and BAPI_ CUSTOMER _GETDETAIL for RFC function for selected operation list (Figure | 0-36). Click Next.

Figure 20-36 New J2C Bean: Configure Composite Properties

In J2C Bean Creation and Deployment Configuration dialog, click New for the Project name field to create a new Java project that contains the generated J2C beans.

In New Source Project Creation dialog, select Java project and click Next.

In the Create a Java project dialog, enter RAD75SAP for Project name, accept the defaults, and click Finish.

In J2C Bean Creation and Deployment Configuration dialog (Figure | 0-37):

Type itso.rad75.babi as Package Name.
Type Customer as Interface Name.
Type CustomerImpl as Implementation Name.
Clear Managed Connection, select Non-managed Connection.
Click Finish.

Figure 20-37 J2C Bean Creation and Deployment Configuration dialog

After finishing with the J2C Wizard, you have the following two projects in your workspace:

CWYAP_SAPAdapter: SAP Adapter Project
RAD75SAP: Java Project that holds generated J2C Beans

To test this generated J2C Beans, we now generate a simple Web Application using J2C wizards.
ibm.com/redbooks