Demo on Dynamic Progress bar (Web Dynpro for ABAP)

...Previous

16. In the SECOND_VIEW.  Create and Text View UI element and give some text to it as shown below.

17.Creation Plugs for navigation Between Views.

17.1.Go To ‘INBOUND PLUGS’ Tab of ‘SECOND_VIEW’ view in which create a plug named

“”FROM_MAIN””

17.2. Also NOW Go To ‘OUTBOUND PLUGS’ Tab of ‘MAIN’ view in which create a plug named

“”TO_SECOND_VIEW””

18. Now go to ONACTIONTRIGGER Event of ‘MAIN’ View which we had create earlier for ‘TIMED TRIGGER’ UI Element and paste the following code

method ONACTIONTRIGGER .
  
DATA LO_ND_TIME_NODE TYPE REF TO IF_WD_CONTEXT_NODE.

  
DATA LO_EL_TIME_NODE TYPE REF TO IF_WD_CONTEXT_ELEMENT.
  
DATA LS_TIME_NODE TYPE WD_THIS->ELEMENT_TIME_NODE.
  
DATA LV_TIMER TYPE WD_THIS->ELEMENT_TIME_NODE-TIMER.

* navigate from <CONTEXT> to <TIME_NODE> via lead selection
  LO_ND_TIME_NODE = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_TIME_NODE ).

* get element via lead selection
  LO_EL_TIME_NODE = LO_ND_TIME_NODE->GET_ELEMENT( ).
* @TODO handle not set lead selection
  
IF LO_EL_TIME_NODE IS INITIAL.
  
ENDIF.

* get single attribute
  LO_EL_TIME_NODE->GET_ATTRIBUTE(
    
EXPORTING
      NAME =  
`TIMER`
    
IMPORTING
      
VALUE = LV_TIMER ).

 LV_TIMER = LV_TIMER + 
10"Incrementing the value after each delay set as 1.


"setting the value

* navigate from <CONTEXT> to <TIME_NODE> via lead selection
  LO_ND_TIME_NODE = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_TIME_NODE ).


* get element via lead selection
  LO_EL_TIME_NODE = LO_ND_TIME_NODE->GET_ELEMENT( ).

* @TODO handle not set lead selection
  
IF LO_EL_TIME_NODE IS INITIAL.
  
ENDIF.

* set single attribute
  LO_EL_TIME_NODE->SET_ATTRIBUTE(
    NAME =  
`TIMER`
    
VALUE = LV_TIMER ).


"checking for condition based on time to trigger to next view
if LV_TIMER = 100.

 WD_THIS->FIRE_TO_SECOND_VIEW_PLG(
  ).

ENDIF.

endmethod.

 19. In this step, we would embed the above created views in the window created in the first step.

Go to WINDOWS  Options .By DOUBLE Clicking the ZD_TIMER Window from the object navigator left hand side.

Now drag and drop the second_view to the ZD_TIMER Window to embed it.

Now the screen will look as shown below.

Click here to continue...

 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image