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

XML to Itab

Hi All,

i want trnsfer the data from XML to Itab.

Actually i upload the XMl file in to itab using

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = 'D:\XX.XML'

filetype = 'BIN'

TABLES

data_tab = upl.

This one upload xml file as it is in to the Itab.

Now what i want is to extract the data from XMl file and store it into itab.

how can i do it.

Thanks in advance

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 29, 2008 at 10:17 AM

    hi check the follwoing web log::

    /people/tobias.trapp/blog/2005/05/04/xml-processing-in-abap-part-1

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 29, 2008 at 10:17 AM

    check the below code:

    TYPES: BEGIN OF T_ATTACHMENT,

    LINE_NO(5),

    FILENAME(200),

    DESCRIPTION TYPE STRING,

    END OF T_ATTACHMENT,

    D_ATTACHMENT TYPE T_ATTACHMENT OCCURS 0.

    TYPES: BEGIN OF T_ATTACHMENTLIST,

    ATTACHMENT TYPE D_ATTACHMENT,

    END OF T_ATTACHMENTLIST,

    D_ATTACHMENTLIST TYPE T_ATTACHMENTLIST OCCURS 0.

    TYPES: BEGIN OF T_HEADER,

    NAME(140),

    PHONE(23),

    EMAIL(100),

    ATTACHMENTLIST TYPE D_ATTACHMENTLIST,

    END OF T_HEADER,

    D_HEADER TYPE T_HEADER OCCURS 0.

    TYPES: BEGIN OF T_ITEM,

    HEADER TYPE D_HEADER,

    END OF T_ITEM.

    TYPES:D_ITEM TYPE T_ITEM OCCURS 0.

    TYPES: BEGIN OF T_LIST,

    ITEM TYPE D_ITEM,

    END OF T_LIST,

    D_LIST TYPE T_LIST OCCURS 0.

    TYPES: BEGIN OF TYPE_DATA,

    LIST TYPE D_LIST,

    END OF TYPE_DATA.

    DATA: ITEMLIST TYPE STANDARD TABLE OF T_LIST INITIAL SIZE 0.

    DATA: XMLOUT TYPE STRING.

    DATA: ITAB LIKE SOLI OCCURS 0 WITH HEADER LINE.

    PERFORM UPLOAD_XML.

    &----


    *& Form UPLOAD_XML

    &----


    -


    • text

    -


    • --> p1 text

    • <-- p2 text

    -


    FORM UPLOAD_XML .

    REFRESH ITAB.

    clear ITEMLIST.

    CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

    filename = 'C:\test11.XML'

    filetype = 'BIN'

    TABLES

    data_tab = ITAB.

    LOOP AT ITAB.

    CONCATENATE XMLOUT ITAB-LINE INTO XMLOUT.

    ENDLOOP.

    CALL TRANSFORMATION ('ZTEST11X2A')

    SOURCE XML XMLOUT

    RESULT ITEMLIST = ITEMLIST.

    BREAK-POINT.

    ENDFORM.

    Regards,

    Dara.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 29, 2008 at 10:25 AM

    Hi Joe,

    Refer to the following link:

    http://sap-img.com/abap/xml-file-to-word-document-through-sap.htm

    Hope this helps.

    Reward if helpful.

    Regards,

    Sipra

    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.