on 05-07-2007 3:28 PM
Hi,
How to Send an Email to Outlook using process type in RSPC?
We created lot of process variants, actually we want to send an mail to users if the DP Background job was succesfully finished.
Actually i tried with create message its not happening...
Plz let me know .. its urgent ...
Regards,
Satish
It should work with messsage. What selection and values did you give for recepients in your message type definition. Also remember it's for either failure or success.
Read <a href="http://help.sap.com/saphelp_nw04/helpdata/en/67/13843b74f7be0fe10000000a114084/frameset.htm">Process Chain creation</a> for more understanding.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Satish,
If you want to send a friendly message to your users, then you can do this by building an ABAP program that calls function module SO_NEW_DOCUMENT_SEND_API1 . You can then insert this ABAP program in your process chain (using the ABAP program process type) or as a second step in your background job. With this technique, you can send an email to SAP users, or to external users (e..g Outlook email addresses)
Here's a sample ABAP code:
data: ls_docdata type SODOCCHGI1,
lt_objcont type table of solisti1,
lt_receivers type table of somlreci1,
ls_objcont type solisti1,
ls_receivers type somlreci1,
ls_user type syuname.
* Fill these variables with subject and msg lines that you need.
data: MAIL_SUBJECT TYPE STRING,
MSG_LINE1 TYPE STRING,
MSG_LINE2 TYPE STRING,
MSG_LINE3 TYPE STRING,
MSG_LINE4 TYPE STRING,
MSG_LINE5 TYPE STRING.
ls_docdata-obj_descr = mail_subject.
ls_objcont-line = msg_line1.
append ls_objcont to lt_objcont.
ls_objcont-line = msg_line2.
append ls_objcont to lt_objcont.
ls_objcont-line = msg_line3.
append ls_objcont to lt_objcont.
ls_objcont-line = msg_line4.
append ls_objcont to lt_objcont.
ls_objcont-line = msg_line5.
append ls_objcont to lt_objcont.
* t_userlist contains the list of users to whom th email will be sent.
loop at t_userlist into ls_user.
ls_receivers-receiver = ls_user.
"Change the type here if email is for outlook users, See documentation
" of function module in SE37
ls_receivers-rec_type = 'B'.
ls_receivers-express = 'X'.
append ls_receivers to lt_receivers.
endloop.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = ls_docdata
tables
OBJECT_CONTENT = lt_objcont
receivers = lt_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
.
You can test out the function module first in SE37 (just put the name of the FM and click execute). Testing it in SE37 will help you get your parameters right.
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Satish,
RSPC is the correct way to trigger a message when the batch job finishes
In my company we do use the same to trigger a message when the planning run finishes to all the planners worlwide.
GO through the following document.It will help you.
Let me know If this helps..
Regards
Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can choose an existing process in your chain --> right click to create message --> Choose successful -->
and follow the next few screens
In the process maintainance --> send message screen you can list your recipients
Use recipient type as internet address and give the address
I believe you need an ITS server or some other basis setting made to be connected for sending Webmail. The system should be able to mail the SAP inbox though. Can you check with your basis people about this?
User | Count |
---|---|
7 | |
4 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.