on 03-12-2013 12:20 PM
Hi,
I have made a restriction in WDDOINIT for my key fields as they are not to be changed by the user when editing existing records.
However, I use the standard ALV toolbar in my view and I need to make all fields editable when the user clicks either
APPEND or INSERT row, but how to address these buttons ?
My existing code for WDDOINIT:
METHOD wddoinit.
* Add toolbar for functionality (INSERT, DELETE etc.)
* and
* Set table fields Editable for start and end date
DATA : lt_columns TYPE salv_wd_t_column_ref,
ls_columns TYPE salv_wd_s_column_ref.
DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_alv_test( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
lo_interfacecontroller = wd_this->wd_cpifc_alv_test( ).
DATA lv_value TYPE REF TO cl_salv_wd_config_table.
lv_value = lo_interfacecontroller->get_model(
).
CALL METHOD lv_value->if_salv_wd_column_settings~get_columns
RECEIVING
value = lt_columns.
DATA : lo_sdatum TYPE REF TO cl_salv_wd_uie_input_field.
DATA: lo_edatum TYPE REF TO cl_salv_wd_uie_input_field.
* Open fields in existing records for editing
LOOP AT lt_columns INTO ls_columns.
CASE ls_columns-id.
WHEN 'SDATUM'.
CREATE OBJECT lo_sdatum
EXPORTING
value_fieldname = ls_columns-id.
ls_columns-r_column->set_cell_editor( lo_sdatum ).
WHEN 'EDATUM'.
CREATE OBJECT lo_edatum
EXPORTING
value_fieldname = ls_columns-id.
ls_columns-r_column->set_cell_editor( lo_edatum ).
ENDCASE.
ENDLOOP.
CALL METHOD lv_value->if_salv_wd_table_settings~set_read_only
EXPORTING
value = abap_false.
ENDMETHOD.
you can create your custom button instead of using standard button. if you don't want to display these standard button just hide them
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes you can remove them
* Instantiate the ALV Component
lr_alv_usage = wd_this->wd_cpuse_output_list( ).
IF lr_alv_usage->has_active_component( ) IS INITIAL.
lr_alv_usage->create_component( ).
ENDIF.
* Get reference to model
lr_if_controller = wd_this->wd_cpifc_output_list( ).
lr_config = lr_if_controller->get_model(
).
lr_std ?= lr_config.
lr_std->set_export_allowed( abap_true ).
lr_std->set_edit_check_available( abap_false ).
lr_std->set_edit_append_row_allowed( abap_false ).
lr_std->set_edit_insert_row_allowed( abap_false ).
lr_std->set_edit_delete_row_allowed( abap_false ).
lr_std->set_filter_filterline_allowed( abap_false ).
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.