This blog will help you understand When we go for Java Mapping in SAP PI.
The major reason for Java Mapping is when you want to do data manipulation on the entire payload.
In Graphical Mapping, you can also write Java code using User Defined Function (UDF).
So, Writing Java code in Graphical Mapping you can achieve simple task that applies on Single Field.
The best part of Java Mapping is that you get to access the entire payload message and then manipulate it as you want.
Java Mapping acts as a Message Mapping and it can be used in the Operation Mapping like any other Graphical Mapping.
You can even choose what you can write to the output stream with Mapping Program.
If you like to learn how to write Java Mapping then read this blog.
When you write Java Mapping its class files stored in the Integration Server and executed during the run time.
Apart from Java Mapping you can even write XSLT Mapping also.
When we go for Java Mapping in SAP PI
Here are the primary reason where you want to develop Java Mapping:
- Zip the Data.
- Convert JSON to XML or Vice Versa.
- Read and Write Flat File Format.
- Convert to base64 String.
- Use of 3rd Party Libraries during the Mapping.
- Fetch the Token.
- Read Entire Payload.
- Write Custom Target Message.
- POST Data to Receiver Channel from Java Mapping and Read Response.
Note that Java Mapping has different class definitions in SAP XI and SAP PI.
Let me know where you have used the Java Mapping instead of Graphical Mapping.