#1
|
|||
|
|||
enviar pdf por correo. no envia archivo adjunto
hola a todos tengo un problema con el archivo pdf para enviarlo por correo, aca dejo el codigo que estoy usando pero no encuentro donde enviar el archivo pdf.
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE SLIS_SELFIELD. *CASE rs_selfield-fieldname. READ TABLE gt_report INTO gs_report INDEX rs_selfield-tabindex. DATA: it_body TYPE TABLE OF solisti1 WITH HEADER LINE, gd_doc_data LIKE sodocchgi1, it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE, it_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE, tab_lines LIKE sy-tabix. DATA: wl_body LIKE it_body-line. * Armamos el contenido del cuerpo CONCATENATE text-m01 '904512' text-m02 'MMMTPA' '.' INTO wl_body SEPARATED BY space. it_body-line = wl_body. APPEND it_body. ** Equivalente a un salto de linea CLEAR wl_body. it_body-line = wl_body. APPEND it_body. APPEND gs_report to li_dat_bin. ** Pie de Cuerpo it_body-line = text-m03. APPEND it_body. * Creamos el mail DESCRIBE TABLE it_body LINES tab_lines. READ TABLE it_body INDEX tab_lines. gd_doc_data-doc_size = ( tab_lines ) * 255 + STRLEN( it_body ). * atributos especiales del mensaje gd_doc_data-obj_langu = sy-langu. gd_doc_data-obj_descr = text-m04. * Cuerpo del mensaje it_packing_list-transf_bin = space. it_packing_list-head_start = 1. it_packing_list-head_num = 0. it_packing_list-body_start = 1. DESCRIBE TABLE it_body LINES it_packing_list-body_num. it_packing_list-doc_type = 'bin'. * it_packing_list-obj_name = gs_report-PAY_RECEIPT. it_packing_list-obj_name ='File'. APPEND it_packing_list. * add direc. mail it_receivers-receiver = 'cesarcaes01@gmail.com'. it_receivers-rec_type = 'U'. it_receivers-com_type = 'INT'. it_receivers-notif_del = 'X'. it_receivers-notif_ndel = 'X'. APPEND it_receivers. "SEND MAIL ALL Ó DOWNLOAD MAIL CASE R_UCOMM. "Send mail all employee WHEN '/&INFO'. WRITE :/02 SY-VLINE, rs_selfield-fieldname. write R_UCOMM. write rs_selfield-value. *CLEAR gt_report. * CHECK rs_selfield-tabindex NE 0. * READ TABLE gt_report INTO gs_report INDEX rs_selfield-tabindex. IF sy-subrc EQ 0. CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1' EXPORTING document_data = gd_doc_data * put_in_outbox = 'X' commit_work = 'X' TABLES packing_list = it_packing_list contents_txt = it_body receivers = it_receivers EXCEPTIONS too_many_receivers = 1 document_not_sent = 2 document_type_not_exist = 3 operation_no_authorization = 4 parameter_error = 5 x_error = 6 enqueue_error = 7 OTHERS = 8. IF sy-subrc EQ 0. WRITE: 'e-mail enviado exitósamente'. ELSE. WRITE: 'error en envió de e-mail'. ENDIF. |
Herramientas | Buscar en Tema |
Desplegado | |
|
|