cancel
Showing results for 
Search instead for 
Did you mean: 

Adapter module to read excel file -java code required for PI 7.1

Former Member
0 Kudos

Hi PI experts,

I am working on PI 7.1 SP 08.

I am trying to develope an adapter module to read excel file

http://wiki.sdn.sap.com/wiki/display/ABAP/AdapterModuleToReadExcelFilewithMultipleRowsandMultiple+Columns

but here in this wiki , given java code is for pi 7.0 and it is using jar file from PI 7.0

I tried with using corresponding PI 7.1 files

com.sap.aii.af.lib.mod.jar:

sap.comtcloggingjavaimpl.jar:

com.sap.aii.af.svc_api.jar:

com.sap.aii.af.cpa.svc_api.jar:

com.sap.aii.af.ms.ifc_api.jar:

jave program is not throwing any error in NWDS but After deploying file on server.

i am getting this errot in communication channel

2009-12-15 15:47:08 Information AO: Now calling the Convert Method to convert Excel to XML. 
2009-12-15 15:47:08 Error MP: exception caught with cause javax.ejb.TransactionRolledbackLocalException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file; nested exception is: javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file; nested exception is: javax.ejb.EJBTransactionRolledbackException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file; nested exception is: javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file

since i am not a JAVA expert so i am unable to resolve this error

if some one has already deployed this module for PI 7.1, then please provide me java code for PI 7.1

Thanks

sandeep sharma

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi babu

code which u have sent, is a simple java code, its not a EJB specific coewhich can be deployed on PI server

experts any more input on this

thanks

sandeep sharma

former_member204873
Contributor
0 Kudos

hi,

please try this:

obj = inputModuleData.getPrincipalData();

msg = (Message) obj;

amk = new MessageKey(msg.getMessageId(),msg.getMessageDirection());

XMLPayload xpld = msg.getDocument();

Workbook wb = Workbook.getWorkbook((InputStream) xpld.getInputStream());

xmldata ="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n"+ "<ns0:"msgType" ""xmlns:ns0=\""nameSpace+"\">";

Cell[] cells ;

Cell[] cellNames ;

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()+">";

}

xmldata = xmldata+"</Record>";

}

xmldata = xmldata"</ns0:"msgType+">";

wb.close();

byte byt[] = xmldata.getBytes();

xpld.setContent(byt);

inputModuleData.setPrincipalData(msg);

Thanks,

Mayank

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi babu

due to restriction on SDN i am unable to post my id

you can visit my busness card in my profile, my hcl id is mentioned there.

Thanks

Former Member
0 Kudos

Please check the version compatibility

Check Stefan's reply:

Former Member
0 Kudos

Hi

I am using Java 1.5

Former Member
0 Kudos

Hi

I am using Java 1.5