<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>performance on Abapinho</title><link>https://abapinho.com/en/tags/performance/</link><description>Recent content in performance on Abapinho</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>&amp;copy;2009-2026 Nuno Godinho</copyright><lastBuildDate>Mon, 11 Jul 2016 09:00:21 +0000</lastBuildDate><atom:link href="https://abapinho.com/en/tags/performance/index.xml" rel="self" type="application/rss+xml"/><item><title>Pass internal tables by value is good</title><link>https://abapinho.com/en/2016/07/passar-tabelas-internas-valor-bom/</link><pubDate>Mon, 11 Jul 2016 09:00:21 +0000</pubDate><guid>https://abapinho.com/en/2016/07/passar-tabelas-internas-valor-bom/</guid><description>&lt;p>When a method returns a value as a RETURNING parameter this is always done by value and not by reference. Several of my methods return internal tables, some of them quite large. It always worried me the idea that, since it’s being passed by value, ABAP would be returning a copy of the internal table, impacting both performance and the program’s used memory.&lt;/p>
&lt;p>Fortunately, I recently learned that this is not​ a problem.&lt;/p></description></item><item><title>Internal table secondary indexes</title><link>https://abapinho.com/en/2016/01/indices-secundarios-em-tabelas-internas/</link><pubDate>Mon, 25 Jan 2016 09:00:47 +0000</pubDate><guid>https://abapinho.com/en/2016/01/indices-secundarios-em-tabelas-internas/</guid><description>&lt;p>This is how internal tables used to be declared:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2;">&lt;code class="language-ABAP" data-lang="ABAP">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#00f">DATA&lt;/span>: &lt;span style="color:#000">itbl&lt;/span> &lt;span style="color:#00f">TYPE TABLE OF&lt;/span> &lt;span style="color:#000">bkpf&lt;/span>.&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>DELETE vs CLEAR vs REFRESH vs FREE</title><link>https://abapinho.com/en/2015/07/delete-vs-clear-vs-refresh-vs-free/</link><pubDate>Mon, 27 Jul 2015 09:00:01 +0000</pubDate><guid>https://abapinho.com/en/2015/07/delete-vs-clear-vs-refresh-vs-free/</guid><description>&lt;p>DELETE
CLEAR
REFRESH
FREE&lt;/p>
&lt;p>These are different ways of deleting all data from an internal table. They look the same. But they aren&amp;rsquo;t.&lt;/p></description></item><item><title>Teach ABAP to juggle</title><link>https://abapinho.com/en/2015/05/processamento-paralelo/</link><pubDate>Mon, 18 May 2015 09:00:13 +0000</pubDate><guid>https://abapinho.com/en/2015/05/processamento-paralelo/</guid><description>&lt;p>What can be done when a night is not enough to complete the daily processes?&lt;/p></description></item><item><title>Thou shalt use TRANSPORTING NO FIELDS</title><link>https://abapinho.com/en/2015/03/usaras-transporting-no-fields/</link><pubDate>Mon, 09 Mar 2015 09:00:02 +0000</pubDate><guid>https://abapinho.com/en/2015/03/usaras-transporting-no-fields/</guid><description>Many times we do READ TABLE itbl or LOOP AT itbl just to do a CHECK SY-SUBRC = 0. In these cases, the actual data read is not needed. For these cases always use TRANSPORTING NO FIELDS. This way is faster and avoids having to declare a target structure.</description></item><item><title>INNER JOIN vs FOR ALL ENTRIES vs artificial RANGES</title><link>https://abapinho.com/en/2014/11/inner-join-vs-for-all-entries-vs-ranges-artificiais/</link><pubDate>Tue, 25 Nov 2014 09:00:13 +0000</pubDate><guid>https://abapinho.com/en/2014/11/inner-join-vs-for-all-entries-vs-ranges-artificiais/</guid><description>Since data operations are much more optimized in the database server than in ABAP, it is always better to use the first as much as possible. FOR ALL ENTRIES should only be used when INNER JOIN doesn’t give us what we need or is not possible (like with BSEG for example). Artificial ranges are also a possible alternative to FOR ALL ENTRIES but be careful not to reach the SQL parser limit.</description></item><item><title>Thou shalt not SELECT *</title><link>https://abapinho.com/en/2014/09/nao-facas-select-asterisco/</link><pubDate>Thu, 04 Sep 2014 11:25:03 +0000</pubDate><guid>https://abapinho.com/en/2014/09/nao-facas-select-asterisco/</guid><description>Always try to select only the fields you’ll need. Selecting others is a waste of resources. Exception made for the use of FM *_SINGLE_READ because, even though these do select all fields, since they cache the data, they are still faster when used multiple times for the same key. If you just want to check if a record exists, select just one field, if possible the one you’re using as criteria to avoid declaring an extra variable.</description></item><item><title>Thou shalt use FIELD-SYMBOLs instead of working areas</title><link>https://abapinho.com/en/2014/07/usaras-field-symbols-em-vez-de-variaveis-de-estrutura/</link><pubDate>Thu, 24 Jul 2014 09:00:50 +0000</pubDate><guid>https://abapinho.com/en/2014/07/usaras-field-symbols-em-vez-de-variaveis-de-estrutura/</guid><description>READ TABLE itbl ASSIGNING is always faster than READ TABLE itbl INTO wa. Besides, when making changes to internal tables, not only it doesn’t require the explicit MODIFY but it also does away with the auxiliary TABIX variable. The only situation in which a working area is better is when adding new lines to an internal table. Some people contend that working areas should still be used when no changes are to be made to the data.</description></item><item><title>SELECT within SELECT</title><link>https://abapinho.com/en/2014/05/select-dentro-de-select/</link><pubDate>Mon, 26 May 2014 09:00:03 +0000</pubDate><guid>https://abapinho.com/en/2014/05/select-dentro-de-select/</guid><description>&lt;p>ABAP programmers don&amp;rsquo;t explore the possibilities of SQL, probably for historical reasons. There are many who instead of using INNER JOINs still think it&amp;rsquo;s faster to do several SELECTs for internal tables and then process the data in ABAP. But the truth is that even if there are exceptions, the rule is: the lower the number of accesses to the database, the better the performance. And it makes sense because, after all, they were written explicitly for this; relational databases are much more adept at processing relational data than an ABAP program.&lt;/p>
&lt;p>There are of course things that, due to their complexity, cannot be done with a simple INNER JOIN. Nevertheless, some of these things can be done in a single SELECT.&lt;/p></description></item><item><title>With many fields avoid INTO CORRESPONDING FIELDS</title><link>https://abapinho.com/en/2013/06/into-corresponding-fields/</link><pubDate>Mon, 10 Jun 2013 09:00:27 +0000</pubDate><guid>https://abapinho.com/en/2013/06/into-corresponding-fields/</guid><description>&lt;p>I have already advised here that, in tables with many fields, it’s always recommended to avoid using SELECT *, you must always select, explicitly, only the necessary fields.&lt;/p>
&lt;p>But I didn’t warn you that there’s yet another optimisation worth making: avoid INTO CORRESPONDING FIELDS OF TABLE.&lt;/p></description></item><item><title>SORTED instead of STANDARD in the cache tables</title><link>https://abapinho.com/en/2013/04/sorted-em-vez-de-standard/</link><pubDate>Mon, 01 Apr 2013 16:11:22 +0000</pubDate><guid>https://abapinho.com/en/2013/04/sorted-em-vez-de-standard/</guid><description>Some time ago I wrote a post here showing the advantages of using internal tables with defined indexes instead of simple STANDARD tables.
Confession: that habit is so ingrained that since then, almost all the internal tables I have created have continued to be STANDARD TABLE.
It’s very common to create internal tables to cache data that I know I&amp;rsquo;ll often use inside LOOPS to avoid having to SELECT SINGLES inside them.</description></item><item><title>Partial Analyses in SE30</title><link>https://abapinho.com/en/2011/11/se30-parciais/</link><pubDate>Mon, 28 Nov 2011 11:37:25 +0000</pubDate><guid>https://abapinho.com/en/2011/11/se30-parciais/</guid><description>Obviously you already know the SE30 transaction (run time analysis) and obviously you use it often to analyse standard programs and to discover tables, functions, BADIs and similar contained within them.
But if you are like me, then you have a love-hate relationship with this transaction – on the one hand you love it because it enables you to see the guts of a program without having to debug it, yet on the other hand you hate it because normally the list of guts tends to have thousands of lines and becomes unmanageable.</description></item><item><title>LOOP ASSIGNING instead of LOOP INTO</title><link>https://abapinho.com/en/2011/07/assigning-vs-into/</link><pubDate>Sat, 02 Jul 2011 12:25:03 +0000</pubDate><guid>https://abapinho.com/en/2011/07/assigning-vs-into/</guid><description>&lt;p>In the beginning there was INTO.
Actually, in the beginning it was not even INTO.&lt;/p></description></item><item><title>Taking a nap</title><link>https://abapinho.com/en/2011/06/soneca/</link><pubDate>Fri, 17 Jun 2011 11:43:28 +0000</pubDate><guid>https://abapinho.com/en/2011/06/soneca/</guid><description>Whatever the case, it is necessary to put a program to sleep. And, as with almost everything else, there are several ways to do this, some better than others.
The most standard way to do this in ABAP is as follows:
WAIT UP TO 10 SECONDS. The advantage of WAIT UP TO N SECONDS is that the process is freed up during these 10 seconds, thereby making it available for those who want it.</description></item><item><title>On your marks, get set, go!</title><link>https://abapinho.com/en/2011/05/corrida-de-tabelas/</link><pubDate>Tue, 24 May 2011 09:00:41 +0000</pubDate><guid>https://abapinho.com/en/2011/05/corrida-de-tabelas/</guid><description>&lt;p>Ladies and gentlemen, boys and girls, the race is about to begin.&lt;/p>
&lt;p>&lt;strong>Introduction&lt;/strong>&lt;/p>
&lt;p>The four competitors are as follows. They are 4 internal tables, of different races and creeds, which will fight for the athletics title of speed LOOP. Here they are:&lt;/p>
&lt;p>Competitor 1: DATA: LT_ITEM TYPE TABLE
Competitor 2: DATA: LT_ITEM_HASHED TYPE HASHED TABLE
Competitor 3: DATA: LT_ITEM_SORTED TYPE SORTED TABLE
Competitor 4: DATA: LT_ITEM TYPE TABLE + INTO INDEX&lt;/p></description></item><item><title>LOOP FROM INDEX</title><link>https://abapinho.com/en/2011/03/loop-from-index/</link><pubDate>Thu, 10 Mar 2011 12:15:12 +0000</pubDate><guid>https://abapinho.com/en/2011/03/loop-from-index/</guid><description>It’s very easy to get tied up in knots where performance is concerned when you’re working with internal tables – especially when they’re getting really big. In fact these problems often only arise after a few months, when the tables tend to grow as time goes by.
For example, when you’re looping two tables, one of headers and another of entries, do you do this?
LOOP AT itab1 ASSIGNING &amp;lt;fs1&amp;gt;. LOOP AT itab2 ASSGNING &amp;lt;fs2&amp;gt; WHERE field1 = &amp;lt;fs1&amp;gt;-field1.</description></item><item><title>SAT – The new execution analysis tool</title><link>https://abapinho.com/en/2011/02/sat/</link><pubDate>Wed, 16 Feb 2011 14:31:40 +0000</pubDate><guid>https://abapinho.com/en/2011/02/sat/</guid><description>Since I was small I have been using the SE30 transaction for two different things:
To analyze a (normally standard) program I don’t know in order to find out what functions it uses, what BADIs it offers, etc;
To analyze a program of mine to search for performance problems.
The simple truth is that the SE30 transaction is a total mess. It’s extremely limited and inflexible and it’s useless for any more complex analysis.</description></item><item><title>&lt;!--:pt-->Macros - Velocidade de ponta&lt;!--:--></title><link>https://abapinho.com/en/2009/09/macros-velocidade-de-ponta/</link><pubDate>Wed, 16 Sep 2009 02:37:52 +0000</pubDate><guid>https://abapinho.com/en/2009/09/macros-velocidade-de-ponta/</guid><description>&lt;p>Normalmente quando há um pedaço de código que pretendemos reutilizar várias vezes, transformamo-lo numa sub-rotina que pode depois ser invocada repetidamente. Embora a SAP não saiba estruturar o seu próprio código, ainda assim, o ABAP, coitadinho, permite-o. E até disponibiliza várias alternativas para modularizar o código. Eu conto quatro alternativas que listo aqui, da mais rígida para a mais flácida: METHOD, FUNCTION, FORM, DEFINE. Se os 3 primeiros são já familiar de todos, o último - DEFINE - quase ninguém usa. O DEFINE permite definir macros em ABAP. E o que são macros? São sub-rotinas aparentes.&lt;/p>
&lt;p>Aparentes porquê?&lt;/p></description></item><item><title>&lt;!--:pt-->READ TABLE blablabla TRANSPORTING NO FIELDS&lt;!--:--></title><link>https://abapinho.com/en/2009/08/transporting-no-fields/</link><pubDate>Thu, 20 Aug 2009 04:51:19 +0000</pubDate><guid>https://abapinho.com/en/2009/08/transporting-no-fields/</guid><description>Por vezes ao fazer READ TABLE a uma tabela interna queremos apenas verificar se um determinado registo existe, e não nos preocupamos com os dados retornados. Algo tipo:
READ TABLE lt_kna1 INTO wa_kna1 WITH KEY kunnr = l_kunnr. CHECK SY-SUBRC = 0. Ora já que a estrutura WA_KNA1 não vai ser necessária de qualquer forma, mais vale não a usar, usando antes a opção TRANSPORTING NO FIELDS:
READ TABLE lt_kna1 TRANSPORTING NO FIELDS WITH KEY kunnr = l_kunnr.</description></item></channel></rss>