cancel
Showing results for 
Search instead for 
Did you mean: 

white spaces in XML element

Former Member
0 Kudos

Hi...

I need to put in an XML element the string value " ", that is six white spaces, but when the XML parser interpets the document this value is transform like a null value.

Is there some way to preserve this value in the element?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

There are multiple ways you can come out of this problem.

I am assuming lot of this since your message is not clear on what kind of adapters you are using.

Try to create element in data type as 1...1 instead of 0..1 and detail properties specify minimum length as 6. In the Graphical mapping , you assign 6 spaces.

Thanks

Reddi

Former Member
0 Kudos

Thanks for you replay Reddi,

Let me explain the scenario: The scenario is RFC --> XI --> JDBC, one of the element of the FM sometimes could be have the value " ", when this occurrs in the SXMB_MONI TC I see the value null in the element, that is the tag is <Element />, in this case I need to preserve this white space in the element. The message could be something like this:

<root>

<element1>value 1</element1>

<element2>value 2</element2>

<element3> </element3>

</root>

but I see the message in this form:

<root>

<element1>value 1</element1>

<element2>value 2</element2>

<element3 />

</root>

In the message mapping tool I assign the string value " " and the problem still the same.

Any Idea?

Former Member
0 Kudos

Hi -

As far as the RFC preserving the white space, I believe only leading spaces are kept. But I'm surprised that when assigning spaces in the mapping tool, the spaces aren't preserved. With the spaces from graphical mapping assigned, in MONI, look at the XML in its raw xml form (e.g. right click anywhere on the payload screen and View source) and check again. IE and MONI may be hiding the spaces.

Jin

Former Member
0 Kudos

Hector,

SXMB_MONI doesnot show the spaces what you are expecting for <element3 />. So right click on the payload in SXMB_MONI and select View Source option. There you can see the spaces for element3. You dont need to give "".

---Satish

Former Member
0 Kudos

Thanks Satish...

The problem is when I look for the value in the DB and it's null

Thanks anyway

stefan_grube
Active Contributor
0 Kudos

Check the parameter "Interpretation of Empty String Values" in the communication channel.

See the help for more information:

http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm

Regards

Stefan

Former Member
0 Kudos

Hector,

As stefan suggested try to pass without any value and check whether you can retreive the value.

---Satish

Former Member
0 Kudos

Hi Stefan...

I check the parameter in the com. channel JDBC and the value was NULL value, then I change the value to Empty String Value, restart de interface and it didn't work.

Thanks for your reply