Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8667

Re: ALV Table - editable only for specific cells

$
0
0

HI RK ,

 

 

Following code will help you to create Input field,

 

 

   DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.

   DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .

   DATA lv_value TYPE REF TO cl_salv_wd_config_table.

   DATA  input   TYPE REF TO cl_salv_wd_uie_input_field.

   DATA  column TYPE REF TO cl_salv_wd_column.

 

*& Get the ref of interface controller

   lo_cmp_usage =   wd_this->wd_cpuse_my_alv( ).

   IF lo_cmp_usage->has_active_component( ) IS INITIAL.

     lo_cmp_usage->create_component( ).

   ENDIF.

 

*&get component reference

   lo_interfacecontroller =   wd_this->wd_cpifc_my_alv( ).

   lv_value = lo_interfacecontroller->get_model).

 

*& prepare input field

   CREATE OBJECT input

     EXPORTING

       value_fieldname = 'DOB'.

 

*& get the ref of the column

   CALL METHOD lv_value->if_salv_wd_column_settings~get_column

     EXPORTING

       id    = 'DOB'

     RECEIVING

       value = column.

 

*& set cell editor

   CALL METHOD column->set_cell_editor

     EXPORTING

       value = input.

 

*& Set DOB column to editable

   CALL METHOD lv_value->if_salv_wd_table_settings~set_read_only

     EXPORTING

       value = abap_false.

 

Capture.PNG

 

In Your Situation you have find the condition , where you can put the Input field enabled.

Is this helpful?


Viewing all articles
Browse latest Browse all 8667

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>