Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
5,391

Landscape / System Details:

SAP PI Version: SAP Netweaver 7.11    & Dual Stack

Focused Area : Message Mapping and UDF

Target Audiance : SAP PI Consultant.                

Document Objective:

In this Document, I am going to explain the steps to call an Externally written Java Program into SAP PI UDF.

From externally written i mean say a Java Class writen in NetBeans , Eclipse.

         

Say If you have a requirement, where we want to use externaly written Java code inside SAP PI - UDF to full fill some requirement in message mapping.

    

This can be useful where you have somecode written in external Java Program , and there is a need of calling same program in Java UDF  then in that case you dont have to write the Code again in UDF. You can simple import the same old code in UDF.

    

Steps are following :-

    

Step 1: Save .java and .class file into folder according to package name assigned in JAVA Program.

Step 2: Covert it into compressed zipped folder.

Step 3: Create imported archives Object in SAP PI.

Step 4: Import zip file with import archive option.

Step 5: Now go to message mapping, open Functions tab.

Step 6: Now on down left hand side, you will find archives Used, open this tab.

Step 7: Add the above created imported archive into this.

Step 8: And in import instructions add the package name, you have given in above used JAVA program.

Step 9. Now enjoy using the classes and method of Java Program in your scenario (Message Mapping) through UDF.

    

    

Please find the Example Below for reference :-

    

Step 1: a.java and a.class are the two files under Prabhat\test\   package.

    

Step 2: So Package name  = prabhat.test 

            It has one class = a 

            Class has one method = methoda

    

Step 3: Compress those file into compressed zipped folder.

    

Step 4: Import zip file into SAP PI with import archive option.

    

Step 5: Now go to message mapping, open Functions tab..

    

Step 6: Now on down left hand side, you will find archives Used, open this tab.

    

Step 7: Add the above created imported archive into this.

    

    

Step 8:  And in import instructions add the package name, you have given in above added Java program.

         

Step 9: Now you have leverage to use the classes and method of added Java Program in your scenario (Message Mapping).

    

Step 10: See below Screenshot, Here Nokia660 is returned by Java PROGRAM.

    

Hope above doc would be productive to some one.

    

Thanks and Regards

Prabhat Sharma

    

1 Comment
Labels in this area