cancel
Showing results for 
Search instead for 
Did you mean: 

Replacing Special Characters in XML PO Output (& to &)

Former Member
0 Kudos

Dear Experts,

We have configured SRM for XML output and transfer to vendor via PI though HTTP post.

However our XML has special characters in it for example & in the following tag:

<StreetName>100 Main Street & Commercial Drive</StreetName>

What we need to send is the following:

<StreetName>100 Main Street &amp Commercial Drive</StreetName>

Has anyone run into this issue before?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

& can be replaced by "& amp ; "

<StreetName>100 Main Street &amp; Commercial Drive</StreetName>

view this message in plain text to see the result

Regards,

Former Member
0 Kudos

try using this on your text fields to remove the ampersand:

*----


form check_string using l_intext type any l_outtext type any.

*----


data: ls1 type string,

ls2 type string.

if l_intext ca '&'.

split l_intext at '&' into ls1 ls2.

if ls2 ca '&'.

perform check_string using ls2 l_outtext.

else.

concatenate ls1 ' &amp;' ls2 into l_outtext.

endif.

else.

l_outtext = l_intext.

endif.

endform.