cancel
Showing results for 
Search instead for 
Did you mean: 

Year/Month Drop Down

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

answered

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Radhika,

For Year drop down values is there any table that can be used to bring this , as we can't appened so many years values to internal table for drop down as we do for month .

Thanks,

Kumar

Former Member
0 Kudos

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.