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

Re: SUBMIT report and Send spool to e-mail

$
0
0

Hi, Example with submit rfdopo10 to spool through abap program:

 

data: wa_pdf_xstring type xstring,

         lt_partidas type standard table of tline,

         it_pdf_partidas_kunnr type solix_tab.

 

 

 

**   submit rfdopo10   with dd_kunnr in so_kunnr                  

                                   with dd_bukrs = pa_bukrs                   

                                   with dd_stida = pa_data                   

                                   with pa_stida = pa_data                   

                                   to sap-spool                   

                                    without spool dynpro                   

                                        immediately ' '                   

                                   and return.   

 

select single max( rqident ) into l_spool     

from tsp01   

where rq2name like 'RFDOPO10%'   

and  rqowner = sy-uname.   

 

call function 'CONVERT_ABAPSPOOLJOB_2_PDF'     

exporting         src_spoolid  = l_spool       

                         no_background = 'X'     

tables         pdf          = lt_partidas.   

 

 

loop at lt_partidas into l_partidas.     

assign l_partidas to casting.     

concatenate wa_pdf_xstring into wa_pdf_xstring in byte mode.   

endloop.   

 

call function 'SCMS_XSTRING_TO_BINARY'     

exporting         buffer    = wa_pdf_xstring     

tables         binary_tab = it_pdf_partidas_kunnr. 

endif.

 

*mail***

* Email Body   wo_document = cl_document_bcs=>create_document(                                 i_type = 'HTM'                                 i_text = it_message_body                                 i_subject = ' ' ).

 

* Add attachment   

try.         

call method wo_document->add_attachment           

exporting               i_attachment_type    = 'PDF'             

                              i_attachment_subject = 'Lista de partidas individuais Clientes'             

                              i_att_content_hex    = it_pdf_partidas_kunnr.       

catch cx_document_bcs into wx_document_bcs.     

endtry. .....

 

Regards, Maria João Rocha


Viewing all articles
Browse latest Browse all 8950

Trending Articles



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