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 classes inside Function Modules?

former_member191562
Participant
0 Likes
1,190

I always wanted to design my solutions for IDOCs using Classes and Objects. But the entire structure of IDOC triggering through a Process Code has made the procedural FMs as the only point of trigger.


Now is it ok to define Local classes in the TOP Include of the Function Group and make use of them inside the triggering FM? Or is it a blasphemy for both Procedural and Object Oriented Programming methodologies?

1 REPLY 1
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
442

Hi Yuvraj

For me it will be like mixing two things and making them quiet complex. I am also a procedural guy and learning oops from the last so many years.. What my experience says is you dont have to code it in oops by making things more complex(mixing procedural stuff) whenever not required. Yes when i started with oops i thought let me implement it everywhere but you have to keep in mind various things in mind.

The most important thing is KISS--Keep it simple and Stupid.

It is always good to progam in oops but you will have to see what value it adds to the code. Dont code it in oops for the heck of it.

Nabheet