07-18-2013 8:59 AM
Hi All,
My Requirement is :
A copy or blind carbon copy of all emails that gets generated from SRM ( P2P / S2C ) should be sent to support@XYZ.com.uk. This is to maintain history of all emails that gets generated from SRM.
Please help me to achieve the requirement.
Thanks & Regards,
Ramesh Kmar Singh
07-18-2013 10:19 AM
Hi Ramesh,
You can use the auto forwarding feature of SAP.
If we want to send mails to external mail ID, we follow two approaches
First, maintain User mail ID in SU01, communication method as INT and Go to So16->mail sys grp->send to home add of users.
This will automatically send mails to external mail ID maintained in SU01.
Secondly, maintain automatic forwarding and mails would be sent to external mail ID.
SO you can use any of the approach above to send mail.
For more details
http://help.sap.com/saphelp_nw04/helpdata/EN/6c/69c264418d11d1896e0000e8322d00/content.htm
Regards
07-18-2013 12:27 PM
Hi Mohammed,
Thank you for the quick response. As of now the set requirement is to 'BCC' all the mails to
support@XYZ.com.uk. which are been triggered for any recipient( and not forwarding) in SAP SRM system. Please let me know your thought on that.
Do I have to go for any enhancement or for any custom report to accomplish the requirement.
If yes then which prog.
Thanks,
Ramesh Kumar Singh
07-18-2013 12:54 PM
For all the mails that are send using the FM SO_NEW_DOCUMENT_ATT_SEND_API1, you can make the following enhancement. (You can go to this FM and see the where used list to start with)
The mail sending FM: SO_NEW_DOCUMENT_ATT_SEND_API1 has a tables structure RECEIVERS (LIKE SOMLRECI1).
In structure SOMLRECI1 there are fields COPY & BLIND_COPY.
Just pass 'X' to these fields for the emails ID support@xyz.com.uk and append to the receivers table parameter of the FM.
07-19-2013 1:49 PM
Hi Susmitha,
Thanks a lot for the valuable reply. I have enhanced the FM SO_NEW_DOCUMENT_ATT_SEND_API1 with the following code in the bottom -
Sending mail as CC to receiver
RECEIVERS-RECEIVER = 'support@xyz.com.uk'. " the recipient mail id
RECEIVERS-REC_TYPE = 'U'.
RECEIVERS-COPY = 'X' . " this will send the receiver as cc
append RECEIVERS .
Sending mail as BCC to receiver
RECEIVERS-RECEIVER = ' support@xyz.com.uk'. " the recipient mail id
RECEIVERS-REC_TYPE = 'U'.
RECEIVERS-BLIND_COPY = 'X' . " this will send the receiver as bcc
append RECEIVERS
But the issue is I am not able to see if the CC and BCC mail sent to support@xyz.com.ukor not in tcode SOST. Only the primary recipient('To') is getting displayed. Let me know your thought on that. Do we only get the display of primary recipient?? ( My limitation is that i can't check the support@xyz.com.uk mail inbox)
Also is FM SO_NEW_DOCUMENT_ATT_SEND_API1/ SO_DOCUMENT_SEND_API1 is being used by all sap standard program to send the email (eg PO/Invoice)??
07-20-2013 8:02 AM
Well, just for checking, you can give your email id in the BCC and see if its coming.
Some options you could try are:
In the receivers structure, there are the following notification fields, you can set them to receive notification to the sender.
Also there is a return code for each address in the recievers table.
Also, to see if the document was sent to all receivers, then the sy-subrc of the FM can be checked and exception can be captured.
Exceptions
07-22-2013 2:40 PM
Hi Susmith,
Thanks for your help. I can't put my email id to test because as per the dev box setting(basis setting) only mail can be send to recipient support@xyz.com.uk only....:)
As per your suggestion i have enhanced FM SO_NEW_DOCUMENT_ATT_SEND_API1/ SO_DOCUMENT_SEND_API1 with above logic. That is working fine for the custom reports where FM SO_NEW_DOCUMENT_ATT_SEND_API1/ SO_DOCUMENT_SEND_API1 is being called.
But in standard SAP application program to send email, I think these FM's SO_NEW_DOCUMENT_ATT_SEND_API1/ SO_DOCUMENT_SEND_API1 are not been used. For eg:
if I put a break point in the above FM's and create a mail through T-Code SBWP and try to process it in tcode 'SOST'.,The debugger is not getting triggered.
07-21-2013 9:09 AM
Hi Ramesh,
Please be informed that all the outgoing mails from the SAP system is routed through the SOST queue. You can view the mail details using the tcode SOST. You can have a word with your basis team to send a copy or blind copy of these mails to another recipient, in your case 'support@XYZ.com.uk', provided you have an appropriate sort key to segregate these mails like a common sender mail ID or sender username. There must be settings available with the basis team to re-route the mails. If not, you will have to enhance the standard SOST program to accomplish your requirement.
SOST uses the methods associated with the standard class CL_BCS to send the mails. You can add an additional blind copy recipient object for sending the the mail copy. The code snippet to achieve this is as follows:
DATA: lv_mailbcc TYPE ad_smtpadr,
lo_send_request TYPE REF TO cl_bcs,
lo_recipient_bcc TYPE REF TO if_recipient_bcs.
lv_mailcc = 'support@XYZ.com.uk'.
* Create recipient bcc object
lo_recipient_bcc = cl_cam_address_bcs=>create_internet_address( lv_mailbcc ).
* Add recipient cc object to send request
lo_send_request->add_recipient(
i_recipient = lo_recipient_bcc
i_blind_copy = 'X' ).
Thanks & Regards,
Sarath.
07-22-2013 12:48 PM
Hi Sarath,
Thanks for this very vital information. Can you please pin point me the 'Method' in 'CL_BCS Class' in which I should write the code (Enhancement) so that it will automatically pickup the the 'support@XYZ.com.uk as BCC.
07-23-2013 1:52 PM
Hi Ramesh,
There is no single point of modification for editing the receiver list in SOST as there are mainly two ways in which you can send mails using the two buttons as shown in the below screenshot; the first button for repeating the send procedure and the second button for sending the mails from SOST queue.
Therefore you need to add your recipients to methods pertaining to both the buttons.
You can perhaps add one more recipient to this table as per your requirement.
You need to debug the routines to properly identify the various attributes in the mail and the key in your code accordingly.
Hope this be helpful for you in arriving at a solution to your problem.
Thanks & Regards,
Sarath.