Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error While converting xml to sap abap string.

Former Member
0 Likes
846

Hi Experts,

As i am doing an cross Application from SAP to .Net and vice versa.I am receiving an xml from .Net and it should be converted to ABAP string Using the following function module SMUM_XML_PARSE

And the following string i am receiving from .net

<Root><qApprovalInfo><RequesterId>xxxx</RequesterId><RequesterName>xxx</RequesterName><ApproverId>xxxx</ApproverId><ApproverLevel>1</ApproverLevel><PendingApprovalId>0200169911</PendingApprovalId><CreatedDate>20/07/2011</CreatedDate><CreatedBy>xx</CreatedBy><ModifiedDate>2011-07-20 16:45</ModifiedDate><ModifiedBy>xxxx</ModifiedBy><ApplicationCode>EPAY</ApplicationCode><WorkFlowCode>EPX</WorkFlowCode><ApprovalStatus>APPROVED</ApprovalStatus><ActionComments><![CDATA[APPROVED(through Desktop)]]></ActionComments><Mode>CREATE</Mode><ActionSource>DESKTOP</ActionSource></qApprovalInfo><qApprovalHidden><Approverl>40002664</Approver><EmployeeId>40016515</EmployeeId></qApprovalHidden></Root>

In this xml i am getting all the values except the <ActionComments><![CDATA[APPROVED(through Desktop)]]></ActionComments>

is their any way to convert that CDATA value?..

have anybody come across the following issue ?...

can anybody provide the solution for this?.

Edited by: basavaraj.p on Aug 29, 2011 10:54 AM

2 REPLIES 2
Read only

Sandra_Rossi
Active Contributor
0 Likes
553

Hi,

SMUM_XML_PARSE is a simplified, unreleased and undocumented version of the powerful, released and documented iXML

If you look at the GET_ELEMENT subroutine in that function module, you'll see that the nodes of type CO_NODE_CDATA_SECTION are simply ignored.

The simpliest thing for you, maybe, is to duplicate the code of SMUM_XML_PARSE (as it is rather easy to handle), and add a section to GET_ELEMENT. You'll have also to use IF_IXML_CDATA_SECTION interface and ixml_iid_cdata_section constant.

Documentation is here: [SAP Library: Interface if_ixml_cdata_section|http://help.sap.com/saphelp_nw70/helpdata/en/bb/576658dca511d4990b00508b6b8b11/frameset.htm ]

Best regards,

Sandra

Read only

0 Likes
553

Hi Sandra Rossi ,

Thanks For reply. I resolved the problem using string operations.

Regards,

Basuvaraj.P

Edited by: basavaraj.p on Aug 30, 2011 5:29 AM