‎2011 Sep 05 2:54 PM
Hello All,
I have an alv which has 3 columns. 2 columns are editable, one is not. I want to fill the non-editable column according to the value which has been entered in editable columns.
the problem is; I want to refresh alv by pressing ENTER button. When i press enter it doesnt refresh alv. But when i press enter in debug mode (by writing /H) it refreshes the alv. here is my beginning of pai. In debug mode, program falls into when others code. But without debug enter button doesnt react.
CASE save_ok.
WHEN 'SAVE'.
PERFORM save_data.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'TOPLU'.
CALL SCREEN 200.
WHEN others.
....
‎2011 Sep 05 3:53 PM
Hi,
you probably made a confusion because of the "focus" : when the cursor is in the editable ALV, the Enter key is handled by the ALV, while when the cursor is in the OK code (command field) and you press the Enter key, then it is handled in the PAI.
If you want to handle the Enter in the ALV, you have to handle the DATA_CHANGED event. See the forum for more information, or demo program like BCALV_EDIT* and BCALV_TEST_GRID_EDIT*
Sandra
‎2011 Sep 05 4:34 PM
Hi Ayd,
Check as Sandra told.
[Refresh Button|http://wiki.sdn.sap.com/wiki/display/ABAP/MakingALVtoreacttoChangedata+automatically]
Regards,
Madhu.
‎2011 Sep 06 11:10 AM
Hello all,
I am calling the method below just after set_table_for_first_display method at pbo.
CALL METHOD g_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.and in my pai.
i use the method below in WHEN OTHERS part.
CALL METHOD g_grid->check_changed_data
* IMPORTING
* E_VALID =
* CHANGING
* C_REFRESH = 'X'but i still cant get result. What do i miss?
‎2011 Sep 06 12:15 PM
Hi,
After setting the grid for first display, create an instance for the Event handler.
CREATE OBJECT g_event_handler.
SET HANDLER g_event_handler->data_changed
FOR alvgrid.
And in implementation of the method, try to change the data as per your requirement and modify the table.
LOOP AT fp_er_data_changed->mt_good_cells INTO wa_good_cell.
READ TABLE it_data INDEX wa_good_cell-row_id.
.......
.......
ENDLOOP.
Regards,
Rajesh
‎2011 Sep 06 2:08 PM
when i create a new empty line, the debugger falls into this LOOP.
But when i write some values into this new line and press enter, debugger doesnt fall into this LOOP.
Thats why i cant update my non-editable column according to my editable column in this new line.