cancel
Showing results for 
Search instead for 
Did you mean: 

requirement to maintain select-options for multiple fileds in webdynpro aba

Former Member
0 Kudos

Hello Gurus,

We have a requirement to maintain select-options for multiple fileds in webdynpro abap.

now we are able to create select-options for a single field using wdr_select_options componet usage.

how can we achive this select-options feature for multiple fields.

Could anyone please suggest solutions?

and if possible send me the sample code for this requirement.

Thanks in Advance for your replies.

Regards,

Shyam

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Nothing different for more fields, same. some declaration changes.

For example code i am using.. in WDDOINIT method.

TYPES:
    fiscal_year TYPE RANGE OF GJAHR,
    S_KUNNR TYPE RANGE OF J_3RS_KUNNR,
    S_VKORG TYPE RANGE OF VKORG_RAN,
    status type PVWTY-RETPA,
    ty_r_date TYPE RANGE OF s_date,
    ty_s_date TYPE LINE OF ty_r_date.

 DATA lo_interfacecontroller TYPE REF TO iwci_wdr_select_options .
  DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.

lo_cmp_usage =   wd_this->wd_cpuse_cmp_sel_opt( ).
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
  lo_cmp_usage->create_component( ).
ENDIF.

* Reference variable used instantiate the select-options component
  DATA
    lr_cmp_usage TYPE REF TO if_wd_component_usage.
* Variables used to create the select-options fields and
* define its initial values
  DATA:
    lr_field TYPE REF TO data,
    ls_date  TYPE ty_s_date.
  FIELD-SYMBOLS:
    <fs_field> TYPE ANY,
    <fs_range> TYPE INDEX TABLE.

* Instantiate the select-options component
  lr_cmp_usage = wd_this->wd_cpuse_cmp_sel_opt( ).
  IF lr_cmp_usage->has_active_component( ) IS INITIAL.
    lr_cmp_usage->create_component( ).
  ENDIF.

  lo_interfacecontroller =   wd_this->wd_cpifc_cmp_sel_opt( ).
wd_this->m_sel_opt = lo_interfacecontroller->init_selection_screen( ).

data : vhelp type wdy_md_value_help_mode_enum .

* Sets the helper reference
  wd_this->m_sel_opt1 = wd_this->wd_cpifc_cmp_sel_opt( ).
  wd_this->m_helper  = wd_this->m_sel_opt1->init_selection_screen( ).

* Hide the standard select-options components.
  wd_this->m_helper->set_global_options(
    i_display_btn_cancel = abap_false
    i_display_btn_check  = abap_false
    i_display_btn_reset  = abap_false
    i_display_btn_execute  = abap_false
    ).

  lr_field = wd_this->m_helper->create_range_table( `KUNNR` ).
  wd_this->m_helper->add_selection_field(
    i_id           = `KUNNR`
    I_DESCRIPTION  = 'Customer Code'
*    i_within_block = `BL01`
    it_result      = lr_field ).
  FREE lr_field.

  lr_field = wd_this->m_helper->create_range_table( `VKORG` ).
  wd_this->m_helper->add_selection_field(
    i_id           = `VKORG`
    I_DESCRIPTION  = 'Sales Organization'
*    i_within_block = `BL01`
    it_result      = lr_field ).
  FREE lr_field.

Go through this..

http://wiki.sdn.sap.com/wiki/display/Snippets/WebDynproABAP-Complexselect-optionscomponent+usages

Cheers,

Kris.