2007 Jul 13 6:16 PM
Hi,
Can anyone please let me know whether there are any function module to send an email to SAP Inbox?
Thanks..
Uma.
2007 Jul 13 6:26 PM
Yes, there is.
Try this. It will send a mail to your inbox.
report zrich_0003 .
* For API
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 = sy-uname.
mailrec-rec_type = 'B'.
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.
Regards,
Rich Heilman
Hi,
Can anyone please let me know whether there are any function module to send an email to SAP Inbox?
Thanks..
Uma.
2007 Jul 13 6:25 PM
2007 Jul 13 6:26 PM
Hi
Check the fun modules
UWSP_SEND_MAIL_TO_WEB
SO_NEW_DOCUMENT_ATT_SEND_API1
to send mails to the respective mail Ids
<b>Reward points for useful Answers</b>
Regards
Anji
2007 Jul 13 6:26 PM
Yes, there is.
Try this. It will send a mail to your inbox.
report zrich_0003 .
* For API
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 = sy-uname.
mailrec-rec_type = 'B'.
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.
Regards,
Rich Heilman
2007 Jul 13 6:30 PM
Hi
Check the fun modules
UWSP_SEND_MAIL_TO_WEB
SO_NEW_DOCUMENT_ATT_SEND_API1
to send mails to the respective mail Ids
<b>Reward points for useful Answers</b>
Regards
Anji
2007 Jul 13 6:33 PM
Hi
Check the fun modules
UWSP_SEND_MAIL_TO_WEB
SO_NEW_DOCUMENT_ATT_SEND_API1
to send mails to the respective mail Ids
<b>Reward points for useful Answers</b>
Regards
Anji
2007 Jul 13 7:31 PM
Hi,
There were a lot of usefull answers above, but I would like to add something. You haven't said if you need to send attachment and no one posted a function to do that here, so, here it goes (using the parameters I needed):
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = e_document_data
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = t_packing_list
contents_bin = t_xml
receivers = t_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 <> 0.
vg_erro = c_flag.
ELSE.
MESSAGE s007 WITH text-010.
ENDIF.
You can get more info looking in the FM, but these are the parameters I needed to send a e-mail with attachment.
Regards,
-h
2007 Jul 13 7:44 PM
Hi Uma ,
Use this function
SO_NEW_DOCUMENT_ATT_SEND_API1
If my answer is usefull to you, please reward points.
Thanks
Piyush Mathur