0% found this document useful (0 votes)
97 views

Text Document

This method selects service entry sheet records from the ESSR table that have a specific release status and sends an approval request email to the relevant users. It retrieves the user IDs and email addresses from various reference tables, builds a document change and message table, and calls a function to send the document and notification email. Any errors encountered during the email sending process are written to the log.

Uploaded by

Anil Maurya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views

Text Document

This method selects service entry sheet records from the ESSR table that have a specific release status and sends an approval request email to the relevant users. It retrieves the user IDs and email addresses from various reference tables, builds a document change and message table, and calls a function to send the document and notification email. Any errors encountered during the email sending process are written to the log.

Uploaded by

Anil Maurya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

METHOD IF_EX_GOS_SRV_SELECT~SELECT_SERVICES.

IF SY-TCODE = 'ML81N'.
IF SY-UCOMM = 'YES'.
DATA : IT_ESSR TYPE STANDARD TABLE OF ESSR,
WA_ESSR TYPE ESSR,
W_FRGC1 TYPE T16FS-FRGC1,
W_USRID_LONG TYPE ZETM_PO_REL_MAIL-USRID_LONG,
V_POCREATOR_MAIL TYPE ZETM_PO_REL_MAIL-USRID_LONG,
SUBRC TYPE SY-SUBRC,
ERROR_TABLE TYPE TABLE OF RPBENERR,
RECLIST TYPE TABLE OF SOMLRECI1,
W_RECLIST TYPE SOMLRECI1,
DOC_CHNG TYPE SODOCCHGI1,
WA_MESSAGE TYPE SOLISTI1,
IT_MESSAGE TYPE TABLE OF SOLISTI1.

SELECT SINGLE * FROM ESSR INTO WA_ESSR WHERE LBLNI = IS_LPOR-INSTID.


IF WA_ESSR IS NOT INITIAL.
CHECK WA_ESSR-FRGRL NE ' '.

IF WA_ESSR-FRGZU = ' '. "Release Status


SELECT SINGLE FRGC1
INTO W_FRGC1
FROM T16FS
WHERE FRGGR = WA_ESSR-FRGGR "R9
AND FRGSX = WA_ESSR-FRGSX. "31
IF SY-SUBRC = 0.
SELECT SINGLE EMAIL
FROM ZWF_GET_DETAIL
INTO W_USRID_LONG
WHERE FRGGR = WA_ESSR-FRGGR "Release group
AND FRGSX = WA_ESSR-FRGSX "Release Strategy
AND FRGCO = W_FRGC1. "Release code

CALL FUNCTION 'HR_FBN_GET_USER_EMAIL_ADDRESS'


EXPORTING
USER_ID = WA_ESSR-ERNAM
REACTION = 'X'
IMPORTING
EMAIL_ADDRESS = V_POCREATOR_MAIL
SUBRC = SUBRC
TABLES
ERROR_TABLE = ERROR_TABLE.

IF W_USRID_LONG IS NOT INITIAL.


CLEAR W_RECLIST.
W_RECLIST-RECEIVER = W_USRID_LONG.
W_RECLIST-REC_TYPE = 'U'.
APPEND W_RECLIST TO RECLIST.

CLEAR W_RECLIST.
W_RECLIST-RECEIVER = V_POCREATOR_MAIL.
W_RECLIST-REC_TYPE = 'U'.
W_RECLIST-COPY = 'X' . " this will send the receiver as cc
APPEND W_RECLIST TO RECLIST.

DOC_CHNG-DOC_SIZE = 1.
CONCATENATE 'Servce Entry Sheet :' WA_ESSR-LBLNI 'is awaiting for
approval' INTO DOC_CHNG-OBJ_NAME SEPARATED BY ' '.
CONCATENATE 'Servce Entry Sheet :' WA_ESSR-LBLNI 'is awaiting for
approval' INTO DOC_CHNG-OBJ_DESCR SEPARATED BY ' '.

CONCATENATE 'PR :' WA_ESSR-LBLNI 'is awaiting for your approval' INTO
WA_MESSAGE SEPARATED BY ' '.
APPEND WA_MESSAGE TO IT_MESSAGE.
CLEAR WA_MESSAGE.

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'


EXPORTING
DOCUMENT_DATA = DOC_CHNG
DOCUMENT_TYPE = 'RAW'
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
TABLES
OBJECT_CONTENT = IT_MESSAGE
RECEIVERS = RECLIST.
IF SY-SUBRC <> 0.
WRITE:/ 'Error When Sending the File', SY-SUBRC.
ELSE.
COMMIT WORK.
SUBMIT RSCONN01 WITH MODE = 'INT' AND RETURN.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDMETHOD.

You might also like