01-15-2009 12:17 PM
I have a screen with a few 2 fields F1 and F2
and i have a container with editable alv.( I am using the DATA_CHANGED event from the cl_alv_grid* class for editing purpose)
senario 1. when i enter the alv field value and then click on the next field in alv --> the value is registered in the underlying internal table.
senario2 - when i enter the alv field value and then click anywhere other than any alv field.> the value is not registered.-> and this is my prolblem .. that in senario two i miss out on a value and affect the program output.
can someone help me.
01-15-2009 1:40 PM
Hi,
I had the same problem with you. I solved with a Button in the ALV Toolbar. I didn´t use DATA_CHANGED for it. I filled out all entries in the ALV and then I push the Buttom. In the Event Of buttom I put the modify command because all new entries are in the internal table.
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_toolbar FOR EVENT toolbar
OF cl_gui_alv_grid IMPORTING e_object,
handle_user_command FOR EVENT user_command
OF cl_gui_alv_grid IMPORTING e_ucomm.
ENDCLASS. "lcl_event_receiver DEFINITION
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_toolbar.
DATA ls_toolbar1 TYPE stb_button.
MOVE icon_system_save TO ls_toolbar1-icon.
MOVE 'SAVE' TO ls_toolbar1-function.
MOVE 'Save' TO ls_toolbar1-text.
APPEND ls_toolbar1 TO e_object->mt_toolbar.
ENDMETHOD. "handle_toolbar
METHOD handle_user_command.
MOVE e_ucomm TO v_botao.
CASE v_botao.
WHEN 'SAVE'.
PERFORM save.
ENDCASE.
ENDMETHOD. "handle_user_command
ENDCLASS. "lcl_event_receiver IMPLEMENTATION