2020 May 13 12:13 PM
I am currently trying to get into OO Programming. I made some class definitions and implementations, but if i understand correctly, i have to put my "main" code / entry point between the definitions and implementations. Is there a better "entry point" for object oriented programming?
2020 May 13 1:40 PM
Hi Former Member
Generally speaking the main point of entry of any ABAP report is a START-OF-SELECTION event.
This is what gets executed when user hits F8 on the selection screen. This could be a good place to instantiate your objects and execute any methods/logic you want to run in the report.
That being said, there are other event, e.g.: INITIALIZATION, AT SELECTION-SCREEN (OUTPUT) which might also warrant an object instantiation and execution of instance (or static) methods.
It all depends on what you want to achieve and what does your logic do.
regards,
Mateusz
I am currently trying to get into OO Programming. I made some class definitions and implementations, but if i understand correctly, i have to put my "main" code / entry point between the definitions and implementations. Is there a better "entry point" for object oriented programming?
2020 May 13 1:05 PM
What you mean with "main code"? The implementation? The creation of the class instance?
2020 May 13 1:36 PM
I mean the piece of Code that is executed when i hit F8 (in SE80 for example)
From there i can start a method in my class
2020 May 13 1:40 PM
Hi Former Member
Generally speaking the main point of entry of any ABAP report is a START-OF-SELECTION event.
This is what gets executed when user hits F8 on the selection screen. This could be a good place to instantiate your objects and execute any methods/logic you want to run in the report.
That being said, there are other event, e.g.: INITIALIZATION, AT SELECTION-SCREEN (OUTPUT) which might also warrant an object instantiation and execution of instance (or static) methods.
It all depends on what you want to achieve and what does your logic do.
regards,
Mateusz
2020 May 13 4:43 PM
Hey there, thanks for your answer!
START-OF-SELECTION was what i was looking for!
How do i link/tag you in a comment/answer btw?
2020 May 13 8:27 PM
You have to use @ sign and then enter the account name Former Member
PS: Glad my answered helped you! 🙂