integrating powl with web dynpro abap

Download Integrating powl with web dynpro abap

Post on 06-Jul-2015

1.774 views

Category:

Documents

3 download

Embed Size (px)

TRANSCRIPT

  • 1. SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2009 SAP AG 1Integrating POWL with WebDynproABAPApplies to:WebDynpro ABAP Developer. For more information, visit the Web Dynpro ABAP homepage.SummaryThis document explains how to make personnel object worklist, Feeder class and how to integrate POWLwith WD ABAP.Author: Saurav Mago.Company: Infosys Technologies Ltd.Created on: 26 October 2009Author BioSaurav Mago is a WebDynpro ABAP Consultant in Infosys Technologies Ltd.

2. Integrating POWL with WebDynpro ABAPSAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2009 SAP AG 2Table of ContentsIntroduction to Personnel Object Worklist ......................................................................................................3Creating a WebDynpro ABAP Application with the POWL usage...................................................................3Output :.......................................................................................................................................................11Related Content..........................................................................................................................................12Disclaimer and Liability Notice.....................................................................................................................13 3. Integrating POWL with WebDynpro ABAPSAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2009 SAP AG 3Introduction to Personnel Object WorklistThe Personnel Worklist is a framework which shows list of business objects and also allows specific activitiesbased on the objects made. Specific Activities can be performed for each business object via buttons shownin 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 usage1. 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_CLASSis made and is using the interface IF_POWL_FEEDER.3. Implemented Feeder class has various methods as shown in fig. 4. Integrating POWL with WebDynpro ABAPSAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2009 SAP AG 4Not all methods provided by the POWER List interface need to be used from the start; there are mandatorymethods 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 canbe done via simple select query or by using a function module. Selected data is passed toE_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 : LIKE LINE OF itab.SELECT * FROM sflight INTO TABLE itab.LOOP AT itab ASSIGNING .MOVE-CORRESPONDING 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_RESULTe_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 tableand the UI properties of the particular fields.o Various properties can be set here: Column position, column header, column visible, columncolor etc. The structure used for this is POWL_FIELDCAT_STY. GET_ACTIONS: In this method, we can define the buttons with properties defined in structurePOWL_ACTDESCR_STY like text, tooltip, index etc. HANDLE_ACTION: In this, all the actions for the buttons are defined and also we can controlenable/disable property of buttons here. Control can be transferred from class to portal via firing aevent 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 toregister the feeder under a specific APPLID, define a POWER List type and introduce it to the roles5. 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. 5. Integrating POWL with WebDynpro ABAPSAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2009 SAP AG 56. 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 andmake 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 6. Integrating POWL with WebDynpro ABAPSAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2009 SAP AG 69. Query for Power List: Here we define default queries for power list. A query id is made which isconnected 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 controlledvia this transaction.11. Create a WebDynpro component ZPOWL_COMP and save it as a Local Object. 7. Integrating POWL with WebDynpro ABAPSAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2009 SAP AG 712. Define Component usage. POWL_UI_COMP is the main Powl UI component used in thiscomponent.13. In the properties tab of Windows, define the usage of powl_ui_comp component. 8. Integrating POWL with WebDynpro ABAPSAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2009 SAP AG 814. In the Outbound plugs Tab of windows, define an outbound plug with parameters as shown in fig. :APPLID type stringQNAME type powl_query_tyFORALLQ type powl_xflag_tyQSELPARA type stringREFRESHQ type powl_xflag_tyREFRESHA type powl_xflag_tySRVGROUP type powl_xflag_ty15. 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 infig. 9. Integrating POWL with WebDynpro ABAPSAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2009 SAP AG 916. Define the mapping of Outbound plug of windows with Default plug of view Powl_Master as shown:. 10. Integrating POWL with WebDynpro ABAPSAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2009 SAP AG 1017. In the methods Tab of Windows , write the code in Handle Default Event handler to fire the outboundplug 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_SELPARAEXPORTINGI_SELPARA = LT_QUERY_PARAMSI_ESCAPE = _line IMPORTINGE_SELPARA_STRING = LV_INBOX_QUERY.WD_THIS->FIRE_OUT_PLG(APPLID = ZPOWL_APPLID " stringQNAME = LV_QNAME " powl_query_tyFORALLQ = X " powl_xflag_tyQSELPARA = LV_INBOX_QUERY " stringREFRESHQ = X " powl_xflag_tyREFRESHA = X " powl_xflag_tySRVGROUP = X " powl_xflag_ty).Now activate the whole program and run the application. 11. Integrating POWL with WebDynpro ABAPSAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2009 SAP AG 11Output : 12. Integrating POWL with WebDynpro ABAPSAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2009 SAP AG 12Related Contenthttp://wiki.sdn.sap.com/wiki/display/WDABAP/MainFor more information, visit the Web Dynpro ABAP homepage. 13. Integrating POWL with WebDynpro ABAPSAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2009 SAP AG 13Disclaimer and Liability NoticeThis document may discuss sample coding or other information that does not include SAP official interfaces and therefore is notsupported 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 orcode sample, including any liability resulting from incompatibility between the content within this document and the materials andservices offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to t