06-08-2009 4:44 PM
Hi SAP Gurus,
I have developed a Z-Program which picks data and sends mails to respective vendors. I have used FM SO_NEW_DOCUMENT_SEND_API1. Mails are getting triggered but late by 5 hours which is Time Zone(CET) but not system time . ex: system time = 12:00:00 CET Time : 15:00:00
After i trigger mail i have to go to the tcode SOST and set wait time to system time everytime. But system time and CET time should be maintained as indicated above. I cannot change CET time.
Please provide me the solution so that whenever i trigger mails programmatically it has to reach vendors immediately.
Regards,
Kranthi
06-08-2009 5:32 PM
You can use the class CL_BCS instead of the FM that you are using with which you can trigger the email immediately using the method SET_SEND_IMMEDIATELY
Check the sap demo programs BCS_EXAMPLE_1, BCS_EXAMPLE_2, BCS_EXAMPLE_3, BCS_EXAMPLE_4, BCS_EXAMPLE_5, BCS_EXAMPLE_6 to learn about the usage of this class.
Regards,
Trikanth Basetty
06-09-2009 3:34 PM
Hi,
Thanks for replying . But how to use this SET_SEND_IMMEDIATELY method as i am new to the OOPs. I have checked the method in the programs you have provided but i couldn't get the solution. Please help me.
Regards,
Kranthi
06-09-2009 9:53 PM
Copy the BCS_EXAMPLE_1 into a Z Program and change the recipient email id to your own in the code which is hard-coded.
If you execute the zprogram as is after changing email id, an email will be triggered as per you SCOT setting on how frequent the emails will be sent out from the system.
But if you call the SET_SEND_IMMEDIATELY , no matter how the settings are, the email will be dispatched immediately.
Just add the following call before the SEND method as shown in the code below
CALL METHOD SEND_REQUEST->SET_SEND_IMMEDIATELY('X').
CALL METHOD SEND_REQUEST->SET_SEND_IMMEDIATELY('X').
** ---------- send document ---------------------------------------
CALL METHOD SEND_REQUEST->SEND(
EXPORTING
I_WITH_ERROR_SCREEN = 'X'
RECEIVING
RESULT = SENT_TO_ALL ).
IF SENT_TO_ALL = 'X'.
WRITE TEXT-003.
ENDIF.
COMMIT WORK.
You can also refer the following Help to explore the functionality of each method.
[http://help.sap.com/saphelp_nw2004s/helpdata/en/2d/1c5d3aebba4c38e10000000a114084/frameset.htm]
Regards,
Trikanth
06-08-2009 9:21 PM
Hi,
I fully agree with Trikanth. Use CL_BCS. You will be much more flexible.
Regards,
Bert
06-10-2009 7:02 AM
06-10-2009 7:13 AM
Hi,
Add the below code after send email FM..It will trigger the email when ever the email is generated from the FM
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = ''
AND RETURN.
06-10-2009 2:03 PM
check the link
/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
12-01-2009 8:58 PM
Hello, in the variable that points to somlreci1 (where you indicate the addressee), you have him to set the field express = 'X'.