Tag > segredo
Supported by
Supported by Inetum

Multiple OR selections in SE16N

images/thumbnail.jpg - Thumbnail

If you are one of those persons who still uses SE16, this article is not for you. If you keep reading, you might find yet another reason to finally start using SE16N (as if all others were not enough already).

Imagine that you want to select all materials whose name contains “PREGO” and whose type is “FERRAGENS”, and all materials whose name contains “GUARDANAPO” and whose type is “COMIDA”. In other words, “PREGO_NO_PAO” or “GUARDANAPO_PAPEL” won’t be part of the result set. What you want is this:

(MATNR = “PREGO%” AND MTART = “FERR” ) OR (MATNR = “GUARDANAPO%” AND MAKT = “COMI” )

As you know, using SE16N in a regular way (which doesn’t use what I’m about to show you) you would need to execute it twice and manually compare data, because the selection screen does not allow you to make multiple OR selections.

Or does it?

[: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:

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:

How many includes is a class made of?

images/thumbnail.jpg - Thumbnail

No matter how many times things go around in ABAP, everything ends up in SE38. Even the methods of the ABAP classes are saved in includes.

Sometimes, when there is a dump, it says the problem is, for example, here: CL_MESSAGE_HELPER=============CM001.

Unreleasing a released transport order

images/thumbnail.jpg - Thumbnail

You’ve released a transport order because you thought everything was ready. However, one more minor modification was still missing. So now you will have to create a new order and transport both of them. What a drag.

Don’t worry.

Write in multiple lines at the same time

images/thumbnail.jpg - Thumbnail

The ABAP editor has many curious functionalities. You can even write in multiple lines at the same time.

Mathematics problem

images/thumbnail.jpg - Thumbnail

Do you know the difference between a mystery and an enigma puzzle? An enigma puzzle is known to have a solution, but with a mystery you don’t know if there is solution.

Do you agree with this? 5 * 3 / 10 = ( 5 * 3 ) / 10 = 5 * ( 3 / 10 ) = 1.5

If you don’t, you should agree because it is a mathematical fact.

Now let’s do some experiments.

SELECT comparing 2 fields of the same table

images/thumbnail.jpg - Thumbnail

This tip is simple and quick, but I bet 200.482 Portuguese escudos that few know it.

Steal data from a SALV

images/thumbnail.jpg - Thumbnail

A friend of a friend of a friend said that a friend of his knew a friend who explained to him in a shady club bar in the docks area of Lisbon how to steal data from a SALV.

/HS Command

images/thumbnail.jpg - Thumbnail

Most functionals, and even the hardcore functionals, knows that in order to start debugging an ABAP program, we use the /H command. But few programmers, even the hardcode programmers, will know the purpose of the /HS command.

Jump The Wall

images/thumbnail.jpg - Thumbnail

Turn down the music. Close the door. Look around. Is anyone looking at you? Are you being watched? Are there any security cameras? If not, we can go on.

Complex parameters in remote functions

images/thumbnail.jpg - Thumbnail

Remote function calls (by RFC) do not support parameters with complex structures (deep structures). In other words, if any of the parameters has a structure in which one of the fields is another structure or an internal table then, hard luck, it won’t work.

Do you give up? No, you don’t. Abapinho provides the solution: serialization.

Oh time turn back

images/thumbnail.jpg - Thumbnail

“Oh time turn back Give me everything I have lost Take pity and give me the life The life I have already lived Oh time turn backward Kill off my futile hopes Look how even the sun itself Returns every morning” – António Mourão

Hey Tony, right away. I will show you how you can turn back time.