cancel
Showing results for 
Search instead for 
Did you mean: 

How to send Spaces in a field from R/3 Proxy - XI - WebService

Former Member
0 Kudos

Since Space ' ' is a valid value in Several SAP Fields How One can send Spaces thru the System. In XML Structures If the Field has Spaces system will send Nulls ( for example tag like <Name /> ) But I want to send this field as <Name> </Name>. We cant use XM XTENDED option as our R/3 is on WEBAS 6.20.

I tried MapwithDefault and it doesn't work. I added spaces to the field in ABAP Report before calling proxy which also doesn't work.

Any Suggestions.

Accepted Solutions (0)

Answers (1)

Answers (1)

prateek
Active Contributor
0 Kudos

Have u tried with standard function "Constant" and giving a space. Or u may try with a small udf also

Regards,

Prateek

Former Member
0 Kudos

yes I did. Basically I added IF Condition to fill with Constant with spaces if Input field has nothing. I also tried with UDF. Nothing works out. It still generates Tagname as (<Name />.

Former Member
0 Kudos

Hi Ram,

It will show those spaces when you right click on payload and view the source code of your xml payload.

Regds

Pushkar

Former Member
0 Kudos

It wont work.

Target field is generated as <name /> If you do right click and view source how it changes to

<name> <.name>

I agree with you if target generates as <name></name>

Former Member
0 Kudos

Ram:

In the XML Display, As far as i know, the spaces will not be displayed. To confirm that, try writing the same XML payload to a file with FCC, you will get the spaces. In case if it doesn't work, you can add spaces in message mapping, if you know the field should/must have spaces in it using some UDFs

Former Member
0 Kudos

I tried with CONSTANT with Spaces. unfortunately It behaves same way. I read couple of messages that It should work but not in my case. We are on PI7.4 / SPS14 .

Former Member
0 Kudos

Ram:

I did ABAP Proxy - XI - File and in the ABAP proxy I set a field as below to send spaces

space(8) TYPE c.

I didnt do any thing in the mapping and when the CSV file is created, it worked for me. As you said by using CONSTANT and assigning spaces to target variable should achieve the same.

What happens in your case is, since XML does not display the spaces,it will not show in the XML Payload. It will show as <field></field>. If you were to write the same Payload as CSV file, you will be able to see the spaces in the flat file. Since Webservice (SOAP) also receives payload as XML, i guess its finding difficult to interpret the spaces sent and creating the variable as Null.

The alternative, you can do is, send some special characters in the fields which have spaces and modify then at the webservice side

Former Member
0 Kudos

Instead of saying, I dont agree , I would suggest you to test that.

It works.

Preserved white spaces do not appear in your payload but in source code you can see them.