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

Reading data from XML to Internal table

Former Member
0 Likes
381

Hi Experts,

I got a requirement to read the data fom xml to internal table.is it possible to store deep internel table data into flat internal tables?my internel table contains 4 internel table and these 4 internel table contains 2 internel tables each...can any one help me o this...

points will be rewarded...

Regards,

Rakhi

1 REPLY 1
Read only

Former Member
0 Likes
354

Hi Rakhi,


* Structure to Get the Client Details as in XML format
  DATA: BEGIN OF client,
          BEGIN OF Personal_Details,
            kunnr like kna1-kunnr,
            name1 like kna1-name1,
            adrnr like kna1-adrnr,
          END OF Personal_Details,
          BEGIN OF Address,
            street like adrc-street,
            city1  like adrc-city1,
          END OF Address,
          BEGIN OF Communication,
            fax_number like adrc-fax_number,
            tel_number like adrc-tel_number,
          END OF Communication,
        END OF client.
  
  DATA: it_client TYPE TABLE OF client WITH HEADER LINES,
        result LIKE client.

  DATA: xml_string TYPE string.

*  Get the Client Details into the structure to be made as an XML string

  TRY.
*  Convert the Structure to XML string
      CALL TRANSFORMATION  ('ID')
        SOURCE para = it_client
        RESULT XML xml_string.

*  Convert the XML string to structure - result
      CALL TRANSFORMATION  ('ID')
        SOURCE XML xml_string
        RESULT para = result.
 
  CATCH cx_st_error.

  ENDTRY.

best regards,

Thangesh