Code: Alles auswählen.
DATA: lo_interfacecontroller TYPE REF TO iwci_salv_wd_table ,
lv_value TYPE REF TO cl_salv_wd_config_table,
lt_columns TYPE salv_wd_t_column_ref,
ls_columns TYPE salv_wd_s_column_ref,
lo_input_field TYPE REF TO cl_salv_wd_uie_input_field.
lo_interfacecontroller = wd_this->wd_cpifc_cpu_alv( ).
lv_value = lo_interfacecontroller->get_model( ).
lv_value->if_salv_wd_table_settings~set_edit_mode( '99' ).
lv_value->if_salv_wd_table_settings~set_read_only( abap_false ).
* Get table columns
lt_columns = lv_value->if_salv_wd_column_settings~get_columns( ).
* -------- zeilenweises Sperren von Feldern --------
* Felder deaktivieren bei Dienstleistungen
LOOP AT lt_columns INTO ls_columns.
LOOP AT lt_mepo1211_alv INTO ls_mepo.
TRY.
lv_tryit = ls_mepo-pstyp.
IF lv_tryit = 9.
IF ls_columns-id = 'MENGE'
OR ls_columns-id = 'MEINS'
OR ls_columns-id = 'NETPR'
OR ls_columns-id = 'MATNR'
OR ls_columns-id = 'LGORT'.
* CLEAR ls_columns.
* CONTINUE.
* ENDIF.
CREATE OBJECT lo_input_field
EXPORTING
value_fieldname = ls_columns-id.
lo_input_field->set_read_only_fieldname( 'READ_ONLY' ).
ls_columns-r_column->set_cell_editor( lo_input_field ).
ENDIF.
ENDIF.
CATCH cx_root.
* Felder deaktivieren bei Leistungen
IF ls_columns-id = 'WERKS'
OR ls_columns-id = 'LGORT'.
CREATE OBJECT lo_input_field
EXPORTING
value_fieldname = ls_columns-id.
lo_input_field->set_read_only_fieldname( 'READ_ONLY' ).
ls_columns-r_column->set_cell_editor( lo_input_field ).
ELSEIF ls_columns-id = 'MENGE'
OR ls_columns-id = 'MEINS'
OR ls_columns-id = 'NETPR'
OR ls_columns-id = 'MATNR'.
CLEAR ls_columns.
CONTINUE.
ENDIF.
ENDTRY.
ENDLOOP.
ENDLOOP.