How to setup NWDS configuration for creating Customized Adapter Modules in PI 7.31 using NWDS 7.3 SP07
Author: Vinay Puttaswamy
Prerequisites
· Java and PI Knowledge
· S/W Environment: PI 7.31(Single Stack),SAP NetWeaver Developer Studio 7.31 SP07, Java Version 1.6
Adapter Modules
Adapter Modules are required in PI in order to handle certain specific needs of a Business Scenario which normal adapters cannot handle by default. The functionality of these adapters can be enhanced by implementing the adapter module.
Required jar files
commons-net-2.0 jar
- com.sap.aii.af.ms.svc_api
- com.sap.aii.proxy.svc_api.jar
- com.sap.aii.sec.svc_api.jar
- com.sap.aii.utilxi.server.jar
- com.sap.aii.utilxi.core.jar
- com.sap.xi.mapping.tool.lib_api.jar
- sap.com~tc~bl~txmanagerimpl~plb~impl.jar
- sap.com~tc~je~appcontect_api~API.jar
- com.sap.aii.af.cpa.svc.api
- com.sap.aii.af.lib.mod
- com.sap.aii.af.ms.ifc_api
- com.sap.aii.af.svc_api
- com.sap.xpi.ib.mapping.lib
jakarta-oro-2.0.8
- sap.com~tc~logging~java~impl
Place these jars under a separate folder on your local desktop
Note: The above mentioned jars are just an example. Jar files needs to be added based on one’s requirement
How to set up a Build Path • Go to Windows -> Preference • Expand Java and select the class path variable to create a new entry. Assign a name to it (for example: Adapter Module Jars) and select the directory which has the jar files.
Steps to create EAR and EJB projects
• Go to File -> New -> EJB Project. Click on EJB project and then on Next as shown below:
• Enter the Project Name as FileModule_EJB.
• Select Target Runtime as SAP Libraries.
• Select Configuration as Default Configuration for SAP Libraries.
· EJB Module Version 3.0
• Select add project to an EAR and enter EAR project name as FileModule_EAR and then Click on Next as shown above:
Click on Next as shown above
· Uncheck Create an EJB client JAR module to hold the client interfaces and classes and click on finish as shown above.
· You can see the following EAR and EJB file created in NWDS
· Scroll down under FileModule_EJB -> ejb Module
· Create a package by name -> com.sap.pi.com
· Create a class by name -> FileModule.java as shown below.
· Here in this FileModule.java, you can write your own customized adapter module code.
· Before building the code, we need to import jars. Please refer to the below steps for importing the jars.
- - - Right click on ReadFiles_EJB -> Build Path -> Configure Build Path
- Click on Add Variable and select Adapter Module Jars folder that you had created earlier and then click on Exten
-Select all the jars inside the class path folder and press ok.
Once the build is complete, proceed with the following steps
• Make sure that the application-j2ee-engine.xml file under the EAR project has the content exactly as in the attached txt file.
Note : Please refer to the attached application-j2ee-engine.xml file
· Right click on the EJB project and select Export ->SAP EJB JAR file. Follow the wizard after that, select the location same as the actual EJB project folder so that way you can see the EJB jar file in NWDS itself
• Select the Destination and click on finish as shown below
· Similarly Right click on the EAR project and select Export ->SAP EAR file. Follow the wizard after that, select the location same as the actual EAR project folder so that way you can see the EAR file in NWDS itself.
Select the Destination and click on finish as shown below
How to set Target Server for Deployment
• Navigate to Windows -> Preferences
• Select SAP AS JAVA
• PI server information needs to be entered here and once done please click on Register SAP instance in order to register the server for deployment
Deploying the EAR file in Target server
· Go to FileModule_EAR file as shown below. Right click and select Run As ->Run on Server
· Click on Finish and the EAR module will be deployed on the corresponding PI Server with the status as Deploy Finished Successfully as shown below
Following screen will show the deploy logs as well
Regards
Vinay