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

Problem with alv

Former Member
0 Likes
741

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
Read only

Former Member
0 Likes
714

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
Read only

Former Member
0 Likes
714

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

Read only

Former Member
0 Likes
715

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.

Read only

0 Likes
714

Hi Ravi kumar,

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

Regrads

Anil Kumar K

Read only

Former Member
0 Likes
714

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

Read only

Former Member
0 Likes
714

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