Previous Post: ABAP Freak Show – June 17th – Large Database Objects in 7.02 Next Post: ABAP Freak Show – July 1st – ABAP OO Tutorial Part 2
ABAP Freak Show – July 1st – ABAP OO Tutorial Part 1
by Thomas Jung on July 1, 2009 at 2:16 pm
This week we begin a 5 part series based upon a frequent request – to look at basic ABAP Object Oriented concepts. Throughout this series we will look at OO terminology, development tools, and design patterns that span a variety of ABAP release levels. We will try to keep the discussion away from all the new cutting edge syntax so that it is still quite usable for those of you on older releases like 4.6C or 6.20.
For the 5 part series we will start with Part 1 looking at tooling (the ABAP Class Builder) and some basic terminology. In Part 2 we will expand the lesson by looking at static vs. instance, visibility, exception classes, inheritance, polymorphism and abstract classes. In part 3 we will see how a special type of class, called a persistent object, can be used for Object Oriented access to the database. In part 4 we will explore Object Oriented concepts in User Interface technologies. Keeping with the theme of older release levels, we will focus this part on using Model View Controller and OO eventing within Classic Dynpro applications. Finally in part 5 we will look at real world, complex example that uses all the techniques and technologies from the previous parts.
You can also download all the source code from all 5 tutorials. Just be sure to look at the ReadMe.pdf file for important tips on installing the source code.
http://abap-sdn-examples-tpj.googlecode.com/files/AFS_OO_Tutorials_Source_Code.zip
You can download a high resolution version MP4 version of the video here:
http://blip.tv/file/get/Thomas_jung-AFSJuly12009ABAPOOPart1752.mp4
You can download an iPod/iPhone version of the video here:
http://blip.tv/file/get/Thomas_jung-AFSJuly12009ABAPOOPart1358.mp4
Tags: ABAP, ABAP Freak Show, NetWeaver, OO


Thanks Thomas for the beginners oo-tutorials. I’ve got two questions about OO and selection screens.
The way people start programs in ERP are done by transactions. So Tcodes can link directly to OO-Classes. Is there a way to use theses powerful selection-screens in OO methods, because for an selection screen you ever need to create a program (which seems a little bit old style
).
When using a selection options with ranges for an data-element like:
SELECT-OPTIONS: so_matnr FOR mara-matnr.
and you want using it in OO-context you’ve declare a separate range-table like this:
DATA: ltr_matnr TYPE RANGE OF mara-matnr.
ltr_matnr[] = so_matnr[].
CALL METHOD zcl_class=>init_attr
CHANGING matnr = ltr_matnr.
Are there other / smarter ways, today?
Thanks for the questions. These aspects of integration into the UI for Classic Dynpro constructs are all things I will cover in Part 4 of the tutorial.
For any screen related elements (Selection Screens or Full Dynpro screens), you still need a program. Yes it is old style, but by the time OO was coming along in ABAP we were already beginning the transition to new UI technologies and I suppose the investment in a full OO version of classic dynpro just wasn’t worth it.
However in part 4 I will talk about how to keep this program as mostly an empty shell and divert most of your processing into a class.
Finally, yes the range table is the only way of declaring a parameter or variable to access a select-option. You can at least create range tables as data dictionary table types. I will show that in part 4 as well.
Revising ABAP objects http://bit.ly/vTWgy
This comment was originally posted on Twitter
NEW: ABAP Freak Show – July 1st – ABAP OO Tutorial Part 1 – http://is.gd/1onC7,
This comment was originally posted on Twitter
NEW: ABAP Freak Show – July 1st – ABAP OO Tutorial Part 2 – http://is.gd/1onEb,
This comment was originally posted on Twitter
Hi Thomas,
Thanks for doing these – they are really useful. I am not sure if this question even makes sense, but I will ask it anyway
… I always thought that ABAP was originally procedural due to the fact that it was somehow compiled down to C (I’m not sure why I assumed this) – did something change in the underlying implementation of ABAP to allow for ABAP OO?
Keep up the great work. Really enjoy listening and learning about this stuff.
Simon
PUBLISHED: ABAP Freak Show – July 1st – ABAP OO Tutorial Part 2 – http://is.gd/1onEb,
This comment was originally posted on Twitter
PUBLISHED: ABAP Freak Show – July 1st – ABAP OO Tutorial Part 1 – http://is.gd/1onC7,
This comment was originally posted on Twitter
>always thought that ABAP was originally procedural due to the fact that it was somehow compiled down to C (I’m not sure why I assumed this)
ABAP doesn’t really compile down to C code. The confusion is maybe the fact that the ABAP Compiler and the ABAP virtual machine are both implemented in C/C++. However ABAP creates a byte code that is interpreted by the ABAP virtual machine – actually a lot like the way Java works. But this doesn’t really effect OO/Procedural.
ABAP was procedural simply because that was the way most programming languages were designed when ABAP first came about. Procedural ABAP design is largely a mixture of concepts from COBOL and C.
watching part 2 of ABAP OO tutorial by thomas at egeeks
http://is.gd/1EbVn
This comment was originally posted on Twitter
By the way, er is ook nog een deel 2, 3, 4 en 5
This comment was originally posted on hsenden’s posterous