cancel
Showing results for 
Search instead for 
Did you mean: 

Return as XML Multi-mapping Encoding UTF-8 to ISO-8859-15

03-06-2020 3:30 AM
Khalil Explorer
2554 views 8 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

I have done the Graphical Mapping - First Mapping - IDOC Invoic02 to target structure and this entire payload need to convert base64encode and send in a string filed of Second Mapping - here target structure of API call. I have used Return as xml option in Second mapping source field and convert Base64 using UDF but now i need to change XML encoding UTF-8 to ISO-8859-15 before convert the Base64 format. How I can achieve this requirement.

Please help me on this.

Regards,

Anil Kumar

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

0 Likes

Anil,

you might try using adding this xslt mapping as a step of your operation mapping:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output encoding="ISO-8859-15"/>
<xsl:template match="/">
<xsl:copy-of select="*"/>
</xsl:template>
</xsl:stylesheet>

and afterwards convert to base 64 - you might find this blog post by Eng Swee Yeoh useful:

https://blogs.sap.com/2015/05/19/base64encodeconverter-base64-encoding-made-easy/

Please let me know if this helped.

Regards.

Michal

0 Likes

karthick12 did this work? Please let me know if you need any additional help.

Regards.

Michal

Khalil
Explorer

Thank you! its worked.

Answers (2)

Answers (2)

Khalil
Explorer
0 Likes

Dear Michal, Thank you for your message. I am working on Finland's finvoice30 e-invoice integration with service providers. I am calling an API post method to send IDOC to Fiinovice30 converted XML in soap request - string field as Base64format. they will accept the XML only encoding ISO-8859-15. That is the reason I need to convert it before covert basee64format. how can I achieve this?

former_member190293
Active Contributor
0 Likes

Hi!

I agree with Michal's question.

But if you're sure you need it - you could try something like:

String isoString = new String(utfString.getBytes("UTF-8"), "ISO-8859-15");

Regards, Evgeniy.

Khalil
Explorer
0 Likes

Hi Evgeniy,

Thank you for your message and code.

I have tried it but getting some error. if don't mind can share full code of this UDF so that i will try again it.

String isoString =newString(utfString.getBytes("UTF-8"), "ISO-8859-15");

I don't have much knowledge of it

Thanks

former_member190293
Active Contributor
0 Likes

Hi!

I have no such code, just wrote this snippet for you.

What kind of error do you get?

You could provide your UDF code as well.

Regards, Evgeniy.