Ver Mensaje Individual
  #2  
Viejo 01/06/07, 08:40:38
Avatar de nenuke
nenuke nenuke is offline
Member
 
Fecha de Ingreso: sep 2006
Localización: Madrid
Mensajes: 87
Hola,

el siguiente ejemplo te muestra como usar la función SO_NEW_DOCUMENT_SEND_API1 para enviar correo externo.
Debes consultar si está habilitado el servicio de envio de correo externo en tu maquina.


report zrich_0003 .

data: maildata type sodocchgi1.
data: mailtxt type table of solisti1 with header line.
data: mailrec type table of somlrec90 with header line.

start-of-selection.

clear: maildata, mailtxt, mailrec.
refresh: mailtxt, mailrec.

maildata-obj_name = 'TEST'.
maildata-obj_descr = 'Test'.
maildata-obj_langu = sy-langu.

mailtxt-line = 'This is a test'.
append mailtxt.

mailrec-receiver = 'someone@somewhere.com'.
mailrec-rec_type = 'U'.
append mailrec.

call function 'SO_NEW_DOCUMENT_SEND_API1'
exporting
document_data = maildata
document_type = 'RAW'
put_in_outbox = 'X'
tables
object_header = mailtxt
object_content = mailtxt
receivers = mailrec
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 <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.


Un saludo.
Responder Con Cita