Embedding Select Options

Prerequisites

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

Context

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

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:
                
    lo_interfacecontroller = wd_this->wd_cpifc_sel_opt( ).
                
    wd_comp_controller->mo_sel_opt = lo_interfacecontroller->init_select_options(
                
    general_texts = ls_general_texts " wdso_general_texts
                
    general_visibility = ls_general_visibility " wdso_general_visibility
                
    global_options = ls_global_options " wdso_global_options
                
    saved_searches = lt_saved_searches " wdso_tt_value_set
                
    ).
                   
  5. To add the individual attributes, call method ADD_ATTRIBUTES before the screen output.
                
    wd_comp_controller->mo_sel_opt->add_attributes(
                
    EXPORTING attributes = lt_attributes
                
    initial_data = lt_initial_data
                
    var_date_attributes = lt_test_var_date ).
                   
  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:

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

                      
      wd_comp_controller->mo_sel_opt->get_input_complete( IMPORTING values = lt_input ).