Show TOC

Procedure documentationEmbedding Select Options Locate this document in the navigation structure

 

To use the Select Options component, you embed it in your Web Dynpro application.

Prerequisites

You have created a Web Dynpro component with at least one View.

Procedure

  1. Declare a component usage in your Web Dynpro component for WD_SELECT_OPTIONS_20.

    For more information about component usage, see Component Usage.

  2. Create a view container for the Select Options.

  3. Embed view V_SELECT_OPTIONS into the Window.

  4. Instantiate the Select Options handler by calling the following function module:

    Syntax Syntax

    1. lo_interfacecontroller =   wd_this->wd_cpifc_sel_opt( ).
    2. wd_comp_controller->mo_sel_opt  = lo_interfacecontroller->init_select_options(
    3. general_texts =   ls_general_texts              " wdso_general_texts
    4. general_visibility = ls_general_visibility      " wdso_general_visibility
    5. global_options =   ls_global_options            " wdso_global_options
    6. saved_searches = lt_saved_searches              " wdso_tt_value_set
    7. ). 
    End of the source code.

    Recommendation Recommendation

    We recommend that you call method INIT_SELECT_OPTIONS in method WDDOINIT (either of the view or the component controller) to ensure that this call is made before the rendering.

    End of the recommendation.

    Note Note

    In this step you have to decide whether to use standard UI elements (for example, texts and buttons) of Select Options, or implement your own.

    To activate standard UI elements, use parameter GENERAL_VISIBILITY.

    End of the note.
  5. To add the individual attributes, call method ADD_ATTRIBUTES before the screen output.

    Syntax Syntax

    1. wd_comp_controller->mo_sel_opt->add_attributes(
    2. EXPORTING attributes = lt_attributes
    3. initial_data = lt_initial_data
    4. var_date_attributes = lt_test_var_date ).
    End of the source code.
  6. To read in the data, register for event ON_EXECUTE if the search button of Select Options is rendered, or else register for an event you have created.

    To read the data, the following options are available:

    • If you want to read the value assignments for individual attributes, use the following source code:

      Syntax Syntax

      1. wd_comp_controller->mo_sel_opt->get_input_per_attribute(
      2. EXPORTING attribute = ls_attributes-attribute
      3. include_unvaluated_rows = lv_unvaluated_rows
      4. IMPORTING values =  lt_input  ).
      End of the source code.
    • If you want to read the data for all the attributes, use the following source code:

      Syntax Syntax

      1. wd_comp_controller->mo_sel_opt->get_input_complete( IMPORTING values =  lt_input  ).
      End of the source code.