Re-learn ABAP: Transition from Procedural to OO ABAP
This is my first post for this blog. I admit that I am a bit hesitant to post this as I feel it will have no merit as a contribution for any ABAP related content. But I feel that this is the best place to start a blog about ABAP. Not only are there people who can relate, I also believe there are people who can give advice like the experts and mentors or fellow ABAP enthusiasts.
SDN has always been the main place for me when I search for ABAP related information. It was only lately that I subscribed to the ABAP Weblogs RSS which resulted with me reading 2 interesting blogs:
- ABAPpers: How diverse should you be? by Dawood S. Ghasletwala
- Can we reinvent the grey haired ABAPer? by John Moy
After reading the above mentioned blogs, I got into thinking. But before that, let me start by giving a brief overview about me.
I got started with ABAP programming in 2005 and in a rather rushed way. The first company I worked for needed to replace a resigned ABAPper and so I was taught in a rush. I recall I was only taught the basic statements DATA, SELECT, LOOP and WRITE and crudely introduced to the concept of internal tables. All this was done in more or less 4 hours. The next day, I was given some actual work. For the most part of the 2 years I worked in that company, I gradually taught myself ABAP as best as I knew how but only things I needed to complete the requirements given to me. It never occured to me to improve my skill set then because most work I received were basically reports — basic LOOP AT, WRITE and WS_DOWNLOAD stuff (we had a 4.6C system then).
In 2007, an opportunity presented itself when an outsourcing firm opened in a nearby city looking for experienced ABAP programmers. I applied and was hired. This time around, I felt compelled to learn many things because I was basically handling work units that involved the many facets of ABAP — reports, interfaces, forms and enhancements. This time around, everything was different as I had to cope with strict deadlines for clients so learning new ABAP technology was sidelined. Most systems are still in the older, procedural ABAP paradigm although some have migrated to the newer systems i.e. ECC6. I have been at it for 3 years now and only recently have I felt that I have not improved or grown my ABAP skills.
Going back, after reading the 2 blogs I mentioned above, I felt that I needed to step-up my skills gradually. The 2 blogs actually inspired me to create this blog as an entry point in finding the best way to re-learn ABAP programming. I think that the first step I should take is to shed my procedural ABAP programming style and start using ABAP Objects and learn the basics of Web Dynpro.
For now, I need advice particularly on transitioning from procedural to OO ABAP. Any ideas, tips or recommendations?
Like "normal" programming, object oriented programming is a generic skill. Pretty much what you learn of the overall design in one language will apply to any other language. And that is how I approached learning ABAP Objects. To be frank, ABAP Objects isn't the best language to learn on. It's pretty clunky.
What I did, was buy a copy of Head First Java, from the O'Reilly Press, download Eclipse, and work through the book. Once I'd completed the book (the only "teach yourself" book I've ever completed ), I wrote a few programs - implementing a few card games and a few other bits and pieces. Once I was happy with that, I started doing ABAP Objects. I'd already learned the framework, on one of the first courses on the subject offered by SAP back in 2000. But the techniques of OO programming were what I really needed to know. And I was able to apply what I'd learned in Java to the ABAP world.
I've now been doing OO ABAP for 5 years, and find that I'm able to develop faster, cleaner, and better than I was ever able to do before. And when i can exploit the power of inheritance and polymorphism... well, that's pretty cool. My customers like it as well, when a little subclass here, or new interface implementation, produces some new, very useful, business functionality. Tiny change - great effect - low cost!
But any new learning is never a waste of time - you never know when it might come in useful. I learned Java and how to use Eclipse. Then my client had a requirement for a servlet, to be written in Java, using the Netweaver Development Studio (or whatever it's called now - but it is Eclipse). Bingo - 10 days interesting work!
It's a bit of an uphill battle. I'm FINALLY using some of the more advanced features.
1. I went to classes. Forgot what I knew while doing "real" work programming procedurally.
2. Decided I really needed objects.
3. Went to elearning here at SCN. Very cool. I kept the presentation open, paused it, and designed the solution on our system. Now I have an example(s) to go back to.
4. Started using classes. ALV grid is a great place to start.
5. Started writing classes - and I know the OO programmers will cringe - but starting to write classes like I do function modules.
6. Moved into a more OO approach. Currently using inheritance and polymorphism. Boy is this helpful.
7. Another tool to use. I downloaded ZSAPLINK. That is easy to follow and uses OO well.
8. Made (make) the consultants who have come here program in objects. That's not always the best idea. Some of them struggle as much - or more - than I do.
Take your time and think thru the design.
Learn on a project with a longer timeline where you have time to tweak your programs.
Just get started. Don't spend too much time thinking about it. You'll drive yourself nuts!
Basic syntax is the same as procedural. That makes everything easier. I can still use the same statements / performance techniques that I always have. Huge benefit over learning a new language.
Basic syntax is the same as procedural. That makes everything harder. It is tempting to revert back to procedural while using classes. Then you can tell yourself that you are programming OO and really you've just found a different way of creating function modules.
SCN is a great resource! I tend to promote it rather loudly.
I think we all do. Even when using the new techniques. I didn't come from an OO background. RPG - my language of choice.
But sometimes getting started is the hardest part. Knowing where to start tends to lead to thinking about it too much.
I can relate to your situation easily. Our career profiles are similar & our interests do match - OO ABAP.
You can check this forum discussion(), Uwe has 3 simple steps:
1. "Think big, start small!"
2. "Start now!"
3. "Grab every chance to use existing classes and create your own whenever necessary."
Happy learning !!
I have watched all five, they are very informative and Thomas has examples that he shows you as well. He also has recently done a 7 part video series on web dynpro that I am currently working my way through.
SAP-Press has some books that will help, but I have found so far that just finding example programs and coding them yourself goes a long way in teaching the concepts of oo, the books help, but...
Once your test program is working use the extended check in your class builder to check your class for obsolete statements and other tips that will help too.