‎2006 Feb 13 10:13 PM
how could I Create a program to send an email notification to project responsible persons about project budget allocations and their tolerances periodically for those project budgets crossed their allocated limits.
‎2006 Feb 14 3:51 PM
Hi,
You can send the periodic notifications in two ways.
1) Create a Distribution list and added usernames for the concerned members of the project to whome you send a notifications using transaction SO23.
Use the function module SEND_DAZEL_MAIL to send the mail nodification
2) Store the email ids in Ztable and populate the email ids based on some condiations and send a mail.
Hope this solves your problem
Thanks&Regards,
-Revuru s suresh
‎2006 Feb 15 5:37 AM
Hi Reddy,
what u can do is
Set a Flag = 'X' after checking ur requorement.
And check if Flag = 'X' whenwver u have to send an e-mail notification and send using this FM.
DATA: OBJCONT LIKE SOLISTI1 OCCURS 5 WITH HEADER LINE.
DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
DATA: DOC_CHNG LIKE SODOCCHGI1.
DATA: ENTRIES LIKE SY-TABIX.
DATA: NAME(15).
Fill the document
DOC_CHNG-OBJ_NAME = 'URGENT'.
DOC_CHNG-OBJ_DESCR = 'Read at once !'.
DOC_CHNG-SENSITIVTY = 'P'.
OBJCONT = 'E-mail Notification !!!'. "SUBJECT OF E-MAIL
APPEND OBJCONT.
***adding line by line using append objcont*******
OBJCONT = 'DESCRIPTION.....Details !'. " Details in E-mail
APPEND OBJCONT.
OBJCONT = 'Next Line!'.
APPEND OBJCONT.
DESCRIBE TABLE OBJCONT LINES ENTRIES.
READ TABLE OBJCONT INDEX ENTRIES.
DOC_CHNG-DOC_SIZE = ( ENTRIES - 1 ) * 255 + STRLEN( OBJCONT ).
Fill the receiver list**
For SAP USER***
CLEAR RECLIST.
RECLIST-RECEIVER = SY-UNAME. " replace with <login name>
RECLIST-REC_TYPE = 'B'.
RECLIST-EXPRESS = 'X'.
APPEND RECLIST.
For External E-mail ID's
CLEAR RECLIST.
RECLIST-RECEIVER = 'ned.neighbour@ next.door.com'.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
Send the document
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_TYPE = 'RAW'
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
commit_work = 'X'
TABLES
OBJECT_CONTENT = OBJCONT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
CASE SY-SUBRC.
WHEN 0.
LOOP AT RECLIST.
IF RECLIST-RECEIVER = SPACE.
NAME = RECLIST-REC_ID.
ELSE.
NAME = RECLIST-RECEIVER.
ENDIF.
IF RECLIST-RETRN_CODE = 0.
WRITE: / NAME, ': succesfully sent'.
ELSE.
WRITE: / NAME, ': error occured'.
ENDIF.
ENDLOOP.
WHEN 1.
WRITE: / 'Too many receivers specified !'.
WHEN 2.
WRITE: / 'No receiver got the document !'.
WHEN 4.
WRITE: / 'Missing send authority !'.
WHEN OTHERS.
WRITE: / 'Unexpected error occurred !'.
ENDCASE.
******************************************
what extra u have to Do is append more Recivers to RECLIST acc. to ur requirement.
Rest of the documnetation i have Done.
Hope this will help U.
Regards
-
Sachin Dhingra