cancel
Showing results for 
Search instead for 
Did you mean: 

CR LF getting added between the node names in email attachment in sap po

0 Kudos

Hi Experts,

My Scenario is from cXML file to idoc to mail. i.e 1st Mapping: cxML -> ORDERS IDOC, 2nd Mapping: ORDERS idoc- > EMail . I have written java code to attach the idoc as email attachment and add some text in body. IDOC is getting attached and even body is visible in email but the problem in with the content of IDOC. New Line characters "CR LF" are getting added in between Nodes names such as <E1EDP01 SE CR LF

GMENT="1"><QUALF>2</QUALF>

Likewise CR LF is getting added at some random places.Thus the malformed xml is getting attached in email.I have added code in java mapping to remove CR LF but it is removing all CR LF from File except the one which is in between the Node names.

PFA xml for reference. Any pointers will be helpful.

Thanks,

Sonam Ramsinghani

stefan_grube
Active Contributor
0 Kudos

Some email servers allow only 76 characters in a line and create CRLF automatically.

If you want to create an attachment in a Java Mapping, you should consider base64 encoding.

Check my blog for more details:

https://blogs.sap.com/2015/09/04/create-email-with-body-and-attachments-for-binary-payload-with-java...

Accepted Solutions (0)

Answers (1)

Answers (1)

manoj_khavatkopp
Active Contributor
0 Kudos

Sonam,

The issue is not with XML file, as you are viewing it in notepad++ hexadecimal characters are getting displayed. Open the XML in the browser it should work fine.

CR LF refers to carriage return line fine hexadecimal characters.

Br,

Manoj

0 Kudos

Hi Manoj,

yes i agree CR LF are hexadecimal characters and they should be present in xml document for adding new line. But they are coming in between tag names so we are getting error at the target side that "the xml document is malformed and there is some issue with CR LF" as its splitting the xml structure at target side they are having problems.

Thanks,

Sonam Ramsinghani