Ver Mensaje Individual
  #2  
Viejo 20/10/06, 06:48:25
sap2006 sap2006 is offline
Senior Member
 
Fecha de Ingreso: mar 2006
Mensajes: 134
Aqui te dejo un ejemplillo....

form enviar_mail .


DATA: wprespuesta,
return,
wdatatex(50),
wtext1(50).

DATA: BEGIN OF tabla_cont OCCURS 0.
INCLUDE STRUCTURE soli.
DATA: END OF tabla_cont.

DATA: BEGIN OF tabla_receipt OCCURS 0,
recnam LIKE sy-uname,
END OF tabla_receipt.

DATA: r_object_hd_change LIKE sood1,
v_lineas TYPE i.

DATA: BEGIN OF i_objhead OCCURS 0.
INCLUDE STRUCTURE soli.
DATA: END OF i_objhead.

DATA: BEGIN OF i_objpara OCCURS 0.
INCLUDE STRUCTURE selc.
DATA: END OF i_objpara.

DATA: p_titulo LIKE soli-line.

DATA: BEGIN OF i_receivers OCCURS 0.
INCLUDE STRUCTURE soos1.
DATA: END OF i_receivers.



REFRESH: tabla_receipt, tabla_cont.
CLEAR: tabla_receipt, tabla_cont.
SELECT SINGLE usrid
INTO pa0105-usrid
FROM pa0105
WHERE pernr EQ ztrans_04-zperso AND
subty EQ '0001'.

IF sy-subrc = '0'.
CLEAR wtext1.
REFRESH: tabla_cont. CLEAR: tabla_cont.

concatenate: 'Pedido de compras :' n_compra into wtext1.

*Provisional
TABLA_CONT-LINE = wtext1.
APPEND TABLA_CONT.
p_titulo = 'Creacion de Pedido'.

ENDIF.

i_receivers-recnam = sy-uname.
i_receivers-recesc = 'B'. " Tipo destinatario
i_receivers-rtunam = ''. " Nombre del Destinatario
i_receivers-sndex = 'X'. " Urgente
append i_receivers.


refresh i_objhead.
i_objhead-line = 'ZCHAT'.
append i_objhead.
i_objhead-line = p_titulo.
append i_objhead.

* Informamos el parametro OBJECT_HD_CHANGE.
clear r_object_hd_change.
r_object_hd_change-objla = sy-langu. " Idioma del documento
r_object_hd_change-objsns = 'F'. " Atributos del objeto
r_object_hd_change-objnam = 'ZCHAT'. " Nombre Documento
r_object_hd_change-objdes = p_titulo. " Titulo
r_object_hd_change-acnam = ''. " Transaccion
r_object_hd_change-vmtyp = ''. " Tipo
r_object_hd_change-skips = ''. " Salta 1§ dynpro



call function 'SO_OBJECT_SEND'
EXPORTING
object_hd_change = r_object_hd_change
object_type = 'RAW' " Tipo Documento
outbox_flag = space
owner = sy-uname
delete_flag = 'X'
TABLES
objcont = TABLA_CONT " Mensaje
objhead = i_objhead " N.lineas objcont
objpara = i_objpara
receivers = i_receivers " Destinatario
EXCEPTIONS
active_user_not_exist = 1
communication_failure = 2
component_not_available = 3
folder_not_exist = 4
folder_no_authorization = 5
forwarder_not_exist = 6
note_not_exist = 7
object_not_exist = 8
object_not_sent = 9
object_no_authorization = 10
object_type_not_exist = 11
operation_no_authorization = 12
owner_not_exist = 13
parameter_error = 14
substitute_not_active = 15
substitute_not_defined = 16
system_failure = 17
too_much_receivers = 18
user_not_exist = 19
x_error = 20
others = 21.

endform. " enviar_mail
Responder Con Cita