cancel
Showing results for 
Search instead for 
Did you mean: 

How to set column names in OVS search help of ALV EDIT

Former Member
0 Kudos

Hi All,

I have a OVS search help for my ALV EDIT column.This OVS will have two columns,I need to give the names(name1 , name2) to the columns.

I am writing the below codo in phase 0.

ls_text-name = 'Column1'.

ls_text-value = 'name1'.

INSERT ls_text INTO TABLE lt_column_texts.

ls_text-name = 'Column2'.

ls_text-value = 'name2'.

INSERT ls_text INTO TABLE lt_column_texts.

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 ).

Below code in Phase 3.

Assign ovs_callback_object->selection->* to <ls_selection>.

if <ls_selection> is assigned.

ovs_callback_object->context_element->set_attribute(

name = `ATR1`

value = <ls_selection>-Column1 ).

endif.

But,the column names are not getting set.Please provide your inputs.

Regards,

Salma

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

About your requirement, i don't know why you need to code in "Phase 3" of OVS.

"Phase 3" is used for transporting your selected value to Your ALV.

I think, the reason why you loose the result table including your customized column title, is that you loose the "Phase 2".

Generally, in the past i used OVS as the following code simply.Just one example:


* declare data structures for the fields to be displayed and
* for the table columns of the selection list, if necessary
  types:
    begin of lty_stru_input,
*   add fields for the display of your search input here
      carrid type string,
      connid type string,
    end of lty_stru_input.
  types:
    begin of lty_stru_list,
*   add fields for the selection list here
      carrid type string,
      connid type string,
      text   type string,
    end of lty_stru_list.

  data: ls_search_input  type lty_stru_input,
        lt_select_list   type standard table of lty_stru_list,
        ls_text          type wdr_name_value,
        lt_label_texts   type wdr_name_value_list,
        lt_column_texts  type wdr_name_value_list,


  case ovs_callback_object->phase_indicator.

    when if_wd_ovs=>co_phase_0.  "configuration phase, may be omitted
*   in this phase you have the possibility to define the texts,
*   if you do not want to use the defaults (DDIC-texts)

      ls_text-name = 'CARRID'.  "must match a field name of search
      ls_text-value = 'Search Field-Carrid'. 
      insert ls_text into table lt_label_texts.
      ls_text-name = 'CONNID'.  "must match a field name of search
      ls_text-value = 'Search Field-Connid'. 
      insert ls_text into table lt_label_texts.

      ls_text-name = 'CARRID'.  "must match a field in list structure
      ls_text-value = 'Result-Carrid'.
      insert ls_text into table lt_column_texts.
      ls_text-name = 'CONNID'.  "must match a field in list structure
      ls_text-value = 'Result-Connid'. 
      insert ls_text into table lt_column_texts.
      ls_text-name = 'TEXT'.  "must match a field in list structure
      ls_text-value = 'Result-Text'.
      insert ls_text into table lt_column_texts.

      lv_group_header = 'Group Header'.
      lv_window_title = 'Window Title'.
      lv_table_header = 'Table Header'.

      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    = 3
                row_count    = 8 ).

...................................................


when if_wd_ovs=>co_phase_2.
*   If phase 1 is implemented, use the field input for the
*   selection of the table.
*   If phase 1 is omitted, use values from your own context.

      if ovs_callback_object->query_parameters is not bound.
******** TODO exception handling
      endif.
      assign ovs_callback_object->query_parameters->*
                              to <ls_query_params>.
SELECT * INTO CORRESPONDING FIELDS OF TABLE lt_select_list FROM ZTABLE_FLIGHT
                       WHERE CARRID LIKE lw_carrid
                             AND CONNID LIKE lw_connid
                        .
*ovs_callback_object->set_output_table( output = lt_select_list ).*

Hope it can help.

Best wishes.