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

Tranfer internal table to xml format

Former Member
0 Likes
678

Hi guys,

I have converted the internal table into xml format....and the out of xml format is display the data in the horizontal way:

I have use this logic:

CALL TRANSFORMATION ZFQMR_QAL_DATMAP_MES

      SOURCE table = it_final

      RESULT XML xmlstr.

  APPEND xmlstr TO xml_tab.

      MOVE '.XLS' TO default_extension.

  CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

*          BIN_FILESIZE                    =

      FILENAME                        = 'C:\TEST'

     FILETYPE                        = 'ASC'

*      

TABLES

      DATA_TAB                        = xml_tab

            .

  IF SY-SUBRC <> 0.

* Implement suitable error handling here

  ENDIF.

output of xml:I want the the data to display in the vertical nt horizontal

how can i achieve this?

          <Column ss:Span="1" ss:Width="47.25"/><Row ss:Height="60"><Cell ss:StyleID="s151"><Data ss:Type="String">Sample ID</Data></Cell><Cell ss:StyleID="s152"><Data ss:Type="String">Current or Last Inspection Lot for the Sample</Data></Cell></Row><Row><Cell><Data ss:Type="String">000100000000</Data></Cell><Cell><Data ss:Type="String">000000000000</Data></Cell></Row><Row><Cell><Data ss:Type="String">000100000001</Data></Cell><Cell><Data ss:Type="String">000000000000</Data></Cell></Row><Row><Cell><Data ss:Type="String">000100000002</Data></Cell><Cell><Data ss:Type="String">000000000000</Data></Cell></Row><Row><Cell><Data ss:Type="String">000100000003</Data></Cell><Cell><Data ss:Type="String">000000000000</Data></Cell></Row><Row><Cell><Data   

Hi guys,

I have converted the internal table into xml format....and the out of xml format is display the data in the horizontal way:

I have use this logic:

CALL TRANSFORMATION ZFQMR_QAL_DATMAP_MES

      SOURCE table = it_final

      RESULT XML xmlstr.

  APPEND xmlstr TO xml_tab.

      MOVE '.XLS' TO default_extension.

  CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

*          BIN_FILESIZE                    =

      FILENAME                        = 'C:\TEST'

     FILETYPE                        = 'ASC'

*      

TABLES

      DATA_TAB                        = xml_tab

            .

  IF SY-SUBRC <> 0.

* Implement suitable error handling here

  ENDIF.

output of xml:I want the the data to display in the vertical nt horizontal

how can i achieve this?

          <Column ss:Span="1" ss:Width="47.25"/><Row ss:Height="60"><Cell ss:StyleID="s151"><Data ss:Type="String">Sample ID</Data></Cell><Cell ss:StyleID="s152"><Data ss:Type="String">Current or Last Inspection Lot for the Sample</Data></Cell></Row><Row><Cell><Data ss:Type="String">000100000000</Data></Cell><Cell><Data ss:Type="String">000000000000</Data></Cell></Row><Row><Cell><Data ss:Type="String">000100000001</Data></Cell><Cell><Data ss:Type="String">000000000000</Data></Cell></Row><Row><Cell><Data ss:Type="String">000100000002</Data></Cell><Cell><Data ss:Type="String">000000000000</Data></Cell></Row><Row><Cell><Data ss:Type="String">000100000003</Data></Cell><Cell><Data ss:Type="String">000000000000</Data></Cell></Row><Row><Cell><Data   

4 REPLIES 4
Read only

Former Member
0 Likes
613

Drag your XML to browser (eg: IE), then you will see the XML in vertical hierarchy format.

Regards,

Xavier

Read only

Former Member
0 Likes
613

Hi,

If you are opening the document in notepad, wordpad or word, then this does not take the XML formating and takes as the string of characters. Hence you will see the data in horizontal way.

Try opening the document with IE, or XML tools or Notepad++, you will see the same in the XML format.

Regards,

Hardik Mehta

Read only

0 Likes
613

Hi,

use this

CALL METHOD document->append_child

     EXPORTING

       new_child = xml_schema

     RECEIVING

       rval      = rc.

   CHECK rc = 0.

* --> creation of the body

   LOOP AT elements ASSIGNING <element>.

     IF NOT <element> IS INITIAL.

       CALL METHOD xml_schema->append_child

         EXPORTING

           new_child = <element>

         RECEIVING

           rval      = rc.

       IF rc NE 0.

         EXIT.

       ENDIF.

     ENDIF.

   ENDLOOP.

Read only

Former Member
0 Likes
613

make filename as C:\TEST.xml.