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: 

Need help using method check_changed_data correctly

Former Member
0 Kudos

I'm using method check_changed_data in my ALV program to update the grid with changes the user makes. The method works fine for this purpose. But I also want to know if any data actually changed. Can anyone give me an example?

FORM update_vendor .

  • do I need to call a different method before check_changed_data ?

call method gridhead->check_changed_data.

  • is there a parameter available here to see if anything actually

  • changed?

loop at gt_head into wa_head.

clear wa_head-lifnam.

select single name1 into wa_head-lifnam

from LFA1 where lifnr eq wa_head-lifnr.

if sy-subrc eq 0.

modify gt_head from wa_head.

endif.

endloop.

ENDFORM. " update_vendor

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

Hello Beth

If data have been changed then method <b>go_grid->CHECK_CHANGED_DATA</b> will raise event <b>DATA_CHANGED</b>. If you have an event handler method like HANDLE_DATA_CHANGED then you can, for example, validate the changes.

If no data were changed event DATA_CHANGED will not be raised and your event handler method will not be called.

Regards

Uwe

1 REPLY 1

uwe_schieferstein
Active Contributor
0 Kudos

Hello Beth

If data have been changed then method <b>go_grid->CHECK_CHANGED_DATA</b> will raise event <b>DATA_CHANGED</b>. If you have an event handler method like HANDLE_DATA_CHANGED then you can, for example, validate the changes.

If no data were changed event DATA_CHANGED will not be raised and your event handler method will not be called.

Regards

Uwe