Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9236

Re: converting html file into zip file and send email attaching zip file

$
0
0

Hi Experts,




*// HTML_TAB converting into ZIP File

 

   DATA  : zip_tool TYPE REF TO cl_abap_zip,

           filename TYPE string ,

           filename_zip TYPE string .

 

   DATA  : t_data_tab TYPE TABLE OF x255,

           bin_size TYPE i,

           buffer_x TYPE xstring,

           buffer_zip TYPE xstring.

 

 

filename = text-007.                                                                          "'HTML_TAB

*describe the attachment

   DESCRIBE TABLE html_tab LINES tab_lines.

 

   bin_size = tab_lines * 255.

 

   CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'

     EXPORTING

       input_length = bin_size

     IMPORTING

       buffer       = buffer_x

     TABLES

       binary_tab   = html_tab.

   IF sy-subrc <> 0.

*     message id sy-msgid type sy-msgty number sy-msgno

*     with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

   ENDIF.

 

*create zip tool

   CREATE OBJECT zip_tool.

*add binary file

   CALL METHOD zip_tool->add

     EXPORTING

       name    = 'FSSAI_MAIL.HTML'

       content = buffer_x.

 

*get binary ZIP file

   CALL METHOD zip_tool->save

     RECEIVING

       zip = buffer_zip.

 

   CLEAR: t_data_tab[],bin_size.

   CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'

     EXPORTING

       buffer        = buffer_zip

     IMPORTING

       output_length = bin_size

     TABLES

       binary_tab    = html_tab.




Thanks & Regards,

N. HARISH KUMAR


Viewing all articles
Browse latest Browse all 9236

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>