Skip to Content

Overview

     This document provide step-by-step instructions to set the status of PhaseIndicator element.  Status is controlled through the values selected from a DropDownByKey element.  Following Standard status settings are allowed.

  • Normal
  • Completed
  • Unavailable
  • Warning

Steps

  • Component controller Contexts

    Node : PHASE – Phase numbers

    • PHASE1 – WDUI_PHASE_STATUS
    • PHASE2 – WDUI_PHASE_STATUS
    • PHASE3 – WDUI_PHASE_STATUS
    • PHASE4 – WDUI_PHASE_STATUS

          image1.JPG

  • Component controller Methods
    • WDDOINIT – Controller Initialization Method

         

METHOD wddoinit .
   DATA : lo_phase      TYPE REF TO if_wd_context_node,
          lo_phase_info TYPE REF TO if_wd_context_node_info,
          lt_set        TYPE wdr_context_attr_value_list,
          ls_set        TYPE wdr_context_attr_value.
   ls_set-value = '00'.
   ls_set-text  = 'Normal'.
   APPEND ls_set TO lt_set.
   ls_set-value = '01'.
   ls_set-text  = 'Completed'.
   APPEND ls_set TO lt_set.
   ls_set-value = '02'.
   ls_set-text  = 'Warning'.
   APPEND ls_set TO lt_set.
   ls_set-value = '03'.
   ls_set-text  = 'Unavailable'.
   APPEND ls_set TO lt_set.
   lo_phase = wd_context->get_child_node( wd_this->wdctx_phase ).
   lo_phase_info = lo_phase->get_node_info( ).
   lo_phase_info->set_attribute_value_set(
       name      = 'PHASE1'
       value_set = lt_set ).
   lo_phase_info->set_attribute_value_set(
       name      = 'PHASE2'
       value_set = lt_set ).
   lo_phase_info->set_attribute_value_set(
       name      = 'PHASE3'
       value_set = lt_set ).
   lo_phase_info->set_attribute_value_set(
       name      = 'PHASE4'
       value_set = lt_set ).
 ENDMETHOD.


  • Views – V_MAIN – Layout

          image1.JPG

          Action “SET_PHASE_STATUS” assigned to “onSelect” event of all the 4 DropDownByKey elements, so that event “WDDOMODIFYVIEW” will trigger while selecting the status values from drop down.


  • Views – V_MAIN – Context

    image1.JPG

  • Views – V_MAIN – Methods

          image1.JPG

    • Method – ONACTIONSET_PHASE_STATUS

method ONACTIONSET_PHASE_STATUS . endmethod.
    • Method – WDDOMODIFYVIEW
METHOD wddomodifyview .
   DATA : lo_container TYPE REF TO cl_wd_uielement_container,
          lo_element   TYPE REF TO cl_wd_phase_indicator,
          lo_phase     TYPE REF TO cl_wd_phase,
          lo_input     TYPE REF TO if_wd_context_node,
          lo_input_el  TYPE REF TO if_wd_context_element.
   DATA : lt_phase     TYPE cl_wd_phase=>tt_phase,
          lt_input     TYPE wd_this->elements_phase,
          ls_input     TYPE wd_this->element_phase,
          lv_phase     TYPE string.
   lo_input = wd_context->get_child_node( wd_this->wdctx_phase ).
   lo_input_el = lo_input->get_element( ).
   lo_input_el->get_static_attributes(
     IMPORTING
       static_attributes = ls_input ).
   lo_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
   lo_element ?= lo_container->get_child( id = 'PHASE' ).
   lt_phase = lo_element->get_phases( ).
   LOOP AT lt_phase INTO lo_phase.
     lv_phase = lo_phase->get_description( ).
     CASE lv_phase.
       WHEN 'Phase 1'.
         lo_phase->set_status( ls_input-phase1 ).
       WHEN 'Phase 2'.
         lo_phase->set_status( ls_input-phase2 ).
       WHEN 'Phase 3'.
         lo_phase->set_status( ls_input-phase3 ).
       WHEN 'Phase 4'.
         lo_phase->set_status( ls_input-phase4 ).
     ENDCASE.
   ENDLOOP.
 ENDMETHOD.

Output

          image1.JPG

Exclusions


  • Status settings for “MultiplePhase” elements not covered in the document.
To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply