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

Update Datafrom ALV Grid on 'SAVE' click

Karan_Chopra_
Active Participant
0 Likes
2,220

I have an Editable ALV GRID control and I want to to check the data entered in editable cells of ALV and update the database accordingly , but it is only on SAVE button click on application toolbar

How can I track the changes in ALV , I am not using HANDLE DATA CHANGED Event as it is triggered on mouse double click or just changing cell content and not triggred on SAVE button click...

Plz help

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,435

call method c_alvgd->check_changed_data( ).

Based on user input when user clicks save , use pop-up-to- confirm and if yes referesh the data.

call method c_alvgd->check_changed_data( ).

Based on user input when user clicks save , use pop-up-to- confirm and if yes referesh the data.

5 REPLIES 5
Read only

Former Member
0 Likes
1,436

call method c_alvgd->check_changed_data( ).

Based on user input when user clicks save , use pop-up-to- confirm and if yes referesh the data.

Read only

Former Member
0 Likes
1,435

Hello Karan ,

u need to use event DATA CHANGED to get latest values of the ALV container .

call method g_grid%1->check_changed_data.
  call method g_grid%1->refresh_table_display.

regards

Prabhu

Read only

Karan_Chopra_
Active Participant
0 Likes
1,435

But I need to do some validations on the screen and then save data

which I did thru handle data chage event , which can be triggered thru ENTER key press and not on SAVE click

how to trigger it on SAVE click

Edited by: Karan Chopra on Aug 6, 2010 2:54 PM

Read only

0 Likes
1,435

Hi,

go through below code,using this we can get the changes in the internal table used for report display.

Data ref1 type ref to cl_gui_alv_grid.

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

IMPORTING

E_GRID = ref1.

call method ref1->check_changed_data.

Regards,

Rajesh Akarte

Read only

0 Likes
1,435

Two people gave the right answer already. When you have determined that the Save button was clicked, you need to call call method alv->check_changed_data( ). This will refresh the data from the grid and then you can do any checking you want before saving. If you are using the HANDLE_DATA_CHANGED and HANDLE_DATA_CHANGED_FINISHED events, then calling call method alv->check_changed_data( ) will trigger those events.

Best Regards,

Brian