cancel
Showing results for 
Search instead for 
Did you mean: 

F4 Help with OVS in WDR_SELECT_OPTIONS

Former Member
0 Kudos

Hi

I realized an OVS-F4-Help in WDR_SELECT_OPTIONS.

The Event on_ovs is raised and if I use table_multi_select = abap_false

      i_ovs_data-m_ovs_callback_object->set_configuration(
                label_texts  = lt_label_texts
                column_texts = lt_column_texts
                group_header = lv_group_header
                window_title = lv_window_title
                table_header = lv_table_header
                col_count    = 2
                row_count    = 20
                table_multi_select = abap_false ).

I get the correct value in the select-option with the following code

    WHEN if_wd_ovs=>co_phase_3.
*   apply result

      IF i_ovs_data-m_ovs_callback_object->selection IS NOT BOUND.
******** TODO exception handling
      ENDIF.

      ASSIGN i_ovs_data-m_ovs_callback_object->selection->* TO <ls_selection>.
      IF <ls_selection> IS ASSIGNED.
          i_ovs_data-m_ovs_callback_object->context_element->set_attribute(
                                 name  = i_ovs_data-m_ovs_callback_object->context_attribute
                                 value = <ls_selection>-kostl ).        
      ENDIF.

I tried to use table_multi_select = abap_true, but then I have no idea how the code for <b>WHEN if_wd_ovs=>co_phase_3.</b> must look like.

If anyone know the answer,give me the solution.

thanks in advance,

Marcus

Accepted Solutions (1)

Accepted Solutions (1)

thomas_szcs
Active Contributor
0 Kudos

Hello Marcus,

In this case the pointer refers to a table instead of a structure. Just fill the table with the selected values. They will then be copied over to the final range table.

Best regards,

Thomas

Former Member
0 Kudos

Hello Thomas,

I tried to do this like this.

    WHEN if_wd_ovs=>co_phase_3.
*   apply result

      IF i_ovs_data-m_ovs_callback_object->selection IS NOT BOUND.
******** TODO exception handling
      ENDIF.
      DATA lt_kostl TYPE TABLE OF kostl.
      ASSIGN i_ovs_data-m_ovs_callback_object->selection->* TO <lt_selection>.
      IF <lt_selection> IS ASSIGNED.
        LOOP AT <lt_selection> ASSIGNING <ls_selection>.
          INSERT <ls_selection>-kostl INTO TABLE lt_kostl.
        ENDLOOP.
      ENDIF.

      i_ovs_data-m_ovs_callback_object->context_element->set_attribute(
                       name  = i_ovs_data-m_ovs_callback_object->context_attribute
                       value = lt_kostl ).

thomas_szcs
Active Contributor
0 Kudos

Hi Marcus,

There's no need to apply the result to the context element. This is done automatically for you within the select options component. Just fill the

internal table with the values. Then it should work.

Best regards,

Thomas

Former Member
0 Kudos

Hi Thomas,

which internal table should I fill.

Best regards

Marcus

thomas_szcs
Active Contributor
0 Kudos

Hi Marcus,

It's the one behind i_ovs_data-m_ovs_callback_object->selection.

Best regards,

Thomas

Former Member
0 Kudos

Like this?

 ASSIGN i_ovs_data-m_ovs_callback_object->selection->* TO <lt_selection>.

thomas_szcs
Active Contributor
0 Kudos

Hi Marcus,

You can find a copy&paste example in WDR_TEST_SELECT_OPTIONS in the method ON_OVS of the view MAIN_VIEW.

There you can find for SCARR in called method do_ovs_scarr:


method do_ovs_scarr.

  data:
    lt_scarr type cl_wd_flight_model=>tt_scarr,
    scarr    type scarr.

  field-symbols:
    <lt_ovs_result>     type cl_wd_flight_model=>tt_scarr,
    <scarr>             like line of <lt_ovs_result>,
    <lt_sel_opt_result> type standard table.

  case i_ovs_data-m_ovs_callback_object->phase_indicator.
    when if_wd_ovs=>co_phase_0.
      i_ovs_data-m_ovs_callback_object->set_configuration( TABLE_MULTI_SELECT = abap_true ).
    when if_wd_ovs=>co_phase_1.
      i_ovs_data-m_ovs_callback_object->set_input_structure( input  = scarr ).
    when if_wd_ovs=>co_phase_2.
      cl_wd_flight_model=>get_scarr( importing et_scarr = lt_scarr ).
      i_ovs_data-m_ovs_callback_object->set_output_table( output = lt_scarr ).
    when  if_wd_ovs=>co_phase_3.
      assign i_ovs_data-m_ovs_callback_object->selection->* to <lt_ovs_result>.
      assign i_ovs_data-mt_selected_values->* to <lt_sel_opt_result>.
      loop at <lt_ovs_result> assigning <scarr>.
        insert <scarr>-carrid into table <lt_sel_opt_result>.
      endloop.
  endcase.

endmethod.

Best regards,

Thomas

Answers (0)