As you can see, first object is created and freed, but raise event still catch this object. Because free object is not enough to clear object for good. Once object event is registered, runtime is keeping object until event unregistered.

Imagine this you want to deal with 2 or 3 ALV even more and you want to raise some events for these ALV. If you don’t unregister event, runtime allways find freed object and this can cause short dump, unwanted process etc. To avoid such unwanted case, we need to unregister events.

First you need to decide your program algorithm. You can read this article for general concept : OO Events

ABAP Development environment has very easy event handling concept comparing to other languages.

I can give you one easy example :

Imagine, you have button object and screen object. when button pressed you want to change something in screen object. Classical way of doing this, in button object you can call directly screen object and you can do your stuff. Or you can raise button_pressed event and screen object can handle it inside itself.

But if you google “oo event design” you can find more document. I think, coding languages are not important for concept and design. It’s OO development at the end