on 11-26-2009 1:36 AM
Hi,
I have managed to make a column in my ALV editable by implementing the following code in the WDDOINIT method:
Set column price as editable field
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( 'MEASUREMENT' ).
CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'MEASUREMENT'.
lr_column->set_cell_editor( lr_input_field ).
Set read only mode to false. 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 ).
QUESTION IS:
When a user changes the value in the cell, how do I return that value to the context WITHOUT having to use a "Save" button?
Is it possible to return the value back to the context using the event handler ON_CHANGED. This event handler is defined in CL_SALV_WD_UIE_INPUT_FIELD. How do I make use of this event handler - IF_SALV_WD_CONFIG~ON_CHANGED.
Thank you.
Giscard
The onChanged event is not a Web Dypnro event from the UI but instead an internal ABAP OO event that is used by the ALV framework. It is used to notify different parts of the ALV framework when the configuration has changed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
1.Implement the ON_DATA_CHECK event.
2, There you will get all the modified cells.
For Ref :
method ON_DATA_CHECK .
DATA: lr_node TYPE REF TO if_wd_context_node,
lr_element TYPE REF TO if_wd_context_element,
ls_modified_cells TYPE salv_wd_s_table_mod_cell,
wa_data type wd_this->element_table,
wd_node type ref to if_wd_context_node.
FIELD-SYMBOLS <temp> TYPE data.
wd_node = wd_context->get_child_node( name = 'TABLE' ).
" get message manager
DATA lo_api_controller TYPE REF TO if_wd_controller.
DATA lo_message_manager TYPE REF TO if_wd_message_manager.
lo_api_controller ?= wd_this->wd_get_api( ).
CALL METHOD lo_api_controller->get_message_manager
RECEIVING
message_manager = lo_message_manager.
lr_node = wd_context->get_child_node( name = 'TABLE' ).
LOOP AT r_param->t_modified_cells INTO ls_modified_cells.
lr_element = lr_node->get_element( index = ls_modified_cells-index ).
" The ALV might also have been modified at other places so check if the modification
" has happened in the any column.
IF ls_modified_cells-attribute = 'APPROVE'.
" If the modification has happened in the checkbox then fetch the information of that row
wd_node->get_static_attributes( exporting index = ls_modified_cells-index
importing static_attributes = wa_data ).
" Do your desired processing with the row information that you have in wa_data
endif.
endloop.
endmethod.
I hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
I am facing the problem with ON DATA CHECK EVENT. I have registered this event interface controller and create a method On data check of event handler type. Actually My requirement is to find the number of rowls deleted, inserted or appended by the user in the Editable ALV output.
But the evernt On Data Check is not triggering when the user clicks CHECK buttton.
Please let me know if you have any solution.
Regards,
J.P
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.