cancel
Showing results for 
Search instead for 
Did you mean: 

select options default issue with HIGH field-Value doesn't appear

Former Member
0 Kudos

Hi,

I am using select options for DATE.What I need is same value for date in LOW and HIGH.

I coded as below.The higher value doesn't show-up.If I manually key in same value it vanishes after I click search button.

What could be reason?

 DATA lr_ref_cmp_usage   TYPE REF TO if_wd_component_usage.
  DATA rt_date_range      TYPE REF TO data.
  FIELD-SYMBOLS: <fs_date> TYPE STANDARD TABLE,
                 <range_table_line> TYPE ANY,
                 <low> TYPE ANY,
                 <high> TYPE ANY,
                  <sign> TYPE ddsign,
                  <option> TYPE ddoption.
* First create a used component for select-options
  lr_ref_cmp_usage = wd_this->wd_cpuse_select_options( ).
  IF lr_ref_cmp_usage->has_active_component( ) IS INITIAL.
    lr_ref_cmp_usage->create_component( ).
  ENDIF.
* Get a pointer to the interface controller of select-options
  wd_this->m_wd_select_options = wd_this->wd_cpifc_select_options( ).
* initialize the select-options screen
  wd_this->m_handler = wd_this->m_wd_select_options->init_selection_screen( ).
* Hide standard buttons
  wd_this->m_handler->set_global_options(
      i_display_btn_cancel  = abap_false
      i_display_btn_check   = abap_false
      i_display_btn_execute = abap_false
      i_display_btn_reset   = abap_false ).
* create a range table for date range
  rt_date_range =  wd_this->m_handler->create_range_table( i_typename = 'S_DATE' ).
* add a new select options
  wd_this->m_handler->add_selection_field(
                    i_id = 'FLDATE'
                    i_description = 'Flight Date'
                    i_is_auto_description = abap_false "No dictionary label
                    it_result = rt_date_range
                    i_no_extension = abap_true "No extensions
                    i_read_only = abap_false ).

* Populate Default Value for select-option Date
  ASSIGN rt_date_range->* TO <fs_date>.
  INSERT INITIAL LINE INTO TABLE <fs_date> ASSIGNING <range_table_line>.
  ASSIGN COMPONENT 'LOW'    OF STRUCTURE <range_table_line> TO <low>.
  ASSIGN COMPONENT 'HIGH'   OF STRUCTURE <range_table_line> TO <high>.
  ASSIGN COMPONENT 'SIGN'   OF STRUCTURE <range_table_line> TO <sign>.
  ASSIGN COMPONENT 'OPTION' OF STRUCTURE <range_table_line> TO <option>.
  <low>  = sy-datum.
  <sign> = 'I'.
  <option> = 'BT'.
  <high> = sy-datum .

ENDMETHOD..

Edited by: Varaprasad kandagatla on Aug 21, 2011 1:02 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

saravanan_narayanan
Active Contributor
0 Kudos

Hello Varaprasad,

the value of HIGH should be greater than the LOW. In your code, you have assigned sy-datum for both LOW and HIGH. For the HIGH try setting sy-datum + 1 and check whether it works.

BR, Saravanan