ABAP Objects – Pros and Cons
ABAP Objects establishes a different level of data encapsulation. In procedural programming the state of an application is held by global variables. In object-oriented programming, however, the state is kept inside separate classes and/or dynamically created objects, and the distinction between public and private components further helps to separate what should be externally visible from internal implementations. Even without in-depth object-oriented modeling, you can easily benefit from these features in your application programs
With ABAP Objects, you get multiple instantiability for free. Together with ABAP Object’s automatic garbage collection, this means that you as a developer neither have to deal with associating data and functionality nor need to explicitly control the lifetime of your objects
ABAP Objects gives you the freedom to work with (standalone) interfaces. This relieves you of the burden of knowing exactly how certain functionality is implemented. It also enables you to exchange an implementation later on without the need for modifications in the code that uses the interface
ABAP Objects makes it easy to incorporate event-driven programming models. Through a “publish and subscribe” model, application components can be loosely coupled. This allows greater flexibility than with the procedural approach, where the coupling is much tighter and the flow of program control is more predetermined.
ABAP Objects Pros
- ABAP Objects is more explicit and therefore simpler than classical ABAP. Examples for pitfalls arising from implicit behavior in classical ABAP are the realization of important interfaces via global data or the dependence of submitted programs on events triggered by the runtime environment. In comparison, ABAP Objects is based on a few basic and orthogonal concepts and is – therefore – more reliable and less error-prone
- ABAP Objects has cleaner syntax and semantics rules. Classical ABAP is an evolutionary-grown language, containing obsolete statements and overlapping concepts. In ABAP Objects, that is in classes and methods, many obsolete statements and additions are forbidden, many implicit syntax completions must be made explicit, and potentially incorrect handling of data is detected and obviated
- ABAP Objects is the only way to use new ABAP technology, such as services for GUI Controls, BSPs, or Web Dynpro. Therefore, you will inevitably be confronted with ABAP Objects when using these technologies. In such cases, it is highly recommendable to switch to ABAP Objects completely. Try to avoid a mix of classical and object-oriented techniques within an application.
ABAP Objects Cons
- In general, object oriented programming always means overhead, on the one hand in the implementation and on the other in the declaration of objects.
- Performance objects are normally always used to keep an object (eg. material). SAP is based on bulk processing. Due to that, if you are processing 1000 materials, 1000 objects need to be generated or you need to enhance the object with some workaround which might not be state of the art. Fact: To keep data among more instances, it might become very tricky.
- At the time there are too less skilled and experienced resources available, e.g. to maintain the code
- To search for bugs in the code might be very challenging, inheritance makes an effective bug fixing almost impossible.
- The much-lauded maintenance decrease, comes only to its positive result, if the bugs have the same root cause. The reality shows that SAP is mostly effected by self-contained problems.
- The explicit higher programming effort does not effect a better result.
- Re usability is given by function modules as well.
So, what is your opinion of ABAP Objects.
If you like this post, you may as well like these too:
- ABAP Objects: Components of Class in ABAP Objects Components of Class in ABAP Objects DATA – for instance attributes METHODS – for instance methods EVENTS – for instance events Static components: CLASS-DATA – for static attributes CLASS-METHODS –...
- ABAP Objects – Class and objects Why do you need ABAP Objects? ABAP Objects oriented programming lets you to be at par with the others as this is better methodology. To understand the recent concept of...
- Not Yet Using ABAP Objects? Eight Reasons why every ABAP Developer should give it a second look. SAP Introducted ABAP objects for a while ago now. Many ABAP Developers turned in and tapped the advantages...
- ABAP Programs: Copying structured objects * Using move-corresponding to copy fields with the same nameDATA: BEGIN OF MY_CUSTOMER, ID(8) TYPE N, NAME(25), CITY(25), END OF MY_CUSTOMER, BEGIN OF CITY_OF_CUSTOMER, CITY LIKE MY_CUSTOMER-CITY, TEXT(30), ID LIKE...
- ABAP Objects for JAVA Pro’s Contains : Similarities Between Java and ABAP ABAP Special Features Download from rapidshare or mediafire....
- ABAP Source Code: Three approaches to define data objects REPORT ZSOURCE0401.* 1. Elementary typesDATA: CUSTOMER_NAME_1(25) TYPE C, VENDOR_NAME_1(25) TYPE C. * 2. Reference to an existing fieldDATA: CUSTOMER_NAME_2(25) TYPE C, VENDOR_NAME_2 LIKE CUSTOMER_NAME_2. * 3. Reference to a non-elementary...
- ABAP Programs: Complex Non-Elementary Types and Data Objects REPORT ZSOURCE0408. * Nested recordsTYPES: BEGIN OF ADDRESS, CITY(25), STREET(30), END OF ADDRESS, BEGIN OF PERSON, NAME(25), ADDRESS TYPE ADDRESS, END OF PERSON.DATA RECEIVER TYPE PERSON.RECEIVER-NAME = ‘Smith’.RECEIVER-ADDRESS-CITY = ‘Big...



















I wouldn’t worry about the abap object cons, they are no way close to what we can achieve with OOABAP.
Yeah.. agree..