Professional Documents
Culture Documents
Technical Articles
Introduction:
In this blog, we will see step-by-step process to create SAP PI/PO Custom Adapter module, EJB version 3.0.
As, I don’t nd any blog, where each steps are clearly mentioned, with detail con guration. Hope this will help
SAP PI/PO Developers.
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 1/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 2/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
Click on Finish.
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 3/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 4/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
Right Click on EJB Project –> New –> Session Bean (EJB 3.x)
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 5/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
Choose EJB project created before and provide Java package & Class Name.
Follow RSS feed Like
Right Click on EJB project –> Preference –> JAVA Build Path –> Add Libraries
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 6/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 7/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
Expand META-INF folder of EJB –> Click on ejb-j2ee-engine.xml –> Change the details as below.
JNDI name will be the Adapter Module Name in SAP PI/PO Communication Channel.
<enterprise-beans>
<enterprise-bean>
<ejb-name>ReadExcelFile</ejb-name>
<jndi-name>ReadExcelFile</jndi-name>
</enterprise-bean>
</enterprise-beans>
</ejb-j2ee-engine>
Expand META-INF folder of EJB Project –> Click on ejb-jar.xml –> Change the details as below
<ejb-class> –> This need to be your java package name and your Class name
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 8/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
xsi:schemaLocation=“http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd”
version=“3.0”>
<display-name>ExcelToXML_EJB</display-name>
<enterprise-beans>
<session>
<icon/>
<ejb-name>ReadExcelFile</ejb-name>
<home>com.sap.aii.af.lib.mp.module.ModuleHome</home>
<remote>com.sap.aii.af.lib.mp.module.ModuleRemote</remote>
<local-home>com.sap.aii.af.lib.mp.module.ModuleLocalHome</local-home>
<local>com.sap.aii.af.lib.mp.module.ModuleLocal</local>
<ejb-class>com.sap.java.modules.ReadExcelFile</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>
Expand META-INF folder of EAR Project –> Click on application-j2ee-engine.xml –> Change the details as
below.
<application-j2ee-engine xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xsi:noNamespaceSchemaLocation=“application-j2ee-engine.xsd”>
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 9/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
<reference reference-type=“hard”>
Follow RSS feed Like
</reference>
<reference reference-type=“hard”>
</reference>
<reference reference-type=“hard”>
</reference>
<reference reference-type=“hard”>
</reference>
<reference reference-type=“hard”>
</reference>
<reference reference-type=“hard”>
</reference>
<fail-over-enable xsi:type=“fail-over-enableType_disable”
mode=“disable” ></fail-over-enable>
</application-j2ee-engine>
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 10/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 11/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 12/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
Then the project will be deployed in your server and you can see in EJB Explorer (SAP PI/PO ).
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 13/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
Right Click EAR Project –> Export –> SAP EAR File
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 14/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
package com.sap.java.modules;
import javax.ejb.Stateless;
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 15/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
import com.sap.aii.af.lib.mp.module.Module;
Follow RSS feed Like
import com.sap.aii.af.lib.mp.module.ModuleContext;
import com.sap.aii.af.lib.mp.module.ModuleData;
import com.sap.aii.af.lib.mp.module.ModuleException;
import com.sap.engine.interfaces.messaging.api.XMLPayload;
import com.sap.aii.af.service.auditlog.Audit;
import com.sap.engine.interfaces.messaging.api.Message;
import com.sap.engine.interfaces.messaging.api.MessageKey;
import com.sap.engine.interfaces.messaging.api.auditlog.AuditLogStatus;
import java.io.ByteArrayInputStream;
import jxl.Cell;
import jxl.Workbook;
/**
*/
@Stateless
@Override
try {
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 16/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
obj = imd.getPrincipalData();
Follow RSS feed Like
XMLPayload xp = msg.getDocument();
if (xp != null) {
xp.setContent(by);
imd.setPrincipalData(msg);
throw me;
return imd;
try {
Workbook wb = Workbook.getWorkbook(byteArr);
Cell[] cells ;
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 17/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
Cell[] cellNames ;
Follow RSS feed Like
cellNames = wb.getSheet(0).getRow(0);
for(int j=1;j<wb.getSheet(0).getRows();j++) {
xmldata = xmldata+“<Record>”;
cells = wb.getSheet(0).getRow(j);
for(int i=0;i<wb.getSheet(0).getColumns();i++){
xmldata =
xmldata+“<“+cellNames[i].getContents()+“>”+cells[i].getContents()+“</”+cellNames[i].getContents()+“>”;
wb.close();
throw me;
Alert Moderator
}
return xmldata.getBytes();
Assigned tags
}
Note:-
Related Blog Posts
1 ) I am using below details for my development.
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 18/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
2) If you will not nd XPI Libraries in your NWDS version, then you can add below jar les , as external jars and
Follow
any other jar les as per your requirements.RSS feed Like
Related Questions
2 Comments
GAPP MOZART
Hi Bijayashree Banoj Brahma, Very useful blog on topic that has little doc.
Can please share how would one proceed to read channel parameters and use them in further processing .
BR,
Jay
Like(0)
Hi Jay,
Thanks.
I will create one more, to need parameter from adapter module and use in processing.
Thanks,
Bijayashree
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 19/20
12/23/2020 How to create Custom Adapter Module in SAP PI/PO for EJB 3.0 Version | SAP Blogs
Follow RSS feed Like
Like(0)
Find us on
Newsletter Support
https://blogs.sap.com/2019/05/03/how-to-create-custom-adapter-module-in-sap-pipo-for-ejb-3.0-version/ 20/20