Skip to end of metadata
Go to start of metadata

How-To Refresh POWL Queries from a Client Window

1. Purpose

POWL offers the possibility to launch client windows upon performing an action on the object list. Once the client window is closed, it should be possible to trigger a refresh of the POWL result list so that any object editing done within the client window is reflected in the POWL. This document explains how a refresh of the POWL can be triggered from the client window application.

2. Business Scenario

Consider a scenario in HCM E-Recruiting solution, where a power list is used to display the ‘Open Requisitions’ corresponding to background checks for candidates. Once the recruiter has completed the background check, the status of the same has to be updated for the respective candidates. So, the recruiter selects a particular open request corresponding to a candidate in his worklist and performs the action ‘Process’. This opens the client window where the user enters the actual status of the background check as ‘Completed’ and an additional note. Once this status is updated in the backend and the client window is closed, the corresponding object has to disappear from the worklist since its status is not ‘open’ anymore. To achieve this, the applications should be able to trigger a refresh of the power list from which the client window is launched.

3. Background Information

This functionality is available only within portal environment and NW Business Client.

4. Prerequisites

The client window application has to raise the events as explained in Section 6 to enable this feature. There are no additional changes required at the feeder implementation level.

5. Scope

This functionality is available with NW04S SP15 and above

6. Step-by-Step Procedure

POWL from a client window, a portal event has to be fired to refresh the current query or a subset of the queries in a POWL. POWL offers two events – REFRESH_CURRENT and REFRESH_TYPE_BASED to achieve this.Basically, it is up to the application to decide when the event should be raised.Usually, it makes most sense to trigger the refresh when the client window’s application saves its data in the backend. In some cases, however, it might make How-To Refresh POWL Queries from a Client Windowsense to wait until the client window is closed to trigger the POWL refresh. If you want to implement the trigger when the window is closed, make sure to do it on an application event. It is not possible to use the WDDOEXIT hook method for that, because at that point in time the window has already been closed and the connection to the portal is lost.

Event REFRESH_CURRENT:

This event has to be raised to trigger a refresh of the current query from which the client window was launched. The sample code is as follows: DATAlo_api_component TYPE REF TO if_wd_component.
DATAlo_api_component = wd_comp_controller->wd_get_api( ).

lo_portal_manager = lo_api_component->get_portal_manager( ).lo_portal_manager TYPE REF TO if_wd_portal_integration.
DATA lo_api_controller ?= wd_this->wd_get_api( ).lo_api_controller TYPE REF TO if_wd_view_controller.
CALL METHODlo_portal_manager->fire
EXPORTINGportal_event_namespace ='com.sap.powl'
portal_event_name ='REFRESH_CURRENT'
portal_event_parameter =''
portal_event_scope = IF_WD_PORTAL_INTEGRATION=>CO_EVENT_SCOPE-CURRENT_WINDOW_AND_PARENTS.

.Event REFRESH_TYPE_BASED:

This event has to be raised to trigger a refresh of queries belonging to certain object types of the application. The list of object types (POWL Types) whose queries require a refresh will have to be passed as event parameters in this case. The sample code is as follows:DATAlo_api_component TYPE REF TO if_wd_component.
DATA lo_api_component = wd_comp_controller->wd_get_api( ).

lo_portal_manager = lo_api_component->get_portal_manager( ).lo_portal_manager TYPE REF TO if_wd_portal_integration.
DATA lo_api_controller ?= wd_this->wd_get_api( ).lo_api_controller TYPE REF TO if_wd_view_controller.
CALL METHODlo_portal_manager->fire
EXPORTINGportal_event_namespace = 'com.sap.powl'
portal_event_name = 'REFRESH_TYPE_BASED'
portal_event_parameter = 'typea&typeb&typec'
portal_event_scope = IF_WD_PORTAL_INTEGRATION=>CO_EVENT_SCOPE-CURRENT_WINDOW_AND_PARENTS.

How-To Refresh POWL Queries from a Client Window For FPM applications, the client window application must implement the interface
IF_FPM_TRANSACTION, either in the shared data component (containing the business logic) or in the component which triggers saving the application data. Using the FPM transaction concept, the application raises the FPM event CL_FPM_EVENT=>GC_EVENT_SAVE and implements the code for saving in the interface method SAVE. If none of the components implement IF_FPM_TRANSACTION, the component which saves the application data can be used to implement it. In the SAVE method of the interface you can just call your original method for saving application data. With IF_FPM_TRANSACTION implemented, use the interface method AFTER_COMMIT to fire the event to refresh the POWL.