Custom task approval from POWL

                      

Target Audience

SAP Technical consultants

Workflow consultants

Prerequisites

   Knowledge of SAP Workflow

   SAP NWBC Inbox and POWL overview

   SAP webdynpro development skills

   ABAP Programming skills

 

Purpose

This document is created to help consultants incorporate custom workflows to standard sap POWL and trigger approval webdynpro as popup from NWBC. There will be custom applications which can be triggered from POWL inbox .This will pop up new webdynpro for the approval for the custom task work item. While we click on the workitem links these applications will be launched from where we can execute the approval process.

Introduction

NWBC

SAP NetWeaver Business Client (NWBC) is a new SAP user interface (UI), presenting end users with a seamless integration of classic SAP GUI-based transactions and newly developed applications based on Web Dynpro ABAP. In the desktop variant, a high-fidelity UI is offered to improve the user experience. NWBC provides the user with a typical, modern, desktop-based user experience.

NWBC.jpg

POWL

POWL (Personal Object Worklist) is an alternative for UWL

POWL (Personal Object Worklist) based Inbox is provided in Business Suite Foundation layer for processing work items, alerts and notifications. The inbox is used in Manager Self-Service add-on 1.0 (Work overview section) for processing MSS specific work items and notifications by manager users. Additional POWL queries are available in this inbox for MSS like – leave approvals. If MSS is deployed on SAP Enterprise Portal then also itis possible to use the POWL inbox as an alternative to UWL. An iview can be created in portal to display WebDynpro ABAP application of POWL inbox.

POWL.jpg


POPUP.jpg

            POWL is WebDynpro ABAP based

            Connect different backend system to inbox and retrieve workitems from that system

            Standard actions(Forward, resubmit) available for tasks

                Additional actions can be configured for tasks

            Additional POWL queries can be added

Aim

This document is aiming to integrate workflow to POWL inbox and approval calling custom  webdynpro. As a whole the approval process will have following sap objects.

  • Webdynpro Application to  trigger workflow
  • Workflow template for overtime process.
  • Webdynpro application to approve work item.


Creation of applications and workflow template is out of scope for this document and we would be focusing on integration of workflow task to POWL and calling the approval webdynpro as pop up from POWL.


As we can see below while we click on the work item for over time it has to launch the webdynpro application ZHR_OVERTIME_APPROVAL from backend. This will enable us to either approve or reject the work item fro POWL inbox .This document is written with sample overtime quota approval workflow.



On click of below marked workitem link the webdynpro application for approval has to open.

/wp-content/uploads/2015/08/approve_763725.png


Steps to follow

Step 1: Workflow creation

Now we need to to create the approval workflow for overtime approval and task for approval being assigned to respective managers.

/wp-content/uploads/2015/08/workflow1_763742.png

/wp-content/uploads/2015/08/workflow2_763743.jpg

/wp-content/uploads/2015/08/workflow3_763744.jpg

Step 2: Overtime approval  webdynpro creation

Create webdynpro for custom approval process approval . In our case webdynpro application ZHR_OVERTIME_APPROVAL has been created specific to the application process overtime quota approval.

/wp-content/uploads/2015/08/webdynpro_763745.jpg

/wp-content/uploads/2015/08/webdynpro2_763746.jpg

Step 3: Configure task TS99900038 in POWL so that custom task is visible in  standard POWL inbox MANAGER_MSS_INBOX

/wp-content/uploads/2015/08/spro1_763747.jpg

/wp-content/uploads/2015/08/spro2_763748.jpg

/wp-content/uploads/2015/08/spro3_763749.jpg

/wp-content/uploads/2015/08/spro4_763750.jpg

Step 4: Define action for task TS99900038 in POWL inbox to Pop up webdynpro as default  action like below.

Create an action of type FUNCTIONMODULEACTIONHANDLER We can pass workitem id as parameter to this function module.

/wp-content/uploads/2015/08/spro5_763614.jpg

/wp-content/uploads/2015/08/spro6_763615.jpg

/wp-content/uploads/2015/08/spro7_763616.jpg

/wp-content/uploads/2015/08/spro8_763751.jpg

/wp-content/uploads/2015/08/spro9_763752.jpg

/wp-content/uploads/2015/08/spro11_763753.jpg

/wp-content/uploads/2015/08/spro12_763754.jpg

/wp-content/uploads/2015/08/spro13_763755.jpg

/wp-content/uploads/2015/08/spro14_763756.jpg

/wp-content/uploads/2015/08/spro15_763757.jpg

/wp-content/uploads/2015/08/spro16_763758.jpg

/wp-content/uploads/2015/08/spro17_763759.jpg

Step 5: Now create new launch pad to pop up webdynpro from POWL in transaction LPD_CUST

/wp-content/uploads/2015/08/lpd1_763760.jpg

/wp-content/uploads/2015/08/lpd2_763761.jpg

/wp-content/uploads/2015/08/lpd3_763762.jpg

/wp-content/uploads/2015/08/lpd2_763763.png

/wp-content/uploads/2015/08/lpd4_763764.jpg

/wp-content/uploads/2015/08/lpd5_763791.jpg

  

Step 6: Now create function module ZHR_FM_APPROVEOT_POWL with the code logic below. This code will be called from POWL inbox when employee clicks on the workitem.

FM1.jpg

/wp-content/uploads/2015/08/fm2_763793.jpg

DATA lv_url TYPE string,
lv_value
TYPE string,
lv_index
TYPE rstabix,
lv_instance 
TYPE apb_lpd_instance,
lv_indx
(2) TYPE c,
lv_role            
TYPE apb_lpd_role.

DATA: lt_appl_params TYPE apb_lpd_t_params,
ls_appl_params
LIKE LINE OF lt_appl_params,
lt_business_params
TYPE apb_lpd_t_params.
DATA  ls_parameter TYPE LINE OF apb_lpd_t_params.

IF NOT wi_id IS INITIAL.

ls_appl_paramskey = ‘WI_ID’.
ls_appl_params
value wi_id.
APPEND ls_appl_params TO lt_appl_params.

lv_role     = ‘MSS’.
lv_instance
= ‘OVERTIME’.

CALL METHOD cl_hr_navigation_services=>navigate
EXPORTING
iv_role                  
= lv_role
iv_instance              
= lv_instance
iv_application_alias     
= ‘zhr_overtime_approval’
it_application_parameters
= lt_business_params
it_business_parameters   
= lt_appl_params.
ENDIF.

Step 7: Now the workitem pending for approval in POWL inbox will launch the webdynpro ZHR_OVERTIME_APPROVAL when the workitem is clicked.

This application has provisions to execute work item approval and rejection as designed in the view layout of the approval webdynpro.

/wp-content/uploads/2015/08/approve_763725.png

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply