‎2023 Nov 24 7:19 AM
Hi All,
Is it a good idea to write a local class within a function module?
Thanks in advance
Poornima
‎2023 Nov 24 8:03 AM
If it's appropriate, why not?
Just use the correct includes.
DNN Declaration of local classes
D..* Declaration of local classes definitions that are to be included in the top include of the function groups
PNN Implementation of local classes
P..* Implementation of local classes that are to be included in global data of the function groups
‎2023 Nov 24 8:30 AM
Better than writing old style FORMs anyway!
But I would consider creating a global class and using the FM just as a wrapper - if the FM is needed at all...
‎2023 Nov 24 8:38 AM
Hi Matthew
I thought instead of mixing both procedural & OOPS, it would be better to use one approach.
Thanks
Poornima
‎2023 Nov 24 9:38 AM
voorapoornima That would be better to indicate your thoughts in your initial question, to differentiate it from the exact same question asked and answered 10 years ago.
‎2023 Nov 24 12:14 PM
It is better to use local classes than forms.However, I always use a global class nowadays, as 549747a7e4a74d368295cb9cc2b08cc4 recommends.
‎2023 Nov 24 9:36 AM
Why didn't you search before asking, exactly the same question 10 years ago.
Is it a good idea to write local class within a function module? site:sap.com