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: 

Is it a good idea to write local class within a function module?

voorapoornima
Discoverer
0 Kudos
530

Hi All,

Is it a good idea to write a local class within a function module?

Thanks in advance

Poornima

6 REPLIES 6

matt
Active Contributor
416

If it's appropriate, why not?

Just use the correct includes.

https://help.sap.com/doc/saphelp_nw75/7.5.5/en-US/4e/c5268c6e391014adc9fffe4e204223/content.htm?no_c...

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

0 Kudos
416

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...

0 Kudos
416

Hi Matthew

I thought instead of mixing both procedural & OOPS, it would be better to use one approach.

Thanks

Poornima

Sandra_Rossi
Active Contributor
0 Kudos
416

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.

matt
Active Contributor
0 Kudos
416

It is better to use local classes than forms.However, I always use a global class nowadays, as 549747a7e4a74d368295cb9cc2b08cc4 recommends.

Sandra_Rossi
Active Contributor
416

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