Do you have any Doubt/Question? Did you not get an answer in other forums?
It might by Theory, Practical, Project related or just Research related? If you have any cobweb, please feel free to write in our Q&A Forum. Our team, members and readers would surely help you.
Just type your SAP Questions and see the answers flowing back to you.
I have good knowledge in SAP ABAP. Now I have also practised basics of OO ABAP (class, object, encapsulation, abstraction, inheritance, polymorphism, interface, exception, somehow events). However, when I search over internet about oo abap objects (real time) i can easily understand objectives but could not prepare strategy how to really implement it. Sometimes, it happens with ABAP too. So please guide me and share with me if you have any objects with solutions.
Appreciate for your help.
Hello Saif Congratulations!!
You have identified the problem. I am working in ABAP for more than 10 years and when I started ABAP coding, it was still a procedural language. I avoided OOPs for a long time but it kept coming back. Main reason is – SAP is moving towards OOPs. So, I was in similar situation, wondering WHY OOPs. I understood the concept but everything was perfectly doable from subroutine method. It is a matter of habit. I would suggest, if you understand OOPs, start using OOPs where and whenever possible. Follow this strategy: 1. Instead of subroutines, start creating local classes. 2. Instead of FM, start creating global methods. 3. Start with the simpler concepts but start immediately. 4. Executable programs must always follow OOPs declaration. Gradually, it will become a habit and then you will realise the benefits and your vision to use constructors, inheritance etc will come automatically. It will help you immensely when you start using Eclipse for ADT and new things (not so new now) which are coming with SAP HANA. You asked for an object with the solution. I will say, pick up any medium or high complex report which you have already build and redo it. Only this time, following only OOPs. No subroutine, custom FM allowed. Try to do selection screen validation, try to write Initialization. Trust me, if this is your first object, you will face challenges.
As Bhavesh suggested, convert any existing report into OOPs and learn by practicing and debugging.
Please refer to this new post where we have changed one program 4 times to make it OOPs program. This is a very practical example.
This can be a good starting point for you.
All the best.
Hi Saif – There is another real time object in normal ABAP and the same has been converted to OOPs ABAP.
Check this post. This would give you an idea how OOPs work in real projects.