TYEE INDEX TABLE,
TYPE any.
CASE iv_service name.
WHEN '2NOTIFY_REQUESTOR'
* Got and read CR and Jaunch
E-mail
notification
CALL METHOD cl_uemd_crequest ap:
EXEORTING
iv_crequest
IMPORTING
e_inet_crequest api
.get_instance
iv_or_nunber
lo_crequest.
CALL METHOD 1o_crequest->read_crequest
IMPORTING
1s_creque!
November 2013How To... MDG-M: Send a Mail notation during the governance process Send an E-Mail notification”
SELECT SINGLE * INTO le_statue_txttable FROM uemdl30¢
WEERE langu = 'EN'
AND usmd_creq status = 1s crequest-uend_creq status.
CALL FUNCTION *ZCT_USER_SEND_NATL*
EXBORTING
iv_creguest_id = iv_cr_nunber
ivluser_nane = 1s crequest-usmd_created by
ct = 1s status_txttable~
iy status:
Badi calls Function Module logic to build text and send out as E-Mail. Example coding}
FUNCTION zct_user_send mail «
s"#tiocal Interface:
"IMPORTING
+ REFERENCE (IV_CREQUEST_ID) TYPE USMD_CREQUEST DEFAULT
a "900000000204"
«REFERENCE (1V_USER_NAME) TYPE SYUNAME DSFAULT '101012.
"REFERENCE (1V_STA ExT) TYPE USMD_TXTME
* Example Report for usage of CL_BCS MESSAGE:
lo message REF 90 21 bes message,
Ax bes_send TYPE REF 10 cx_bes_send,
Lv_err_text string,
iy_crecuest aut QYPE chavi2,
ay status text
snd _txtmi,
ivmail_address TYPE string,
Iv_creator_name TYPE ad_namtext,
ly_subject ‘TYEE ctzing,
ay Body yee string.
PERFORM init USING iv _creque:
iv_statie_text
CHANGING 1v_ereque:
Ly_statue_cext
ly mail addvess
iv lerestor name.
ext
IE lv _mail_addvess Is Nov INITIAL.
TRY.
November 2013 10How To... MDG-M: Send a Mail notation during the governance process Send an E-Mail notification”
CREATE OBJECT lo_message.
wee create subject
PERFORM creat
subject USING — 1v_crequest_ext
CHANGING 1v_subject.
lo_message->set_subject ( lv_subject ).
gle text document
body USING — 1v_crequest_ext
Ly status text
iy leseatce name
CHANGING 1v_body.
1o_message->set_main_doc( 1v_pody }.
*## create body as
PERFORM creat
te* set recipient
Jo message-Sadd recipient ( Iv mail address ).
tee sot attributes
lo_message->set_status_mail( 'N' }
lo mesaage-Deet requested statua( 'N' ).
1o_message->set_importance( 'N' }.
lo message->eet_send_inmediately( ‘x ).
t#* send mail
lo_message->send( ).
lo message-cehow send log( ).
CATCH cx_bes_send INTO 1x bos_gend.
Ly ere text = 1x bes sendoget text ().
MESsacE 1v_err_text TYPE ‘E'.
ENDIRY.
ENDIF.
ENDEUNCTION.
*
FORM create subject USING iv_crequest_id TYPE charl2
CHANGING ev_subject TYPE string.
CONCRIENATE ‘Change Request’ iv crequest_id ‘has been completed’
INTO evy_subject SEPARATED BY space.
ENDFORM. "create subi)
id USING iv erequest_id TYPE usnd_crequest
CHANGING ev_crequest_ext TYPE chari2.
November 2013 4How To... MDG-M: Send a Mail notation during the governance process Send an E-Mail notification”
TATA:
Lo model QYPE REF TO if uand model,
Lt message TYPE usmd_t_message.
cl_usnd_model->get_instance (
EXPORTING
_uemd model = space
IMPORTING
eo instance = lo model
etmessage - It message ].
LOOP AT 1t_measage TRANSPORTING NO FIELDS
WHERE magty CA usmd0_cs magty-severe.
ENDLOOP.
CHECK NOT sy-subro IS INITIAL.
lo madel-sconvert_char_output (
SXPORTING
4_fieldnane = usmd0_cs_fld-crequest
auvalus_int = iv_crequest_ad
IMPORTING
= valus ext = ev_crequest es
ENDFORM. "
nvert_crequest_id
* Form create body
“6
FORM create body USING iv_crequest_id TYPZ charl2
dy status text usnd_txtmi
ayiee cveazoy ac nantext
CHANGING ev_body TYEE etring.
constants:
lc_linefeed TYPE chaz? VALUE cl_abap_chaz_utilitie:
ic_empty line TYPE string VALUE space.
DATA:
Ly_cr_creator TYPE string,
ay linel QYPE string,
iv line? TYPE string,
iv_arl TYEE string,
lv_line3 TYEE string,
ay line qYPE string,
Ly_Lines TYEE string,
ay body, ‘QYPE string.
November 2013 12How To... MDG-M: Send a Mail notation during the governance process Send an E-Mail notification”
i?
Ly_linel
Av_line2 = 'your change request for creating a material has been complete
a.
* CONCATENATE
mnd_entity_value2?SAP-CLIEW
956SAP-LANGI
CONFIGID-MDG MM_APP_BS MAT GEN BATCCREQUEST-" 4
CONCATENATE
ext INTO 1lv_line3 separated by space.
lv lined = ‘Warm Regards, ".
ly lines = ‘Apple MDG Adminatrator'.
CONCATENATE 1v_linel
-_enpty_line
Ay_line3
Ic_enpty_line
iv Lined
Av_lines
‘https: //uxcic5t. wat. sap. corp
"change Request ' iv crequest_id ‘ has status:
:44371/sap/be/webdynpro/sap/us
INGIS_CREQ_MODE=XaSAP-W0-
y enequest id INTO Iv url.
* 4v_stacus_t
maa
INTO ev_body SEPARATED BY 1¢_Linefeed.
ENDFORM.
"ereate body
Form init
FORM init USING iv crequest id TYPE
ivluser nan = TYPE
ivistatue_text TYPE
CHANGING ev_crequest_ext TYRE
evistatus text TYPE
evmail adaesss TYPE,
ev_ereator_name TYPE
usmd_crequest
sysname
uamd_t:
chari2
steing
ad_nantext.
DATA:
Le_nser_data
itretuza|
Ls_crequest_data TYPS usmdl20c.
‘TYPE bapiaddr3,
TYPE bapirettab,
ev_statue_text
iv_etetus_text.
PERFORM convert _crequest_id USING
iv crequest id
CHANGING ev_crequest_ext.
* get email address user name from provided user id
CALL EUNCTION 'BAPI USER GET_DETAIL'
EXPORTING
November 2013 13How To... MDG-M: Send a Mail notation during the governance process Send an E-Mail notification”
username = iv_usex_nane
cache results = space
IMPORTING
address = 1s_user_data
TABLES
petra Lt _seturn
ev_mail_address - 1s_user_data-e mail.
* get data of the
ange vequest cxeator
ERFORM get_crequest data USING | iv_erequest_id
CHANGING 1s_crequest_data.
CLEAR 1z_usex_data.
CALL FUNCTION 'BAPI USER GET _DETAIL*
EXPORTING
username = 1s_crequest_data-usmi_created by
cache results = space
IMPORTING
address = 1s_user_data
TABLES
peturn Lt_seturn.
ev_creator name Ls _user_data-fullname.
ENDFORM. ninit
* Form get_crequest data
6 —
FORM got_crequest_data USING iv_crequest_id TYPE usmd_crequest
CHANGING ev_crequest_data TYPE usmdi20c.
SELECT SINGLE + FROM usmdl20c INTO ev_crequest_date
WHERE
usmd_craquest = iv_crequest_id.
ENDFORM. nget_en data
November 2013 14How To... MDG-M: Send a Mall notification during the governance process Send an E-Mail notification Sa”
3.2.3. Customizing BRF+ Tab!
3.2.
Create new CR-Type
3.2.3.2 Single Value Decision Table
After successful activation of change request (CR Previous step 91 and previous action 31) the
notification step is called,
Itidentifies next step as 50 which points to the end of the workflow, Condition Alias 89 and New CR
Step 98.
3.2.3.3 Non User Agent Decision Table
Using tcode, USMD_SSW_RULE, insert call to method in appropriate location. Here the notification is
sent to the creator of the workflow upon successful activation.
Create an entry fora step in Nor-user agent decision table for process pattern 02 (synchronous.
method call)
November 2013 16How To... MDG-M: Send a Mail notification during the governance process Send an E-Mail notitestion7
4. Additional Information
4.1 Workitem Notification via E-Mail
Notifications for SAP Business Workflow notify users by E-Mail or SMS about their work items that
need to be processed. Notifications are sent to the relevant user in the form of messages. At present,
ill messages 11M of tort cnty) end SWI8.meseaues ate Supported,
Extended notifications are used to deliver E-Mail notifications to the agents of a workitem that has
‘been sent to them and is waiting for them to process. itis @ Workitem notification and has
linksiinformation about the workitem. This notfcation is generated extemal to the workflow template.
Ina business scenario, for example you could configure extended nottications so that all approving
‘agents get an E-Mail telling them that they have a workitem in their inbox (POWL/UWL), Itis a
notification of a dialog step that they must take action on. Oncs the Extended Notification mail is sent
‘out the workflow step is stil in process waiting for the agent to execute the dialog work iter.
EE rievours of Notifications
RSWUWEML
= Report RSWUWFML
= Polling report
1 Uses SMTPISAPconnect mail connection
Uses SAP Office's auto-forward address
Availabilty: >= 3.41
E-Mail Notifications for Business Workflow
= Report RSWUWFML2
1 New Version of RSWUWFML
‘= WinGui Shortcuts instead of R3F attachments
m Avallabllity: 46C >= <= 6.20
Extended Notifications for SAP Business Workflow
Server notification framework
Availabilty: Web AS 6.40
November 2013 16How To... MDG-M: Send a Mail notation during the governance process Send an E-Mail notification”
Notify users about workitems that
need to be processed
= Send workitems to groupware
(E.g.MS Outlook or Lotus Notes)
carrying direct callbacks to
backend transactions
‘4 Exocution of web-based
‘workitems (Web Dynpro,
People contre Ul”)
+ Execution of workitems via
‘SAP GUI for Windows
FART a aE OT zi z
thre asaes detoaraion x x
rare von hana x x
IM ema (Ouoak oy - x
Lis new Web Us tO | - e x
Serpe vas treraig na : = A x
‘The complete presentation can be found:
sywonw.sdn sap comliscn/index?rid=Mibrary/vui/50322608-0/62-2¢10-eb8-acea876f08be
Online help:
m
Jhelp.sap.com/sephelp nw200ds/helodata/enid5/58 1ee8d561247of34cfod66d 1648 1Mrameset ht
November 2013
7www.sdn.sap.com/irj/sdn/howtoguides