Ver Mensaje Individual
  #5  
Viejo 16/09/11, 17:46:44
marianoboni marianoboni is offline
Member
 
Fecha de Ingreso: abr 2008
Mensajes: 75
Las clases que utilizo son :

data:
pdf_content type solix_tab,
send_request type ref to cl_bcs,
document type ref to cl_document_bcs,

Hola, te paso el fragmento de codigo en el que hago esto:





TRY.
* -------- create persistent send request ------------------------
send_request = cl_bcs=>create_persistent( ).

* -------- create and set document -------------------------------
pdf_content = cl_document_bcs=>xstring_to_solix( pdf_xstring ).

pdf_content2 = cl_document_bcs=>xstring_to_solix( pdf_xstring2 ).

APPEND 'Hello world!' TO text.

document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = text
i_length = '12'
i_subject = text-001 ).

* Creo el attachment
TRY.

document->add_attachment(
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = motivo_email
i_att_content_hex = pdf_content ).


document->add_attachment(
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = text-002
i_att_content_hex = pdf_content2 ).

CATCH cx_document_bcs INTO lx_document_bcs.
CONCATENATE SY-MSGID '|' SY-MSGTY '|' SY-MSGNO ':' SY-MSGV1 '|' SY-MSGV2 '|' SY-MSGV3 '|' SY-MSGV4 INTO MSG_ID.
EXPORT MSG_ID TO MEMORY ID 'MSG_ID'.
EXIT.
ENDTRY.

* add document object to send request
send_request->set_document( document ).

* --------- add recipient (e-mail address) -----------------------
* create recipient object
recipient = cl_cam_address_bcs=>create_internet_address( mailto ).

* add recipient object to send request
send_request->add_recipient( recipient ).

* ---------- send document ---------------------------------------
sent_to_all = send_request->send( i_with_error_screen = 'X' ).

commit work.

*------------------------------------------------

ENDTRY.
Responder Con Cita