You are on page 1of 13

Integrating POWL with WebDynpro ABAP

Applies to:
WebDynpro ABAP Developer. For more information, visit the Web Dynpro ABAP homepage.

Summary
This document explains how to make personnel object worklist, Feeder class and how to integrate POWL with WD ABAP. Author: Saurav Mago. Company: Infosys Technologies Ltd. Created on: 26 October 2009 Author Bio Saurav Mago is a WebDynpro ABAP Consultant in Infosys Technologies Ltd.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 1

Integrating POWL with WebDynpro ABAP

Table of Contents
Introduction to Personnel Object Worklist ...................................................................................................... 3 Creating a WebDynpro ABAP Application with the POWL usage ................................................................... 3 Output :....................................................................................................................................................... 11 Related Content .......................................................................................................................................... 12 Disclaimer and Liability Notice ..................................................................................................................... 13

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2

Integrating POWL with WebDynpro ABAP

Introduction to Personnel Object Worklist


The Personnel Worklist is a framework which shows list of business objects and also allows specific activities based on the objects made. Specific Activities can be performed for each business object via buttons shown in the objects and thus handling the action of buttons. Personnel Object Worklist Framework is based on WebDynpro ABAP. All the properties of POWL are specified by a standardized class which is known as Feeder Class. The Feeder Class: This class communicates with the database, selects the data as requested by the user, forwards the same to internal cache of POWL and also refreshes the POWL. This class also handlers the action initiated by the user via pressing buttons.

Creating a WebDynpro ABAP Application with the POWL usage


1. The first step is to create your own Feeder Class. Feeder class used must use the interface IF_POWL_FEEDER. ZPOWL_Class is our feeder class, built in SE24. 2. Save the class ZPOWL_CLASS as a local object. Here in the fig below ,we can see ZPOWL_CLASS is made and is using the interface IF_POWL_FEEDER.

3. Implemented Feeder class has various methods as shown in fig.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 3

Integrating POWL with WebDynpro ABAP

Not all methods provided by the POWER List interface need to be used from the start; there are mandatory methods and optional ones. GET_OBJECTS and GET_OBJECT_DEFINITION are two mandatory methods, rest are optional. One can code these methods and check for output. GET_OBJECTS : This method is used to Retrieve data from the backend system. Data retrieval can be done via simple select query or by using a function module. Selected data is passed to E_RESULTS which is exporting parameter of this method.
METHOD if_powl_feeder~get_objects. DATA : itab TYPE TABLE OF sflight, wa TYPE sflight. FIELD-SYMBOLS : <ls> LIKE LINE OF itab. SELECT * FROM sflight INTO TABLE itab. LOOP AT itab ASSIGNING <ls>. MOVE-CORRESPONDING <ls> TO wa. INSERT wa INTO TABLE me->mt_result. ENDLOOP. e_results = me->mt_result. ENDMETHOD.

GET_OBJECT_DEFINITION: This method is used to define the container (e.g. specify field types ) where the selected data gets stored. o METHOD IF_POWL_FEEDER~GET_OBJECT_DEFINITION. * return the table type description for the private object attribute MT_RESULT e_object_def ?= cl_abap_tabledescr=>describe_by_data( mt_result ). ENDMETHOD. GET_SEL_CRITERIA: In these method selection criteria is defined for this particular feeder. GET_FIELD_CATALOG: This method describes the field catalog to be used for query results table and the UI properties of the particular fields. o Various properties can be set here: Column position, column header, column visible, column color etc. The structure used for this is POWL_FIELDCAT_STY. GET_ACTIONS: In this method, we can define the buttons with properties defined in structure POWL_ACTDESCR_STY like text, tooltip, index etc. HANDLE_ACTION: In this, all the actions for the buttons are defined and also we can control enable/disable property of buttons here. Control can be transferred from class to portal via firing a event using : o E_portal_actions-fire_wdevent = abap_true. GET_ACTION_CONF: In this method, one can fire a confirmation window say on the click of button, it will ask user whether to delete the entries or not. 4. After a feeder is developed, it needs to be made visible to the roles. Basically, this means we need to register the feeder under a specific APPLID, define a POWER List type and introduce it to the roles 5. Create an Application ID (APPLID which will be used in the role to specify the target (your feeder) which will then be shown as POWER List homepage in the SAP Net Weaver Business Client. Transaction used to create APPLID: FPB_MAINTAIN_HIER. Click on new entry button and give a name to APPLID as shown in fig.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 4

Integrating POWL with WebDynpro ABAP

6. Press save, it will ask for transport request. Give transport request and save it. Now u can see ur entry (ZPOWL_APPLID) in the list.

7. Now create Powl type for the Feeder class which we have created earlier. Transaction used to create powl type: POWL_TYPE. Here ZPOWL_TYPE is our Powl type created for feeder ZPOWL_CLASS. 8. Role assignment for the POWER List Type: Here we connect the APPLID with the Powl type and make it visible to the role. Transaction used: POWL_TYPER. Role is Optional field and can be specified only if a role dependent mapping is required

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 5

Integrating POWL with WebDynpro ABAP

9. Query for Power List: Here we define default queries for power list. A query id is made which is connected to Powl type. Transaction used: powl_query.

10. The APPLID and the QUERYID get mapped to each other via transaction POWL_QUERYR. Tick the checkbox Activate. If several queries are defined then sequence of tabs can be controlled via this transaction.

11. Create a WebDynpro component ZPOWL_COMP and save it as a Local Object.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 6

Integrating POWL with WebDynpro ABAP

12. Define Component usage. POWL_UI_COMP is the main Powl UI component used in this component.

13. In the properties tab of Windows, define the usage of powl_ui_comp component.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 7

Integrating POWL with WebDynpro ABAP

14. In the Outbound plugs Tab of windows, define an outbound plug with parameters as shown in fig. :
APPLID type string QNAME type powl_query_ty FORALLQ type powl_xflag_ty QSELPARA type string REFRESHQ type powl_xflag_ty REFRESHA type powl_xflag_ty SRVGROUP type powl_xflag_ty

15. Define a view Container inside the Powl_view which is embedded into the windows POWL_WIN.

Inside the view container, embed the view Powl_Master of Powl_UI_Comp component as shown in fig.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 8

Integrating POWL with WebDynpro ABAP

16. Define the mapping of Outbound plug of windows with Default plug of view Powl_Master as shown:

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 9

Integrating POWL with WebDynpro ABAP

17. In the methods Tab of Windows , write the code in Handle Default Event handler to fire the outbound plug to Powl_Master View :
DATA: LV_INBOX_QUERY TYPE STRING, LT_QUERY_PARAMS TYPE RSPARAMS_TT, LWA_PARAM TYPE RSPARAMS. DATA LV_QNAME TYPE POWL_QUERY_TY. LV_QNAME = 'ZPOWL_QUERY' . CALL FUNCTION 'POWL_ENCODE_SELPARA' EXPORTING I_SELPARA = LT_QUERY_PARAMS I_ESCAPE = '_line IMPORTING E_SELPARA_STRING = LV_INBOX_QUERY. WD_THIS->FIRE_OUT_PLG( APPLID = 'ZPOWL_APPLID' QNAME = LV_QNAME FORALLQ = 'X' QSELPARA = LV_INBOX_QUERY REFRESHQ = 'X' REFRESHA = 'X' SRVGROUP = 'X' ).

" " " " " " "

string powl_query_ty powl_xflag_ty string powl_xflag_ty powl_xflag_ty powl_xflag_ty

Now activate the whole program and run the application.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 10

Integrating POWL with WebDynpro ABAP

Output :

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 11

Integrating POWL with WebDynpro ABAP

Related Content
http://wiki.sdn.sap.com/wiki/display/WDABAP/Main For more information, visit the Web Dynpro ABAP homepage.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 12

Integrating POWL with WebDynpro ABAP

Disclaimer and Liability Notice


This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 13

You might also like