cancel
Showing results for 
Search instead for 
Did you mean: 

Uses of custom adapter module

former_member204873
Contributor
0 Kudos

hi all,

I am doing a POC on exploring custom adapter modules. Can anyone please help me in understanding various possible uses of adapter module?

I already know about creating PDF file, Reading/Writing Excel file, Encode/Decode, setting FileName, Sending attachment through Mail Adapter. Any other possible use of adapter module?

Thanks,

Mayank

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Read Multiple attachment content inside adapter module

/people/paras.arora3/blog/2008/04/07/reading-excel-line-items-using-the-jexcel-api

these are for reading Excel file which you already know

refer this http://wiki.sdn.sap.com/wiki/display/stage/AdapterModuleToReadExcelFilewithMultipleRowsandMultiple+Columns

/people/shabarish.vijayakumar/blog/2009/04/05/excel-files--how-to-handle-them-in-sap-xipi-the-alternatives

/people/paras.arora3/blog/2008/04/07/reading-excel-line-items-using-the-jexcel-api

/people/sandeep.jaiswal/blog/2008/05/13/adapter-module-to-stop-processing-of-duplicate-file-ftp-location Adapter Module to stop processing of duplicate file (FTP Location)

/people/amol.joshi2/blog/2007/01/29/rfc-calls-from-adapter-modulesthe-web-service-way RFC calls from Adapter modules...the Web Service Way!

best option is to search SDN using the key adapter module

former_member204873
Contributor
0 Kudos

hi,

I had tried creating module for reading excel file, as given in blog, i tried to get workbook from bytearrayinputstream using these lines of code.

ByteArrayInputStream byteArr= new ByteArrayInputStream(src);

Workbook wb = Workbook.getWorkbook(byteArr);

I am getting following error: The method getWorkbook(File) in the type Workbook is not applicable for the arguments (byte[])

How can i resolve it?

Thanks,

Mayank

jyothi_anagani
Active Contributor
0 Kudos

Hi for that you need external libraries like jxl.jar.....You have to add that jar file....

Refer This wiki...

Here I have explained step by step...

https://wiki.sdn.sap.com/wiki/display/stage/AdapterModuleToReadExcelFilewithMultipleRowsandMultiple+Columns

Thanks

former_member204873
Contributor
0 Kudos

hi jyothi,

I had already added jxl-2.6.jar to my project. Do i have to use different version?

Thanks,

Mayank

jyothi_anagani
Active Contributor
0 Kudos

Hi Gupta,

Then it may be some mistake....Check the jxl API once...You may be writing some speelling mistake.....

In my WIKI I have provided the link for that API aswell.....Check that wiki and code for syntax....

These 2 import statements should be there.....

import jxl.Cell;
import jxl.Workbook;

and Syntax is like this...

ByteArrayInputStream byteArr= new ByteArrayInputStream(src);
    Workbook wb = Workbook.getWorkbook(byteArr);

Check these and let me know for any other issues..

Thanks.

former_member204873
Contributor
0 Kudos

hi Jyothi,

Now i am getting following error:

Error jxl.read.biff.BiffException: Unable to recognize OLE stream

My lines of code are:

System.out.println("01");

FileInputStream fis = new FileInputStream("C:
Documents and Settings
Mayank
Desktop
mayank1.xls");

System.out.println("001");

String str = fis.toString();

System.out.println("0001");

byte src [] = str.getBytes();

System.out.println("00001");

ByteArrayInputStream f5 = new ByteArrayInputStream(src);

System.out.println("000001");

Workbook workbook1 = Workbook.getWorkbook(f5);

System.out.println("000002");

i am using lines because i will be converting xmlpayload to bytestream in actual module code.

And output i am getting is:

01

001

0001

00001

000001

Error jxl.read.biff.BiffException: Unable to recognize OLE stream

which means there is some problem in line

Workbook workbook1 = Workbook.getWorkbook(f5);

Also when i am reading file using:

Workbook workbook = Workbook.getWorkbook(new FileInputStream("C:
Documents and Settings
Mayank
Desktop
mayank1.xls")); ,, it's working.

Thanks,

Mayank

former_member204873
Contributor
0 Kudos

hi all,

As per many blogs on custom module, we can directly deploy the EJB module (EAR) using NWDS 7.1, what are the authorisations that user should have to deploy the module. Also how to undeploy module.

Thanks,

Mayank

0 Kudos

Hi Mayank,

the below thread might help you:

Regards

Venkat

former_member204873
Contributor
0 Kudos

hi all,

While creating EJB adapter module we need to create ejb-jar.xml file and in this file we need to add following:

<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>

what is the use of these elements?

Thanks,

Mayank

henrique_pinto
Active Contributor
0 Kudos

All EJB requires these 4 classes (local, home, remote, localhome) in addition to the main EJB class.

However, when you develop a module, SAP has these 4 pre-delivered classes which you can refer in your project so you don't need to create them again.

Best,

Henrique.

former_member204873
Contributor
0 Kudos

hi Henrique,

Will these classes be used while deployment.

Thanks,

Mayank

Answers (2)

Answers (2)

Former Member
0 Kudos

HI Mayank,

This is regarding the blog Adapter module to read excel file -java code required for PI 7.1

[]

I'm completely new to Java Background and also new to Module's concept as well.

I'm trying to develop the adapter module as given in the below link:

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

But unable to create jar file because I'm unable to create EJB Candidate.

My doubt is where can I save the class file given in the above link.

Could you please help me out here.

Regards,

Prajwal

former_member204873
Contributor
0 Kudos

hi Prajwal,

You have to create EJB project and then EAR project that will be used to deploy on PI server.

Please follow the link below on how to create EJB module in PI 7.1:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e674...

Before starting developing the module, download required JAR files from PI server location: Please check link below for same:

https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/wheretogetthelibrariesforXI+development

After creating the module you need to deploy it on PI server. Please check:

Thanks,

Mayank

former_member204873
Contributor
0 Kudos

hi Prajwal,

You have to create EJB project and then EAR project that will be used to deploy on PI server.

Please follow the link below on how to create EJB module in PI 7.1:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e674...

Before starting developing the module, download required JAR files from PI server location: Please check link below for same:

https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/wheretogetthelibrariesforXI+development

After creating the module you need to deploy it on PI server. Please check:

Thanks,

Mayank

former_member750652
Contributor
0 Kudos

Hi Mayank,

You can also try to validate EDI document in Adapter module..Developing a custom adapter module to validate EDI documents is also a part of handling EDI in PI environment.for this you need to have a basic knowledge on EDI at the same time this approach is very limited and small EDI documents.Please refer the approach Custom-Built approach in the following link on handling EDI in PI by SOA evangelist AXEL Angeli.

https://wiki.sdn.sap.com/wiki/display/bpxproj/EDI%20with%20PI

Thanks,

Ram.