cancel
Showing results for 
Search instead for 
Did you mean: 

External Jar files in UDF

Former Member
0 Kudos

Hi All,

I want to use External Jar files in UDF .Can any body please explain the procedure to use them(external Jar files) in UDF.Is it possible in PI7.0/ any new added Functionality in this aspect of PI7.1 ?

Thanks in Advance,

Amar.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

if you want to use some external jars in PI 7.1, try to execute your requirement in a java program with these jars included.import the zip in to ESR and then call this program from your UDF.Hope this works...

Regards,

swetha.

Former Member
0 Kudos

HI shweta,

Thanks for your early reponse. Could you please explain in detail how to call the program in the UDF.

Thanks,

Amar

Former Member
0 Kudos

Use import functions as how we use to refer the other classes... import java.util.*

similarly use import for making use of your imported classes... (import com.yourpackagename...........)

HTH

Rajesh

Former Member
0 Kudos

Hi Rajesh,

As it is an External Jar file ,It will not be available in PI server. Then How can I use that in inport options.

Thanks.

Former Member
0 Kudos

Hi Amar,

check this blog ..

/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping

In this blog, a java program was written and compiled for throwing Runtime exceptions in message mapping. The class files generated are zipped and imported in to ESR. Then the required class is being called in the UDF.

You can create yours..in a similar fashion.

Former Member
0 Kudos

Hi Amar,

I mean after importing the external java class in the form of jar into the PI in imported sections...which contains the needed jar ...then refer it in import section of the UDF for the class needed....

It will work...

HTH

Rajesh

Edited by: Rajesh on Jan 22, 2010 3:37 PM

Answers (7)

Answers (7)

deviprasad_pothireddy
Active Participant
0 Kudos

Hi All,

   I have also faced same problem, after struggling a lot, identified the reason is, external jar's class method should be static,after placing that , it is working fine.

Regards,

Deviprasad.

Former Member
0 Kudos

Hi All,

My Problem has been solved. Thanks to everyone who helped me in this.

Solution:
I have imported the external Jar File and I used that in import statement of UDF. It is working fine.

Thanks.

former_member190389
Active Contributor
0 Kudos

Hi,

Please see that the .classpath and .project files are present inside the jar archive.

Also

for importing if your class name is Abc

in the package com.company then type

import com.company.Abc;

Edited by: Fariha Ali on Jan 25, 2010 2:06 PM

Former Member
0 Kudos

Hi Fariha,

Yes I have those 2 files. Totally I have four files in Imported Archives those are

.classpath
.project
.class
.java

and I am giving in my imports like

package.classname;

Still I am getting the Error.

And Suggest me onething ..

As Some people suggested like I can Directly import the external Jar file in Imported Archives and use it. Is it possible. I have tried that but getting same Exception.

Any Suggestions please.

Thanks.

former_member190389
Active Contributor
0 Kudos

How are you creating the jar file? I mean using which tool.

Of Course it was presumed that you are importing it in a Jar file

Edited by: Fariha Ali on Jan 25, 2010 3:21 PM

Former Member
0 Kudos

Hi Amar,

As Some people suggested like I can Directly import the external Jar file in Imported Archives and use it. Is it possible. I have tried that but getting same Exception.

Check the below thread where most of the your queries reg external jar files are answered..

Regards,

Swetha.

0 Kudos

You can import this JAR into system as Imported archive.

In code you should create an object of this class:

myclass cl=new myclass();

Then you can access to methods and other elements of class as usual: cl.method(fieldvalue1,fieldvalue2,..,fieldvalueN);

Former Member
0 Kudos

Hi All,

When I am creating the object of the class which is available in Imported Archives it is giving me an error like No Class Definition Found Exception

Please Help Me regarding this issue.

Thanks.

Former Member
0 Kudos

Any Help ?

Thanks.

Former Member
0 Kudos

zip the esternal jar files you intend to use, import them under Imported Archives and you can refer to these jar files in the UDF

Regards

Saravana

former_member181962
Active Contributor
0 Kudos

Hi Amar,

Check the section 3a of "Activties" in this link:

http://help.sap.com/saphelp_erp2004/helpdata/en/22/e127f28b572243b4324879c6bf05a0/content.htm

Regards,

Ravi Kanth Talagana

former_member200962
Active Contributor
0 Kudos

The jar files that you want to use should be present in the XI/ PI server....then while creating the UDF....after you enter the UDF name, parameters, on the page where you write your code, you mention the package name...under the import section (procedure for PI7.1)

Regards,

Abhishek.

Former Member
0 Kudos

Hi Abhishek,

Yes its True.

But I want to use an external jar file, it is not available in PI server. So what can I do ?

I want to use pdfbox jar file.

Suggest me for this.

Thanks.