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

Convert to xml from string / itab / table

former_member212713
Contributor
0 Likes
868

Hello Dear Experts,

I want to send sms from our sms provider via SAP. 

I want to manually fill xml from string or itab or table and call from url and then send xml.

I give my structure below.

<?xml version=“1.0” encoding=“utf-8” ?>

<MainmsgBody>

<Command>X</Command>

<PlatformID>X</PlatformID>

<ChannelCode>X</ChannelCode>

<UserName>X</UserName>

<PassWord>X</PassWord>

<Mesgbody>X</Mesgbody>

<Numbers>9053XXXXXXXX</Numbers>

<Type>X</Type>

<Originator>X</Originator>

</MainmsgBody>

How can I solve this case simply?

Best regards.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
813

Hello,

You can use IXML libraries in SAP which can help you to fill the XML.

Below is the link.

ABAP Keyword Documentation  for ixml

These are the classes which will be helpful for you.

if_ixml,

if_ixml_stream_factory,

if_ixml_parser,

if_ixml_istream,

if_ixml_document,

if_ixml_node,

Regards,

Rahul Gupta

Message was edited by: Matthew Billingham - updated link

6 REPLIES 6
Read only

Former Member
0 Likes
814

Hello,

You can use IXML libraries in SAP which can help you to fill the XML.

Below is the link.

ABAP Keyword Documentation  for ixml

These are the classes which will be helpful for you.

if_ixml,

if_ixml_stream_factory,

if_ixml_parser,

if_ixml_istream,

if_ixml_document,

if_ixml_node,

Regards,

Rahul Gupta

Message was edited by: Matthew Billingham - updated link

Read only

Former Member
0 Likes
813

hello,

For itab to xml

Pls check reports BCCXML. You can use some classes like CL_XML_DOCUMENT and CLMINI*XML for your your requirements.

best regards,

swanand

Read only

uppu_narayan
Active Participant
0 Likes
813

hi Melih,

      Following guide will solve your problem

               http://www.saptechnical.com/Tutorials/ABAP/XML/Conversion.htm

modify it accordingly to your requirement.........

thanks and regards,

narayan

Read only

0 Likes
813

narayan,

the solution you point to is not really recommendable. it just shows that the author did not understand what transformations are all about and that the only transformation he knew was id..

my 2 cents and kind regards,

anton

Read only

Former Member
0 Likes
813

search for stylesheet transformations. start with something like

CALL TRANSFORMATION trafo_name SOURCE root = l_root RESULT XML l_xml.

hope it helps and kind regards,

anton

Read only

Former Member
0 Likes
813

I found an excellent blog by Robert Eijpe most helpful when I had to complete a similar task.

https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2657