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

Internal Table to XML

Former Member
0 Likes
1,329

Hallo Experts,

I have retrived a Internal Table from FM.

CALL FUNCTION 'SRTUTIL_CONVERT_XML_TO_TABLE'
    EXPORTING
      xdoc             = lv_xstring
 IMPORTING
*   ERROR_TEXT       =
     data             = lt_xml

I have manipulated the Tagnames in the Internal Table lt_xml.

Now I want to change the internal table to xml.

Is there any FM or a class. can anyone help me??

Thanks

Kind regards

rana Waseem

4 REPLIES 4
Read only

Former Member
0 Likes
802

This message was moderated.

Read only

0 Likes
802

The easiest way to transform ABAP data to XML, XML to ABAP data, or XML to XML should be the use of [CALL TRANSFORMATION|http://help.sap.com/abapdocu_70/en/ABAPCALL_TRANSFORMATION.htm] with a specific [XSLT transformation|http://en.wikipedia.org/wiki/XSLT].

Read only

Former Member
0 Likes
802

Have you tried the FM SAP_CONVERT_TO_XML_FORMAT?

Edited by: Leonardo Lima Coelho on Feb 28, 2012 3:29 PM

Read only

0 Likes
802

Hallo,

Thanks for your Reply. I am trying to manipulate the xml attributes in print report. I have the data in xstring form. I have changed it to internal Table with following code.

CALL FUNCTION 'SRTUTIL_CONVERT_XML_TO_TABLE'
    EXPORTING
      xdoc             = lv_xstring
 IMPORTING
*   ERROR_TEXT       =
     data             = lt_xml

.

After the change in the table lt_xml I am trying to have once again a xstring to give to the Print Report. I have tried it with class

LOOP AT lt_xml INTO ls_xml.

    CALL METHOD cl_soap_xml_helper=>transform_to_xml
      EXPORTING
        tag_name          = ls_xml-tag_name
        data              = ls_xml-tag_value
        data_type         = ls_xml-tag_type
        ignore_init_value = 'X'
*    ignore_exception  =
      CHANGING
        xml               = lv_xstring_two
        .

*  ENDLOOP.

but when I try to check the XML become an error

The XML cannot be showed, when Stylesheet XSL is used Remove the error and try again.

I cannot understand where is the error. Because the orignal xstring from system is shown correct. But when I create the new xstring give error .

Thanks for your help

kind regards

waseem