Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

OVS help for editable column in dynamic ALV

Hello friends,

i have created dynamic alv with editable fields, for one of the editable field, want to attach OVS help, i have created OVS help also for that editable field, could any one pls let me know how to attach OVS help for that input field

pls check my code ( dynamic alv with editable fields )

DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.

  DATA  lo_column TYPE REF TO cl_salv_wd_column.

  DATA lo_header TYPE REF TO cl_salv_wd_column_header.

  DATA lo_input TYPE REF TO cl_salv_wd_uie_input_field.

  DATA lo_alv_uie TYPE REF TO if_salv_wd_table_cell_editor.

lo_cmp_usage =   wd_this->wd_cpuse_nodeitem_alv( ).

IF lo_cmp_usage->has_active_component( ) IS INITIAL.

  lo_cmp_usage->create_component( ).

ENDIF.

*  "Create an instance of ALV Interface Controller

  DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .

  lo_interfacecontroller =   wd_this->wd_cpifc_nodeitem_alv( ).

lo_interfacecontroller =   wd_this->wd_cpifc_nodeitem_alv( ).

   DATA lv_value TYPE REF TO cl_salv_wd_config_table.

   lv_value = lo_interfacecontroller->get_model(

   ).

  DATA:

        lr_column_settings TYPE REF TO if_salv_wd_column_settings,

        lt_columns         TYPE salv_wd_t_column_ref,

        ls_columns         LIKE LINE OF lt_columns.

*

  lr_column_settings ?= lv_value.

  lt_columns = lr_column_settings->get_columns( ).

  lt_columns = lv_value->if_salv_wd_column_settings~get_columns( ).

*

  lv_value->if_salv_wd_table_settings~set_edit_mode( ).

  lv_value->if_salv_wd_table_settings~set_read_only( abap_false ).

  lv_value->if_salv_wd_table_settings~set_fixed_table_layout( abap_false ).

  lv_value->if_salv_wd_table_settings~set_visible_row_count( 6 ).

  lv_value->if_salv_wd_table_settings~set_width( '1275' ).

  lv_value->if_salv_wd_std_functions~set_edit_delete_row_allowed( ).

  lv_value->if_salv_wd_std_functions~set_edit_insert_row_allowed( abap_false ).

  lv_value->if_salv_wd_std_functions~set_edit_append_row_allowed( ).

  lv_value->if_salv_wd_table_settings~set_data_check( if_salv_wd_c_table_settings=>data_check_on_cell_event ).

  lv_value->if_salv_wd_std_functions~set_excel_inplace_allowed( abap_false ).

  lv_value->if_salv_wd_std_functions~set_view_list_allowed( abap_false ).

  lv_value->if_salv_wd_std_functions~set_pdf_allowed( abap_false ).

  LOOP AT lt_columns INTO ls_columns.

    ls_columns-r_column->set_resizable( abap_true ).

    lo_column = ls_columns-r_column.

    lo_header = lo_column->get_header( ).

    lo_header->set_prop_ddic_binding_field(

          EXPORTING

            property = if_salv_wd_c_ddic_binding=>bind_prop_text

            value    = if_salv_wd_c_ddic_binding=>ddic_bind_none ).

    lo_header->set_header_text_wrapping( abap_true ).

    CASE ls_columns-id.

      WHEN 'BUZEI'.

        ls_columns-r_column->set_visible(

          EXPORTING

            value  = cl_wd_uielement=>e_visible-visible ).

        ls_columns-r_column->set_position(

          EXPORTING

            value  = 1 ).

        CREATE OBJECT lo_input

          EXPORTING

            value_fieldname = ls_columns-id.

        lo_input->set_read_only( abap_true ).

        lo_alv_uie = lo_input.

        lo_column->set_cell_editor( lo_alv_uie ).

        lo_header->set_text( 'Line Item' ).

        lo_column->set_width( '15' ).

        lo_column->set_resizable( abap_true ).

******* for the below field want to attach my OVS *************************************

      WHEN 'FIPEX'.

        ls_columns-r_column->set_visible(

           EXPORTING

             value  = cl_wd_uielement=>e_visible-visible ).

        ls_columns-r_column->set_position(

          EXPORTING

            value  = 3 ).

        CREATE OBJECT lo_input

          EXPORTING

            value_fieldname = ls_columns-id.

        lo_input->set_read_only( abap_false ).

        lo_alv_uie = lo_input.

        lo_column->set_cell_editor( lo_alv_uie ).

        lo_header->set_text( 'Heads of Account' ).

        ls_columns-r_column->set_width( '8' ).

        lo_column->set_resizable( abap_true ).

*

      WHEN 'WRBTR'.

        ls_columns-r_column->set_visible(

           EXPORTING

             value  = cl_wd_uielement=>e_visible-visible ).

        ls_columns-r_column->set_position(

          EXPORTING

            value  = 4 ).

        CREATE OBJECT lo_input

          EXPORTING

            value_fieldname = ls_columns-id.

        lo_input->set_read_only( abap_false ).

        lo_alv_uie = lo_input.

        lo_column->set_cell_editor( lo_alv_uie ).

        lo_header->set_text( 'Amount' ).

        ls_columns-r_column->set_width( '6' ).

        lo_column->set_resizable( abap_true ).

WHEN OTHERS.

        ls_columns-r_column->set_visible(

          EXPORTING

            value  = cl_wd_uielement=>e_visible-none ).

    ENDCASE.

  ENDLOOP.

pls check the screen shot ( OVS help for FIPEX field )

Advance Thanks

Vijaya

Former Member
replied

Hi Vijaya Laxmi,

Hope, the alv field FIPEX is an attribute in context node which is mapped to alv DATA

Please go to attribute FIPEX In context node and attach the ovs like below

Now, the field FIPEX should have OVS search help attached

Hope this helps you.

Regards,

Rama

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question