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

Edit ALV grid

Former Member
0 Likes
996

Hi,

In an intractive ALV grid display, I have an edited field, need to changed the field value and pass to the next screen. In the next screen the old value is retaining.

How do I get the changed value?

Regards

Priya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
810

Hi,

In Sy-ucomm, when you click the SAVE button, call the method like this.

WHEN 'SAVE'.

DATA w_ref1 TYPE REF TO cl_gui_alv_grid.

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

IMPORTING

e_grid = w_ref1.

CALL METHOD w_ref1->check_changed_data.

CALL METHOD w_ref1->register_edit_event

EXPORTING

i_event_id = cl_gui_alv_grid=>mc_evt_modified.

Thanks

Sabu

Hi,

In an intractive ALV grid display, I have an edited field, need to changed the field value and pass to the next screen. In the next screen the old value is retaining.

How do I get the changed value?

Regards

Priya

4 REPLIES 4
Read only

Former Member
0 Likes
810

Hi Priya,

After changing the fiel value, u need to replace that new value inthe internal table & then call FM FM - REUSE_ALV_BLOCK_LIST_REFRESH. This will refresh the ALV report.

Rgds,

Sachin.

Read only

Former Member
0 Likes
810

Hi

i would suggest you to pass COMMIT WORK after you are editing the field value. And before you display your secondary list, just make sure that you retrive the values again from the table.

Regards

Gaurav.

Read only

Former Member
0 Likes
811

Hi,

In Sy-ucomm, when you click the SAVE button, call the method like this.

WHEN 'SAVE'.

DATA w_ref1 TYPE REF TO cl_gui_alv_grid.

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

IMPORTING

e_grid = w_ref1.

CALL METHOD w_ref1->check_changed_data.

CALL METHOD w_ref1->register_edit_event

EXPORTING

i_event_id = cl_gui_alv_grid=>mc_evt_modified.

Thanks

Sabu

Read only

Former Member
0 Likes
810

Hi,

As we can now make our ALV Grid editable we may require controlling input data. The ALV Grid has events u201Cdata_changedu201D and u201Cdata_changed_finishedu201D. The former method is triggered just after the change at an editable field is perceived. Here you can make checks for the input. And the second event is triggered after the change is committed.

You can select the way how the control perceives data changes by using the method u201Cregister_edit_eventu201D. You have two choices:

i. After return key is pressed: To select this way, to the parameter u201Ci_event_idu201D pass u201Ccl_gui_alv_grid=>mc_evt_enteru201D.

ii. After the field is modified and the cursor is moved to another field: For this, pass u201Ccl_gui_alv_grid=>mc_evt_modifiesu201D to the same parameter.

To make events controlling data changes be triggered, you must select either way by calling this method. Otherwise, these events will not be triggered.

To control field data changes, ALV Grid uses an instance of the class u201CCL_ALV_CHANGED_DATA_PROTOCOLu201D and passes this via the event u201Cdata_changedu201D. Using methods of this class, you can get and modify cell values and produce error messages.

Regards

Rajesh Kumar