Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

I would like to share my experience with SAP FIORI Approval application through this blog. This blog will walk you through required steps to enable SAP FIORI Approval component to send external email notification with FIORI application URL as part of email. This will allow user to review work item and make a decision (i.e. Approve or Reject).

Here is the main steps to implement Extended Notification for SAP Fiori Approve Purchase Order App or any other Approval apps.

1)      Implement OSS Note in 2056158, if it is required in your system.

2)      Assign Purchase Order Task to UI5_BSP - Visualization Type using SAP Transaction SWFVISU.

3)      Change the workflow Business Scenario setting and Assign Custom handler class using T-code SWNCONFIG.

4)      Testing the SAP Fiori App.


1) Implement OSS Note 2056158 manual correction in your system.

    1. Go to SE11
    2. Enhance the fixed value Domain SWFVVTYP using transaction SE11.
    3. Add the value UI5_BSP (UI5 based on BSP) and activate the domain.

        

2) Create an entry for Purchase Order Task and  Visualization Type as UI5_BSP -  using SAP Transaction SWFVISU.

3) Change the workflow Business Scenario settings and Assign Custom handler class using T-code SWNCONFIG.

    1. Now change the Subscription Basic data.
      1. Recipient Address: “*”
      2. Recipient Type : Cus Receiver Determination Through Handler
      3. Handler : CL_SWN_SUBSCRIPTION as shown below screen shot.

            

2.  Subscription Settings

    1. Show Action Execute As: LINK1

3.  Change Filter Settings: ALL_DELTA

    1. DELTA: “X”
    2. TASK : TS20000166

        

4. Create an entry for General Settings:

    1. Settings: UI5_BSP
    2. Description :
    3. Value :
    4. UI5_BSP Approve Purchase Order URL:

http:// <Server Name>/sap/bc/ui5_ui5/ui2/ushell/shells/abap/FioriLaunchpad.html?sap-client=800&sap-language=EN#PurchaseOrder-approve&/HeaderDetails/WorkflowTaskCollection(SAP__Origin='LOCAL',WorkitemID='{$zitem.externalObjectId}')

5. Create custom handler class and assign the Workflow scenario.

    1. Scenario: WORKFLOW
    2. Visualization Type : UI5_BSP
    3. Category: STANDARD
    4. Message Template: WORKFLOW1
    5. Notification Handler : ZCL_SWN_NOTIF_WORKFLOW
    6. Handler for User : CL_SWN_USER_STD

           

     6. Creating Custom Notification Handler class

     7. Redefine super class method "ADD_LINK_ACTION_EXECUTE"  and following code.

       

               METHOD add_link_action_execute.

     
CALL METHOD super->add_link_action_execute
     
CHANGING
      c_links
= c_links
     
*  EXCEPTIONS
     
*     no_subscription = 1
     
*     others  = 2
     
.
     
IF sy-subrc <> 0.
     
* Implement suitable error handling here
     
ENDIF.
     
*- add link invoking the workitem execution
     
*- according to subscription and general settings

     
DATA li_subs       TYPE REF TO if_swn_subscription.
     
DATA l_execute_as  TYPE swn_showactionas.
     
DATA lt_links      TYPE swntlinks.
     
DATA wa_link       TYPE swnslink.
     
DATA l_param       TYPE string.
     
DATA l_user        TYPE syuname.
     
DATA l_langu       TYPE sylangu.
     
DATA l_logon_id    TYPE string.
     
DATA: lt_text      TYPE textpool_table.
     
DATA l_dummy       TYPE c.
     
DATA lt_visu_tasks TYPE swntvt.
     
DATA l_done        TYPE flag.

     
FIELD-SYMBOLS: <text> LIKE LINE OF lt_text.
     
FIELD-SYMBOLS:
      <visu>
TYPE swfvt.
     
**********************************************************
     
DATA: l_url TYPE string,
      l_param_id
TYPE swn_setting.

      entered
( 'add_link_action_execute' ).

     
*- note 1230808: retrieve texts in the communication language of user
      lt_text
= get_text_elements( ).
      l_langu
= m_user_ref->get_language( ).
      li_subs
= get_subscription_ref( ).
     
*- get subscription params
     
CALL METHOD li_subs->get_value_raw
     
EXPORTING
      i_id   
= 'SHOW_ACTION_EXECUTE_AS'                  "#EC NOTEXT
      RECEIVING
      r_value
= l_execute_as
     
EXCEPTIONS
     
OTHERS  = 1.
     
IF l_execute_as IS INITIAL.
     
*-  note 1057871: workitem execution should not be
     
*-  provided within notification
     
EXIT.
     
ENDIF.

     
*- check if a special visualization type is requested
      lt_visu_tasks
= get_visu_tasks( ).
     
READ TABLE lt_visu_tasks WITH KEY task = app_type
     
ASSIGNING <visu>.
     
IF sy-subrc = 0.
     
IF <visu>-vtyp EQ 'UI5_BSP'.
      l_param_id
= <visu>-vtyp.
      wa_link
-category = swn1_ref_type_tech.
      wa_link
-id = swn1_ref_id_execute.
     
READ TABLE lt_text ASSIGNING <text> WITH KEY id = 'I' key = '002'.
     
IF sy-subrc IS INITIAL.
      wa_link
-caption = <text>-entry.
     
ELSE.
      wa_link
-caption = 'Workitem ausführen'(002).
     
ENDIF.
     
SELECT SINGLE value FROM swn_settings INTO l_url
     
WHERE parameter_id = l_param_id.
     
IF l_url IS NOT INITIAL.
     
REPLACE '{$zitem.externalObjectId}' IN l_url
     
WITH app_key IGNORING CASE.
     
IF sy-subrc <> 0.
     
MESSAGE e155(swn) WITH wa_link-caption INTO wa_link-caption.
     
CLEAR wa_link-url.
     
ENDIF.
      wa_link
-url = l_url.
     
CLEAR : c_links[].
     
APPEND wa_link TO c_links.
      l_done
= 'X'.

     
ENDIF.
     
ENDIF.
     
ENDIF.

      leaving
( 'add_link_action_execute' ).

     
ENDMETHOD.

4)  Testing the SAP Fiori App.

     1)  Create purchase order using ME21 or Me21n transaction as shown below screen shot.

     2)  Run standard program SWN_SELSEN as background job to send external email notification.

     3)  Check your email inbox.

     4) Launch the SAP fiori approval work item by clicking email notification hyper link, then system

          should launch the sap fiori app as shown below screen.

25 Comments
Labels in this area