Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

class alv refresh problem

Former Member
0 Likes
718

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.

....

5 REPLIES 5
Read only

Sandra_Rossi
Active Contributor
0 Likes
639

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

Read only

madhu_vadlamani
Active Contributor
0 Likes
639

Hi Ayd,

Check as Sandra told.

[Refresh Button|http://wiki.sdn.sap.com/wiki/display/ABAP/MakingALVtoreacttoChangedata+automatically]

Regards,

Madhu.

Read only

0 Likes
639

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?

Read only

0 Likes
639

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

Read only

0 Likes
639

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.