cancel
Showing results for 
Search instead for 
Did you mean: 

Whitespaces in XML during message mapping not preserved

Former Member
0 Kudos

I use a twostep mapping process during Interface Mapping. The first one is the standard message mapping and the second one is a Java mapping. However, during the second step, the white spaces that should be preserved from the output of the first mapping is not there anymore. I created the XSD and specified in the details that the white spaces should be preserved.

I need the whitespaces since the output of the second mapping would be used for file content conversion in a file adapter to create the output:

MSGTYP CONTROLNOMSGID VALUE1VALUE2 VALUEn.....

Is there any way to preserve the white spaces?

Thanks!

Best Regards,

Rommel Mendoza

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member859847
Active Contributor
0 Kudos

Hi,

Please configure your FCC parametes with the following parameter.

which will not alter the actual content.

i.e

item. fieldContentFormatting - nothing

please refer the follwoing link from SAP Help.

http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm

warm regards

mahesh.

henrique_pinto
Active Contributor
0 Kudos

This is odd. Java won't condense/trim the whitespaces unless explicitely told so.

Where are you seeing the missing whitespaces?

Please notice that SXMB_MONI won't show the spaces because it uses a HTML representation of the XML (and, by default, HTML condenses the whitespaces). But the actual XML file should have all the spaces (check the XML document source code, through mouse right click over payload, to be sure).

Also, what are the conversions you do in the java mapping?

Are you sure the java mapping input has the whitespaces?

Regards,

Henrique.

Former Member
0 Kudos

Hi Henrique,

Thanks for pointing that out. I checked the XML that the first Message Mapping program was sending to the Java Mapping I developed and it seems that it is the Message Mapping that condenses the spaces. Would you know how to have the white spaces preserved? Thanks!

Best Regards,

Rommel

Former Member
0 Kudos

Rommel,

I dont think that can happen. As pointed out by Henrique, Java mappings do not condense white spaces. Msg mapping inturn is a Java mapping. How are you checking this? Please check it again. Check the input to the mapping and see if you can find the white spaces. If you have not used any Trim function, it will not condense the white spaces.

Regards,

Jaishankar

Former Member
0 Kudos

Thanks for the reply. I did not use any trim functions whatsoever. What I did in the Java mapping is to display the XML output of the first Message Mapping in the Map Trace. And as I suspected, the white spaces were condensed. The white spaces were generated inside the Message Mapping since in the flat file, some fields have to be left blank so I mapped white spaces to the fields that need to be blank using a certain number of whitespaces for each specific field.

Best Regards,

Rommel

Edited by: Rommel Mendoza on Jun 24, 2008 9:02 AM

Former Member
0 Kudos

Are you seeing the trace in SXMB_MONI ? If so, use view source and check the XML in a note pad or any other text editors.

Former Member
0 Kudos

It is not yet configured in the Integration Directory that is why I am not able to see the trace in SXMB_MONI but I am to see the trace in the Interface Mapping test tab. And yes, I copied the XML that the first Message Mapping outputs and pasted it in notepad and the whitespaces are missing.

Best Regards,

Rommel

henrique_pinto
Active Contributor
0 Kudos

What is your input message? Is it another flat file?

Check the XML file right before the request message mapping step, and check whether the whitespaces are still there (use view source function).

Regards,

Henrique.