Application Development 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: 

Problem with alv

former_member191468
Participant
0 Kudos

Hi,

I have an alv in which some columns are input enabled. Now problem is when any cell of the alv is modified,it should be updated into the internal table which given to alv with pressing any button on alv toolbar.

please let me know if any method are there to get the values updated in the alv.Please let me know if any method for refreshing the screen data into the internal table.

Regards

Anil Kumar K

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Anil,

You need to call the following method in the PAI of your screen.

CL_GUI_ALV_GRID-->CHECK_CHANGED_DATA.

The minute this fires, you will have updated data in the table.

Regards,

Ravi

Note : Please mark the helpful answers.

5 REPLIES 5

Former Member
0 Kudos

HI Anil,

you'll have to register the event..

once done the changes will be stored in the internal table itself..


data : g_grid TYPE REF TO cl_gui_alv_grid.
...
CALL METHOD g_grid->register_edit_event
    EXPORTING
      i_event_id = cl_gui_alv_grid=>mc_evt_modified.

the screen data is always refreshed in the itab itself ..

regards

satesh

Message was edited by: Satesh R

Former Member
0 Kudos

Anil,

You need to call the following method in the PAI of your screen.

CL_GUI_ALV_GRID-->CHECK_CHANGED_DATA.

The minute this fires, you will have updated data in the table.

Regards,

Ravi

Note : Please mark the helpful answers.

0 Kudos

Hi Ravi kumar,

Thanks a lot. problem is solved. I have awarded points also.

Regrads

Anil Kumar K

Former Member
0 Kudos

Hi Anil,

Check this link:

You will have to create an event handler for the event data_changed of class cl_gui_alv_grid.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/an easy reference for alv grid control.pdf

Hope it helps you.

Regards

Anjali

former_member188685
Active Contributor
0 Kudos

Hi Anil,

You need to set the handler for datachanged.

set the handler for this, and register the event modified or enter.

**Handler to Check the Data Change
    HANDLE_DATA_CHANGED FOR EVENT DATA_CHANGED
                         OF CL_GUI_ALV_GRID
                         IMPORTING ER_DATA_CHANGED
                                   E_ONF4
                                   E_ONF4_BEFORE
                                   E_ONF4_AFTER,

**Handle Data Change
  METHOD HANDLE_DATA_CHANGED.

 DATA: X_CHANGE TYPE LVC_S_MODI.


    LOOP AT ER_DATA_CHANGED->MT_GOOD_CELLS INTO X_CHANGE.

    ENDLOOP.
  ENDMETHOD.                    "HANDLE_DATA_CHANGED

regards

vjay