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: 

How to rework below ABAP - OOPS code globally? SE24

sudarshan_d29
Active Participant
0 Kudos

Dear friends,

how to declare the below code globally in se24?

class cl_observable definition.

 public section.

 interfaces: lif_observable.

 aliases: register for lif_observable~register,

 unregister for lif_observable~unregister.

 methods: notifyobservers.

 "Mainly this below code
 private section.
 data: mt_observer type standard table of ref to if_observer.

endclass.

Thanks in advance

Sudarshan David

1 ACCEPTED SOLUTION

matt
Active Contributor

Do it in Eclipse? If you must use SE24, then try button "Source Code-Based".

But it's not at all clear what you're really asking. What do mean "rework"?. What do you mean "globally"? What are you, in fact, trying to achieve?

3 REPLIES 3

matt
Active Contributor

Do it in Eclipse? If you must use SE24, then try button "Source Code-Based".

But it's not at all clear what you're really asking. What do mean "rework"?. What do you mean "globally"? What are you, in fact, trying to achieve?

sudarshan_d29
Active Participant
0 Kudos

Hi Matthew,

I am using Observer design pattern, where I have to register and unregister the observer.

"mt_observer is the table with reference to interface if_observer(list of observer)" --> this table holds the registered observer to get notify the information.

I don't know how to add below code in SE24(Globally),

"Mainly this below code

privatesection.

data: mt_observer typestandardtableofrefto if_observer.

I will change the subject to understand easily 🙂

Thank you

Sandra_Rossi
Active Contributor

Are you asking how "observable" can be implemented in ABAP Objects? There is the Event concept (METHODS handler FOR EVENT ..., SET HANDLER handler...)