Application Development and Automation 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: 
Read only

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

voorapoornima
Explorer
0 Likes
2,217

Hi All,

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

Thanks in advance

Poornima

6 REPLIES 6
Read only

matt
Active Contributor
2,103

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

Read only

0 Likes
2,103

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

Read only

0 Likes
2,103

Hi Matthew

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

Thanks

Poornima

Read only

Sandra_Rossi
Active Contributor
0 Likes
2,103

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.

Read only

matt
Active Contributor
0 Likes
2,103

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

Read only

Sandra_Rossi
Active Contributor
2,103

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