<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>oo on Abapinho</title><link>https://abapinho.com/en/tags/oo/</link><description>Recent content in oo on Abapinho</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>&amp;copy;2009-2026 Nuno Godinho</copyright><lastBuildDate>Mon, 17 Mar 2025 09:00:00 +0000</lastBuildDate><atom:link href="https://abapinho.com/en/tags/oo/index.xml" rel="self" type="application/rss+xml"/><item><title>Where? Who? What? How?</title><link>https://abapinho.com/en/2025/03/onde-quem-oque-como/</link><pubDate>Mon, 17 Mar 2025 09:00:00 +0000</pubDate><guid>https://abapinho.com/en/2025/03/onde-quem-oque-como/</guid><description>&lt;p>You&amp;rsquo;ve been asked to create a new feature. You&amp;rsquo;re ready to build it. But hold your horses. Before you start, I suggest you find answers to a few questions. Finding a good answer to each of them is fundamental to ensuring that what you build is solid and elegant.&lt;/p></description></item><item><title>Clean ABAP</title><link>https://abapinho.com/en/2020/05/clean-abap/</link><pubDate>Wed, 13 May 2020 12:54:21 +0000</pubDate><guid>https://abapinho.com/en/2020/05/clean-abap/</guid><description>&lt;p>For many years, when confronted with ABAP OO, most ABAPers I talked to, acknowledged that OO is great for most languages but never saw any real advantage in adopting it for ABAP. So they carry on using FORMs, INCLUDEs and CALL FUNCTIONs. The standard SAP code sets the example by trying to make something work while breaking every possible programming best practice.&lt;/p></description></item><item><title>Serialization - Clone Dolly in ABAP</title><link>https://abapinho.com/en/2017/10/serializacao-abap/</link><pubDate>Mon, 30 Oct 2017 09:00:20 +0000</pubDate><guid>https://abapinho.com/en/2017/10/serializacao-abap/</guid><description>&lt;p>This article was written by José Vília:&lt;/p>
&lt;p>The Dolly sheep was alive in ABAP and I didn&amp;rsquo;t know about it.&lt;/p>
&lt;p>Having created a class instance, I&amp;rsquo;d like to share it with another totally independent program to use it as if the instance had been created there.&lt;/p>
&lt;p>It&amp;rsquo;s an ABAP Dolly sheep factory we&amp;rsquo;re talking about here, people. Serialization in the ABAP world.&lt;/p></description></item><item><title>Get the deepest text of chained exceptions</title><link>https://abapinho.com/en/2017/01/texto-mais-profundo-de-cadeia-de-excepcoes/</link><pubDate>Mon, 16 Jan 2017 10:34:04 +0000</pubDate><guid>https://abapinho.com/en/2017/01/texto-mais-profundo-de-cadeia-de-excepcoes/</guid><description>&lt;p>If you&amp;rsquo;re not already using ABAP Objects you&amp;rsquo;re &lt;a href="https://abapinho.com/en/2012/10/mariquinhas-pe-de-salsa/">chicken&lt;/a>.&lt;/p>
&lt;p>If you use them, I do hope you&amp;rsquo;re following the &lt;a href="https://abapinho.com/en/2015/01/usaras-classes-de-excepcao/">best practice&lt;/a> of using class exceptions.&lt;/p>
&lt;p>And if you&amp;rsquo;re using class exceptions you better understand the best way of using them, particularly the &lt;a href="https://abapinho.com/en/2015/02/cadeias-de-excepcoes/">advantages of chaining them&lt;/a>.&lt;/p>
&lt;p>This said, here&amp;rsquo;s what brings us here today. In the post about &lt;a href="https://abapinho.com/en/2015/02/cadeias-de-excepcoes/">chained exceptions&lt;/a> I showed a way to get the text of the deepest exception in the chain by using a WHILE loop:&lt;/p></description></item><item><title>Convert class exception to BAPIRET2</title><link>https://abapinho.com/en/2016/12/converte-classe-excepcao-numa-bapiret2/</link><pubDate>Mon, 12 Dec 2016 09:00:06 +0000</pubDate><guid>https://abapinho.com/en/2016/12/converte-classe-excepcao-numa-bapiret2/</guid><description>&lt;p>Some time ago I wrote an article explaining a way to automatically &lt;a href="https://abapinho.com/en/2015/06/converter-excepcao-em-classe-de-excepcao/">convert classic exceptions to exception classes&lt;/a>. Today I use this technique in almost all the exception classes that I create (and I&amp;rsquo;ve even improved it, but I&amp;rsquo;ll leave that for another post).&lt;/p>
&lt;p>This tip explains the exact opposite.&lt;/p></description></item><item><title>Software design patterns in ABAP</title><link>https://abapinho.com/en/2016/02/padroes-de-projecto-de-software/</link><pubDate>Mon, 15 Feb 2016 09:00:26 +0000</pubDate><guid>https://abapinho.com/en/2016/02/padroes-de-projecto-de-software/</guid><description>We are constantly learning. But once in a while we learn something which is a leap forward forcing us to look in a new way to everything we do.
The last time this had happened was when I started using OO in ABAP. OO was not new to me as I had already used it extensively in Java, C#, C++, etc. But to finally be able to apply these precious concepts on my daily job was a relief and a big improvement in the quality, flexibility and speed of my work.</description></item><item><title>Converting an exception into an exception</title><link>https://abapinho.com/en/2015/06/converter-excepcao-em-classe-de-excepcao/</link><pubDate>Mon, 01 Jun 2015 09:00:21 +0000</pubDate><guid>https://abapinho.com/en/2015/06/converter-excepcao-em-classe-de-excepcao/</guid><description>&lt;p>If you’re still not using exception classes, then you’re making a mistake. Cause they are very healthy for your code. They’re not only good nutrients for the system, they also make it lean and less vulnerable to diseases.&lt;/p>
&lt;p>There are cases where you still need to deal with the old exceptions. For example, when a function module is invoked.&lt;/p>
&lt;p>In this article I am presenting a suggestion that seems a little complex, but it works very well if you need to integrate the old exceptions with exception class in a simple way. And though it is sophisticated, you only need to do it once. Once it&amp;rsquo;s done, it&amp;rsquo;s easy to use.&lt;/p></description></item><item><title>Chained exceptions</title><link>https://abapinho.com/en/2015/02/cadeias-de-excepcoes/</link><pubDate>Mon, 02 Feb 2015 09:00:48 +0000</pubDate><guid>https://abapinho.com/en/2015/02/cadeias-de-excepcoes/</guid><description>Today I will teach you how to chain exceptions. It’s a very practical solution to a complicated, not so obvious problem.
Let’s start by describing the problem.
Imagine you are in the application BANANA. The application is quite complex. It has three modules: BANANA1, BANANA2 and BANANA3. Each one has its exception class ZCX_BANANA1, ZCX_BANANA2 and ZCX_BANANA3. Since the application is in fact well designed, all the exception classes inherit from the same ZCX_BANANA.</description></item><item><title>Thou shalt use exception classes</title><link>https://abapinho.com/en/2015/01/usaras-classes-de-excepcao/</link><pubDate>Thu, 22 Jan 2015 09:00:28 +0000</pubDate><guid>https://abapinho.com/en/2015/01/usaras-classes-de-excepcao/</guid><description>In classes, consider using exceptions classes over the old ones. These have great advantages and, once understood, are simple and allow for simpler code.
https://zevolving.com/2011/12/class-based-exception/</description></item><item><title>Packages 2.0</title><link>https://abapinho.com/en/2014/07/pacotes-2-0/</link><pubDate>Mon, 21 Jul 2014 09:00:12 +0000</pubDate><guid>https://abapinho.com/en/2014/07/pacotes-2-0/</guid><description>&lt;p>SAP R/3 repository is a wonderful thing. A vast warehouse of data elements, structures, tables and much more, readily available to one and all. As developers, it is extremely convenient to quickly pick these elements and pull them into our programs as necessity conveys, while our string of thought remains virtually uninterrupted.
Well, not all is sunshine and roses. If you are not careful with the mushrooms you pick you might get a poisoned one.&lt;/p></description></item><item><title>Thou shalt not use direct code in user-exits</title><link>https://abapinho.com/en/2014/06/nao-implementaras-codigo-em-user-exits-badis-enhancements-etc/</link><pubDate>Thu, 26 Jun 2014 09:00:47 +0000</pubDate><guid>https://abapinho.com/en/2014/06/nao-implementaras-codigo-em-user-exits-badis-enhancements-etc/</guid><description>All code to be put in user-exits (BADIs, enhancements, SMOD, etc.) should be encapsulated.
It’s common for an user-exit to include multiple independent parts. Each of these parts should be encapsulated in its own method. Even if it is only one line;
This should apply to both new implementations and changes to existing code;
A change to existing code should always be seen as an opportunity to organize existing code into methods, since it will have to be tested again anyway;</description></item><item><title>Thou shalt not implement in classical processing blocks</title><link>https://abapinho.com/en/2014/06/nao-implementaras-blocos-de-processamento-classico/</link><pubDate>Thu, 19 Jun 2014 09:00:32 +0000</pubDate><guid>https://abapinho.com/en/2014/06/nao-implementaras-blocos-de-processamento-classico/</guid><description>Official ABAP Programming Guidelines (page 34): [When a classical processing block is required], you should immediately delegate the execution to a suitable method (see Rule 6.37, No Implementations in Function Modules and Subroutines, and Rule 6.44, No Implementations in Dialog Modules and Event Blocks).</description></item><item><title>Thou shalt use ABAP OO whenever possible</title><link>https://abapinho.com/en/2014/06/usa-abap-oo-sempre-que-possivel/</link><pubDate>Tue, 10 Jun 2014 13:14:29 +0000</pubDate><guid>https://abapinho.com/en/2014/06/usa-abap-oo-sempre-que-possivel/</guid><description>All new developments should be implemented using ABAP Objects unless still impossible (RFC, IN UPDATE TASK, screens, etc). Existing developments, when rewritten, should also be converted to OO, if it proves to be realistic. Official ABAP Programming Guidelines (page 32) rule 3.1: Use ABAP Objects whenever possible for new and further developments. Classical processing blocks may be newly created in exceptional cases only.
pdf/why-abap-objects.pdf
https://scn.sap.com/people/thomas.jung/blog/2007/12/19/update-your-abap-development-skills-to-sap-netweaver-70
https://wiki.sdn.sap.com/wiki/display/ABAP/ABAP+Objects</description></item><item><title>Always use message classes in exception classes.</title><link>https://abapinho.com/en/2013/12/classes-de-mensagens-nas-classe-de-excepcao/</link><pubDate>Mon, 16 Dec 2013 09:00:49 +0000</pubDate><guid>https://abapinho.com/en/2013/12/classes-de-mensagens-nas-classe-de-excepcao/</guid><description>&lt;p>Exception classes let you state multiple texts describing the different possible errors that they can represent.&lt;/p>
&lt;p>However, there exists an option to associate it with a message class (SE91). This allows texts to be defined as classic SE91 messages instead of being defined directly in the exception class. And it has advantages.&lt;/p></description></item><item><title>Share constants among several classes</title><link>https://abapinho.com/en/2013/03/partilhar-constantes-entre-varias-classes/</link><pubDate>Mon, 25 Mar 2013 09:00:35 +0000</pubDate><guid>https://abapinho.com/en/2013/03/partilhar-constantes-entre-varias-classes/</guid><description>&lt;p>Imagine you have a herd of related classes sharing between them a whole bunch of constants. Saying the same thing a different way, would you like all the classes of the herd to have easy access to the bunch of constants?&lt;/p>
&lt;p>(If you’re confused, then let me tell you that the “herd” thing was just to baffle you)&lt;/p>
&lt;p>Carrying on&amp;hellip;..&lt;/p></description></item><item><title>If you still don't use ABAP Objects you're chicken</title><link>https://abapinho.com/en/2012/10/mariquinhas-pe-de-salsa/</link><pubDate>Mon, 01 Oct 2012 09:00:20 +0000</pubDate><guid>https://abapinho.com/en/2012/10/mariquinhas-pe-de-salsa/</guid><description>SAP has a book called Official ABAP Programming Guidelines which describes rules and best practices on how to program in ABAP. In there you can read:
Page 42: Rule 3.1: Use ABAP Objects whenever possible for new and further developments. Classic processing blocks may be newly created in exceptional cases only.
Page 45: Within such a [classic] processing block, however, you should immediately delegate the execution to a suitable method (see Rule 6.</description></item><item><title>Search object attributes in an internal table</title><link>https://abapinho.com/en/2012/03/atributos-de-objectos-em-tabelas-internas/</link><pubDate>Mon, 26 Mar 2012 10:00:17 +0000</pubDate><guid>https://abapinho.com/en/2012/03/atributos-de-objectos-em-tabelas-internas/</guid><description>&lt;p>There are increasingly more objects in ABAP, gradually less fear of them and, lo and behold, more and more people are writing and using them. It is normal and desirable, if objects begin to appear everywhere, to start to stuff them into internal tables. I also stored a load of objects in tables a while back, unfortunately I did not know at that time what I am going to teach you here. It could have come in handy.&lt;/p>
&lt;p>So, what exactly am I going to teach you here?&lt;/p></description></item><item><title>Implementing private methods in BADIs</title><link>https://abapinho.com/en/2012/03/metodos-privados-em-badis/</link><pubDate>Mon, 19 Mar 2012 10:00:09 +0000</pubDate><guid>https://abapinho.com/en/2012/03/metodos-privados-em-badis/</guid><description>&lt;p>A little while ago I had an idea as eccentric as it was amazing that today I have decided to share here, namely, how to create private methods in BADI classes.&lt;/p>
&lt;p>Let me explain.&lt;/p></description></item></channel></rss>