If you are new to Java mapping in SAP PI/PO you will be wondering how to edit an existing Java mapping. If you haven’t done it before it could become a complex task. This article aims to provide a step-by-step guide on how to edit an existing Java mapping using Netweaver Developer Studio (NWDS). If you have never worked with NWDS read my previous post on how to configure NWDS for PI/PO developments.
Overview of steps to edit Java Mapping using NWDS,
-
Find the Java Mapping which needs to be changed.
-
Download the .jar or .zip files.
-
Create new Java Project in NWDS
-
Import .zip or .jar files to Java Project.
-
Edit Java code.
-
Export Java Project as .jar.
-
Re-import the .jar file to SAP PI.
Netweaver Developer Studio should be installed and configured for PI/PO development before you can follow these steps. If you have not installed it, then read my previous post on how to configure NWDS for PI/PO development.
SAP Versions used in the illustration:
- SAP PO 7.5
- NWDS 7.5 SP 11
Step 1: Identify Java Mapping (Imported Archive) to be Edited.
Find the Java Mapping you want to edit either by operation mapping or directly accessing Imported Archives under Software Component Version. In this example, we will edit the Imported Archive “Java_copyPayload” which contains the java class “copyPayload”.
As an example, I have created a simple Java Mapping named JAVA_copyPayload to copy input to output.
Step 2: Download Imported Archive as .Jar or .Zip file.
Download the Imported Archive as a .Jar file or .Zip file to local machine.
Step 3: Create New Java Project in NWDS.
Open NWDS and create a new Java Project. Assign a suitable name for your Java Project.
Import XPi library to your Java Project.
Step 4: Import .zip or .jar file of Imported Archive to Java Project.
Sample Java mapping simply copies the input payload to output.
Step 5: Edit java Code.
Every Java Mapping should implement the ‘transform’ method of extended ‘AbstractTransformation’ class. Java mapping in the example copies the input payload to the output. I have edited the mapping to copy new string to the output.
Step 6: Export Java Project as .Jar
Step 7: Imported Edited .Jar File to Archives.
Save edited Imported Archive and activate it.
Step 8: Test the Java Mapping Changes.
If you have any questions on how to edit an existing Java Mapping program, please leave a comment below.
Excellent blog…
Please provide some more blog on complex topic of SAP PO.
Good blog
please post any stuff on AS2 scenarios inbound and outbound.
nice blog
please post any stuff on AS2 scenarios inbound and outbound.
Nice blog, could you please post how to write java mapping code in NWDS with one oe two exampales to help to get improve coding knowledge
Nice blog and very helpful.
I’ve a question. What I’ can do if the java file doesn’t exist in jar file?
I mean if there are only class files and xls files in it. Is there any possibility to edit the mappings if the java doesn’t added to the file?
Hello Ahmet,
Let me know which step you are referring to.
Cheers!
Isuru
Dear Isuru,
where do I download the XPi Library?
I can’t find it on the SAP marketplace
Thanks and Regards
Hello Samantha,
This should be included in the installation. No need to add it separately.
Cheers!
Isuru
Hello Isuru,
Thank You for all your blogs. I do follow them blindly to solve my problems.
In my recent configs, I want to update an existing java Mapping. Since we are now using Temurin inour client PCs, I installed Eclipse IDE on my system. However, while trying to add XPI libraries, I donot see this option at all. Can you helpme with this!
Regards,
Hi Fernadez,
I am working in sap process integration middleware. I should process emojis in sap pi 7.31 single stack using java mapping. I don’t know which emoji jar files will support java mapping in the sap process integration 7.31. So please could you suggest me which java jars required to achieve this functionality.
Thank you very much Isuru!! It has helped me a lot to be able to modify Java Mappings