cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Change of XML Version and Encoding based on Input Field

Former Member
0 Kudos

Hi,

I have a requirement where in the scenario is IDOC to XML File.

I have done the Message mapping for Transformation Logic.

But the Output XML prolog should look like this < XML Version='1.0/None' encoding = 'Shift-JAS/None'>

If the RCVLAD Field ends with the String "JP", then my Version should be '1.0 and encoding = Shift-JAS'

else

Version should be NONE and encoding should be NONE.

Any pointers are highly appreciated and will be rewarded with points.

Thanks in advance

Regards,

Babu

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Done

Jitendra_Jeswan
Contributor
0 Kudos

Hi -

You can definately change it. If you are from Java Background You will have to use UDF and do some Java coding for this

The API used is com.sap.aii.af.ra.ms.api. There you are provided with some classes like PayLoad, TextPayLoad

You can create an Object of this type of your XML Message, and then Access/edit "encoding" & "version" attribute based on your conditions with methods like getEncoding() & getVersion().

Let me know if you need any further help on this.

Regards.

Jeet.

Reward points if Helpful.