Skip to Content
author's profile photo Former Member
Former Member

serialization into XML and back

I want the usage of function module SDIXML_DATA_TO_DOM.

In the parameters for this function module what is DATAOBJECT? What is to be passed for this?

Any solution for serialization into xml and back?

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Mar 25, 2006 at 09:19 AM

    Welcome to SDN.

    If you are on WAS 6.20 and above you can use the key word CALL TRANSFORMATION to serialise into xml an back.

    search this forum with key word CALL TRANSFORMATION you will find lot of code samples.

    If you still have problem do let us know.

    if you are not on WAS, check out the following weblogs.

    /people/r.eijpe/blog/2005/11/10/xml-dom-processing-in-abap-part-i--convert-an-abap-table-into-xml-file-using-sap-dom-approach

    /people/r.eijpe/blog/2005/11/21/xml-dom-processing-in-abap-part-ii--convert-an-xml-file-into-an-abap-table-using-sap-dom-approach

    Regards

    Raja

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2006 at 09:23 AM

    Hi madhukeshwar,

    1. itab --- > xml

    xml ---> itab.

    2. This program will do both.

    (just copy paste in new program)

    3.

    REPORT abc.

    *----


    DATA

    DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.

    DATA : BEGIN OF itab OCCURS 0,

    a(100) TYPE c,

    END OF itab.

    DATA: xml_out TYPE string .

    DATA : BEGIN OF upl OCCURS 0,

    f(255) TYPE c,

    END OF upl.

    DATA: xmlupl TYPE string .

                                                                • FIRST PHASE

                                                                • FIRST PHASE

                                                                • FIRST PHASE

                                                                *----


                                                                Fetch Data

                                                                SELECT * FROM t001 INTO TABLE t001.

                                                                *----


                                                                XML

                                                                CALL TRANSFORMATION ('ID')

                                                                SOURCE tab = t001[]

                                                                RESULT XML xml_out.

                                                                *----


                                                                Convert to TABLE

                                                                CALL FUNCTION 'HR_EFI_CONVERT_STRING_TO_TABLE'

                                                                EXPORTING

                                                                i_string = xml_out

                                                                i_tabline_length = 100

                                                                TABLES

                                                                et_table = itab.

                                                                *----


                                                                Download

                                                                CALL FUNCTION 'GUI_DOWNLOAD'

                                                                EXPORTING

                                                                filetype = 'BIN'

                                                                filename = 'd:\xx.xml'

                                                                TABLES

                                                                data_tab = itab.

                                                                                                                            • SECOND PHASE

                                                                                                                            • SECOND PHASE

                                                                                                                            • SECOND PHASE

                                                                                                                            BREAK-POINT.

                                                                                                                            REFRESH t001.

                                                                                                                            CLEAR t001.

                                                                                                                            CALL FUNCTION 'GUI_UPLOAD'

                                                                                                                            EXPORTING

                                                                                                                            filename = 'D:\XX.XML'

                                                                                                                            filetype = 'BIN'

                                                                                                                            TABLES

                                                                                                                            data_tab = upl.

                                                                                                                            LOOP AT upl.

                                                                                                                            CONCATENATE xmlupl upl-f INTO xmlupl.

                                                                                                                            ENDLOOP.

                                                                                                                            *----


                                                                                                                            XML

                                                                                                                            CALL TRANSFORMATION ('ID')

                                                                                                                            SOURCE XML xmlupl

                                                                                                                            RESULT tab = t001[]

                                                                                                                            .

                                                                                                                            BREAK-POINT.

                                                                                                                            regards,

                                                                                                                            amit m.

                                                                                                                            Add a comment
                                                                                                                            10|10000 characters needed characters exceeded

                                                                                                                          • Posted on Mar 25, 2006 at 10:29 AM

                                                                                                                            Hi,

                                                                                                                            Check this thread..

                                                                                                                            Upload XML to internal table and vice versa in SAP 4.6C

                                                                                                                            Regards

                                                                                                                            Vijay

                                                                                                                            Add a comment
                                                                                                                            10|10000 characters needed characters exceeded

                                                                                                                          Before answering

                                                                                                                          You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
                                                                                                                          You must be Logged in to submit an answer.

                                                                                                                          Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.