Application Development 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: 

itab to XML and to FTP server

Former Member
0 Kudos

dear all my friends

i have five internal tables that i would like to convert them to xml files put them in an ftp server directory .

which function modules that i should use please support me with a code sample .

thanks

Moderator message: please do more research before posting.

Message was edited by: Thomas Zloch

1 REPLY 1

former_member585060
Active Contributor
0 Kudos

Hi,

   Regarding XML conversion, if you have Class CL_SALV_TABLE in your system, it has a Method TO_XML which you can use to convert to XML, below is the sample logic.

 

 

****************************************************

DATA: gcl_alv     TYPE REF TO cl_salv_table,

           v_xstring   TYPE xstring.

           v_msg       TYPE REF TO cx_salv_msg.

    

  TRY.

 

      cl_salv_table=>factory(

        IMPORTING

          r_salv_table = gcl_alv

        CHANGING

          t_table      = i_itab ).

     CATCH v_msg INTO lx_msg.

 

  ENDTRY.

   v_xstring = gcl_alv->to_xml( '04' ) .

******************************************************

V_STRING will the internal table data in XML format. Similarly use create for other internal tables.

  

Thanks & Regards

Bala Krishna