Ver Mensaje Individual
  #2  
Viejo 28/12/10, 12:19:24
Avatar de kiboqac
kiboqac kiboqac is offline
Member
 
Fecha de Ingreso: mar 2007
Localización: Argentina
Mensajes: 55
La idea es pasar el PDF a Hexa y despues usar la funcion: "SO_NEW_DOCUMENT_ATT_SEND_API1" para adjuntarlo al mail.

Te pego un pedazo de codigo que te va a ser de mucha ayuda



CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = w_pdf
TABLES
binary_tab = wt_hex.

DESCRIBE TABLE wt_hex LINES w_lines.
CONCATENATE 'Adobe Form ' space wi_id '.pdf' INTO wa_head.
APPEND wa_head TO wt_head.

wa_pack-transf_bin = 'X'.
wa_pack-head_start = 1.
wa_pack-head_num = 1.
wa_pack-body_start = 1.
wa_pack-body_num = w_lines.
wa_pack-doc_type = 'PDF'.
wa_pack-obj_name = 'Adobe Form'.
wa_pack-doc_size = w_lines * 255.
CONCATENATE 'Adobe Form ' space wi_id '.pdf' INTO wa_pack-obj_descr.

APPEND wa_pack TO wt_pack.

ENDIF.

ENDIF.

LOOP AT gt_mails INTO w_mail.

* A cuenta de mail externa.
wa_rec-receiver = w_mail.
wa_rec-rec_type = 'U'.
APPEND wa_rec TO wt_rec.

ENDLOOP.


* Envío el mail.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_data
commit_work = 'X'
TABLES
packing_list = wt_pack
object_header = wt_head
contents_txt = wt_txt
contents_hex = wt_hex
receivers = wt_rec
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.
Responder Con Cita