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

Are Classes better than Function groups and Modules

Former Member
0 Likes
1,539

Hi,

Are classes better than Function groups? For example if you want to execute something is back ground or use parallel processing you can't do it using classes. Even inside classes most of the places we use Function modules.

Then how classes are beneficial?

Regards,

Deepak Bhalla

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
1,428

Classes are beneficial for the OO concepts. Reusability, and easier maintenance. No, you can't use a class like a function module(paralell processing) which means that function modules will not go away anytime soon. You use each for different purposes, so you can't really say that one is better than the other.

Regards,

Rich Heilman

6 REPLIES 6
Read only

LucianoBentiveg
Active Contributor
0 Likes
1,428

I think classes are beneficial when requierment apply to objects paradigm.

Read only

RichHeilman
Developer Advocate
Developer Advocate
1,429

Classes are beneficial for the OO concepts. Reusability, and easier maintenance. No, you can't use a class like a function module(paralell processing) which means that function modules will not go away anytime soon. You use each for different purposes, so you can't really say that one is better than the other.

Regards,

Rich Heilman

Read only

0 Likes
1,428

Thanks for all the insights.

Classes are different than FM's but still in SAP help function groups and classes are compared. Thats bit confusing.

If we move from conventional programming to OOP will it have any impact on performance as well.

How does classes are different than Business Objects in terms of OO designing?

Read only

0 Likes
1,428

Yes they are compared in the sense that the class and function group are the containers, and the methods and function modules are the interfaces in which you interact with the encapsulated data.

Again if you are developing an application in which you are not forced to push the processing to differenet work processes, then using classes/methods is preferrable. The reason I say this, is because anything coming from SAP will most likely be implemented as a class as opposed to a function group. This is not to say that SAP will not create new function modules, because of course there still is a use for them.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,428

Yes atleast for alv grid i feel class is the best option than FM. We can add many functionality with the class then the FM.

Read only

former_member186741
Active Contributor
0 Likes
1,428

I don't know if classes have any proven advantage over conventional code but I think they are the way forward and it is in every abap programmer's interest to get to grips with the skills and acquire the knowledge.

Having said that care must be taken in the design or perfromance can be impacted. Each problem needs to be looked at on its own and the appropriate way to solve it chosen. Sometimes this can be an OOPS approach sometimes conventional abap.