Skip to Content

Navigation and Data transfer from POWL to Webdynpro

Summary

This document illustrates how to navigate and data transfer from personnel object work list i.e Feeder class to WD ABAP. 

Author: Rohan Sanjay Uphade

Company: NTT DATA India EAS Ltd.

Created on: 10 March 2013

Author Bio

Rohan is SAP certified Consultant and works in NTT DATA, He has work experience in SAP ABAP, Dynamic programming,

WebDynpro ABAP, POWL , Smart forms , Adobe forms and so on.

Solution

1) Define an Handle Method in POWL FEEDER CLASS

    

  • Method HANDLE_ACTION

METHOD IF_POWL_FEEDER~HANDLE_ACTION.
DATA: LS_PARAMETER TYPE POWL_NAMEVALUE_STY.
DATA : X_RESULT TYPE YEMPLOYEE ,
V_INDEX
TYPE RSTABIX,
V_INDX(
2) TYPE C.
CASE I_ACTIONID.
WHEN ‘POWL_LEAD_SEL’.
CLEAR:X_RESULT,V_INDX.
READ TABLE  C_SELECTED INTO V_INDEX INDEX 1.
IF SY-SUBRC = 0.
V_INDX = V_INDEX-TABIX.
READ TABLE C_RESULT_TAB INTO X_RESULT INDEX V_INDX.
IF SY-SUBRC = 0.
E_PORTAL_ACTIONS-FIRE_WDEVENT = ABAP_TRUE.
LS_PARAMETER-
KEY = ‘EMP_ID’.
LS_PARAMETER-
VALUE = X_RESULT-EMP_ID.
APPEND LS_PARAMETER TO E_PORTAL_ACTIONS-PARAMETERS.
LS_PARAMETER-
KEY = ‘EMP_NAME’.
LS_PARAMETER-
VALUE = X_RESULT-EMP_NAME.
APPEND LS_PARAMETER TO E_PORTAL_ACTIONS-PARAMETERS.
LS_PARAMETER-
KEY = ‘SALARY’.
LS_PARAMETER-
VALUE = X_RESULT-SALARY.
APPEND LS_PARAMETER TO E_PORTAL_ACTIONS-PARAMETERS.
ENDIF.
ENDIF.
ENDCASE.
ENDMETHOD.

2) Now Define an usage of POWL in Webdynpro Application as shown below,

    

  • Define POWL Component usage in properties tab of MAIN VIEW
  • Define an EVENT to get details from POWL Feeder class into our WD application.

Example: Lead selected row in POWL header.

METHOD NAME      :GET_FROM_POWL

METHOD TYPE       :EVENT HANDLER

EVENT                   : POWL_FOLLOW_UP

CONTROLLER         : INTERFACECONTROLLER

COMPONENT USE  :POWL(fired if requested by ‘HANDLE_ACTION’ method of feeder)

METHOD GET_FROM_POWL .
DATA: V_NAME TYPE YEMPLOYEE-EMP_NAME,
LT_PARAMETER   
TYPE POWL_NAMEVALUE_TTY,
LS_PARAMETER   
TYPE POWL_NAMEVALUE_STY.
FIELD-SYMBOLS: <VALUE> TYPE DATA.
WDEVENT->GET_DATA(
EXPORTING NAME = ‘EVENT_PARAMETERS’
IMPORTING VALUE = LT_PARAMETER ).
READ TABLE LT_PARAMETER INTO LS_PARAMETER WITH KEY KEY = ‘EMP_NAME’.
V_NAME = LS_PARAMETER-
VALUE.
CLEAR LS_PARAMETER.
*  AND SO ON FOR OTHER FIELDS
*BIND VALUE TO TEXT VIEW
DATA LO_ND_EMPLOYEE TYPE REF TO IF_WD_CONTEXT_NODE.
DATA LO_EL_EMPLOYEE TYPE REF TO IF_WD_CONTEXT_ELEMENT.
DATA LS_EMPLOYEE TYPE WD_THIS->ELEMENT_EMPLOYEE.
DATA LV_EMP_NAME LIKE LS_EMPLOYEE-EMP_NAME.
LO_ND_EMPLOYEE = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_EMPLOYEE ).
LO_EL_EMPLOYEE = LO_ND_EMPLOYEE->GET_ELEMENT(  ).
LV_EMP_NAME =  V_NAME.
*   GET SINGLE ATTRIBUTE
LO_EL_EMPLOYEE->SET_ATTRIBUTE(
NAME = 
`EMP_NAME`
VALUE = LV_EMP_NAME ) .

ENDMETHOD.

Be the first to leave a comment
You must be Logged on to comment or reply to a post.