on 10-30-2008 9:22 AM
Hi,
I am using these methods;
lr_config TYPE REF TO cl_salv_wd_config_table,
lr_config->IF_SALV_WD_TABLE_SETTINGS~SET_EDIT_MODE ()
What is supposed to be written in the parenthesis in order to edit the ALV column
Thanks
Hi,
Try go through this [excellent blog|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1] by Claudia Dangers to understand how you can change 1 particular column of your ALV to editable mode.
Regards,
Uday
First it is necessary to use an input field as cell editor for the column u201Cprice,u201D which should be editable. Therefore we need to enhance method WDDOINIT of view ResultView:
WDDOINIT()
[u2026] " Do all your basic stuff first
" set cell editor for input fields (~make colum PRICE editable)
DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.
lr_column_settings ?= l_value.
lr_column = lr_column_settings->get_column( 'PRICE' ).
CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'PRICE'.
lr_column->set_cell_editor( lr_input_field ).
" The u201Cread only modeu201D has to be set to abap_false to make the table editable.
" set read only mode to false (and display edit toolbar)
data: lr_table_settings type ref to if_salv_wd_table_settings.
lr_table_settings ?= l_value.
lr_table_settings->set_read_only( abap_false ).
ENDMETHOD.
Without this setting the input field will not be editable!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should not append new questions to the ends of existing threads. Please do not do this in the future. However the solution to your question is quite simple. Yes you can using methods of the ALV Model:
DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv_basic( ).
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
DATA l_salv_wd_table TYPE REF TO iwci_salv_wd_table.
l_salv_wd_table = wd_this->wd_cpifc_alv_basic( ).
DATA l_table TYPE REF TO cl_salv_wd_config_table.
l_table = l_salv_wd_table->get_model( ).
l_table->if_salv_wd_table_settings~set_read_only( abap_false ).
l_table->if_salv_wd_std_functions~set_edit_append_row_allowed( abap_false ).
l_table->if_salv_wd_std_functions~set_edit_insert_row_allowed( abap_false ).
l_table->if_salv_wd_std_functions~set_edit_delete_row_allowed( abap_false ).
Hi,
This is the code to create editable alv.
Note:
l_value is ALV table reference.
*Get the Column to which you want to make editable
data:lr_input type ref to cl_salv_wd_uie_input_field,
l_column1 type ref to cl_salv_wd_column,
.
l_column1 =
l_value->if_salv_wd_column_settings~get_column('PRICE' ).
l_column1->set_cell_editor( value = lr_input1 ).
endloop.
*Set the table Editable
l_value->if_salv_wd_table_settings~set_read_only( value = abap_false ).
Edited by: suman kumar chinnam on Oct 30, 2008 10:31 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.