Skip to Content
avatar image
Former Member

Year/Month Drop Down

Hi,

My requirment is to display two fields as drop down in the selection criteria of WDynpro Application i.e Year ( Dropdown) , Month( Drop Down).Is there any way we can achive this .

Thanks,

Kumar

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jul 20, 2009 at 09:20 AM

    Hi,

    You can use DropdownbyIndex or DropdownbyKey uielements.

    1.Goto Context, create a node DRPDWN cardinality 0:n, under this node create an attribute 'TEXT' type String

    2.Goto Layout tab, right click on ROOTUIELEMENTCONTAINER->insert element->drop down by index.

    3.Bind the texts property of dropdownbyindex uielement with attribute 'TEXT'

    4.Goto WDDOINIT method and place the following code to populate your dropdown with value

    DATA: lt_list TYPE wd_this->elements_cn_dpdwn,
      ls_list TYPE wd_this->element_cn_dpdwn.
      Data: nd_drpdwn type ref to if_wd_context_node.
    
      ls_list-key = 'January'.
      APPEND ls_list TO  lt_list.
      ls_list-key = 'February'.
      APPEND ls_list TO  lt_list.
      ............................ " and so on
    
      nd_drpdwn = wd_context->get_child_node( 'DRPDWN' ).
      nd_drpdwn->bind_table( lt_list ).

    Kindly check standard component WDR_TEST_EVENTS.

    Regards,

    Radhika.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Im not sure if there is anything avialable to populate list of years, but what you can do is within a LOOP statement you can populate the years list, ( by incrementing it by 1 , as you know the boundry range value )

      Regards,

      Radhika.

  • avatar image
    Former Member
    Jul 22, 2009 at 02:19 PM

    answered

    Add comment
    10|10000 characters needed characters exceeded