Supported by
Supported by Inetum

Search for notes directly in Google Chrome

images/thumbnail.jpg - Thumbnail
Google Chrome has an app for searching SAP notes. It’s called SAP Notes finder. You can install it here. Thank you Fernanda Mirabile and Talita Polanczyk for the tip. Greetings from Abapinho.

Consider converting WRITE reports into ALVs

images/thumbnail.jpg - Thumbnail
Reports still writing directly to the screen are very hard to maintain whenever changes to the layout are required. On such occasions, review the code and, if the effort involved is not too big, consider converting it to ALV. Always involve the functional people in this decision.

[:pt]Curso online grátis de depuração[:]

images/thumbnail.jpg - Thumbnail
[:pt]O Pedro Lima (responsável pelo OnSAP) fez um curso online grátis a ensinar os rudimentos da depuração em ABAP. Espreitem pois está bem feito e porque estas iniciativas merecem todo o nosso apoio. Tenho a certeza de que o Pedro fará mais cursos se vir que há público interessado. Aqui Nota: o curso é em inglês. O Abapinho saúda-vos [:]

No more english translations

images/thumbnail.jpg - Thumbnail
Sadly, Abapinho will not be able to continue posting the English translation of the Portuguese posts. I am sorry to all the readers who don’t speak Portuguese. Abapinho’s main goal has always been to publish ABAP content written in Portuguese. But the possibility of also publishing them in English was a great asset because it allowed us to reach a much wider audience. We were able to do it for several years because the translations were sponsored.

[:pt]CALL FUNCTION com DESTINATION ‘NONE' cria nova LUW[:]

images/thumbnail.jpg - Thumbnail
[:pt]Sabias que quando invocas uma função com a opção DESTINATION ‘NONE’ estás a iniciar uma nova LUW? Isto pode parecer apenas uma curiosidade, mas há um caso em que pode fazer toda a diferença: sabes aqueles módulos de função que ao serem chamados uma segunda vez têm um comportamento diferente da primeira vez? Isto acontece porque eles hão-de ter alterado alguma variável global ao grupo de funções. Ora se iniciares uma nova LUW quando chamares a função, o seu grupo de funções é automaticamente inicializado e assim garantes que o comportamento da função é o esperado.

[:pt]Debug de um job[:]

images/thumbnail.jpg - Thumbnail
[:pt]Para fazeres debug a um programa que faça parte de um job faz o seguinte:

Converting an exception into an exception

images/thumbnail.jpg - Thumbnail
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. There are cases where you still need to deal with the old exceptions. For example, when a function module is invoked. 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’s done, it’s easy to use.

[:pt]Novo livro "UI5 para desenvolvedores SAP/ABAP"[:]

images/thumbnail.jpg - Thumbnail
[:pt]O Flávio Pagoti, do blog ABAP101 publicou um livro em português sobre SAPUI5/OPENUI5. Aqui está o artigo do ABAP101 a anunciar o livro. Lá encontras um link para o comprar. Custa $9,99. A minha principal motivação quando decidi criar o Abapinho foi exactamente combater a gritante falta de conteúdos técnicos de qualidade escritos em português. Hoje as coisas estão um pouco melhores, em particular no mundo do ABAP onde há vários blogs de óptima qualidade.

Teach ABAP to juggle

images/thumbnail.jpg - Thumbnail
What can be done when a night is not enough to complete the daily processes?

Thou shalt modularize, modularize, modularize

images/thumbnail.jpg - Thumbnail
Historically ABAP programs tend to grow very loooong. All programming best practices teach us there is not a single advantage in this approach. If any routine, be it a program, a method, a function or anything else, becomes longer than 200-300 lines, question it and seriously consider refactoring it into several sub-routines. This has the added advantage of potentially increasing code reuse. But the greatest advantage is encapsulation, isolating variables in their local context, instead of having all of them together, resulting in safer and more readable code.

Thou shalt reuse, thou shalt not rewrite

images/thumbnail.jpg - Thumbnail
If the same piece of code is repeated at least once, question yourself why and try to avoid it by creating a reusable routine. If there is more than one SELECT for the same table in a program, make sure you can’t merge them into a single one. Sometimes a smart use of RANGEs to unify parameters can avoid the need for multiple SELECTs. If the same code is used in 2 different programs, don’t repeat the code.

Thou shalt avoid global variables

images/thumbnail.jpg - Thumbnail
The more global variables a program has, the most obscure it becomes. Please avoid them. This is a basic rule of good programming and should always be followed. Even if several variables have to be passed by parameter, it takes slightly more effort but yields a much more readable and safer code. Exceptions can be made for simple reports which run around a single internal table, which can be declared globally without compromising clarity.

How to ask if the line exists without seeming fashioned

images/thumbnail.jpg - Thumbnail
Long ago, you used the expression “groovy, man”. Later came “great, man”. Then there was “cool”. Today you say “awesome”. It’s important not to get confused and not make a fool of yourself. And how do you ask an internal table if a line exists exists?

Stop the functions module's error messages

images/thumbnail.jpg - Thumbnail
There are standard functions that trigger messages where they shouldn’t. And they shouldn’t because we want to use these functions in non-interactive programs and then, instead of returning the error, an error message is triggered and ruins the whole process. However, being aware of this problem, SAP has provided a quite elegant (but not well documented) way of solving this problem.

Text search in a WebDynpro

images/thumbnail.jpg - Thumbnail
SAP doesn’t know how to do things right the first time. The WebDynpros are a good example of this. It doesn’t even let you do a text search. It’s sad. Fortunately Sérgio Fraga has found a way, though it’s rather laboured: