"
Etiqueta > secret
Supported by

APPEND STRUCTURES do more stuff than I thought

During all my ABAPian life I was convinced that APPEND STRUCTURES had one single purpose: to add new extra fields to an existing standard table.

But I recently learned that they let you do two more things after all:

Ler o resto do artigo! »

I call you and you call me

You you call a function via RFC you need to provide the RFC DESTINATION for the remote system:


CALL FUNCTION ‘ZSNEEZED’
  DESTINATION ’sistema_longe_daqui’.

What if, for some reason, the function running in the remote system needs to call a function in the original system? How would you do it?

Ler o resto do artigo! »

Add parameters to standard methods and functions

We are all aware of SAP implicit enhancements which allow you to add code to the top or bottom of any block of standard code (methods, functions, etc). We’ve all used it to make a change to a BAPI or other standard piece of code.

But only recently did I find that you can also use these implicit enhancements to add parameters to standard methods and functions.

Ler o resto do artigo! »

Program the program programming

One of the few things that separates us humans from all the other animals is our ability to think about thoughts.

A sparrow may think “I’m scared, I’ll say chirp chirp chirp” and, as a direct consequence, whoever stands close to it will hear “chirp chirp chirp”.

Ler o resto do artigo! »

SAP can take selfies!

I just found out that SAP can take selfies. I still don’t see why one would need it. But that’s understandable because I never really understood the need for selfies anyway.

Here’s how SAP can take a selfie:

Ler o resto do artigo! »

Limitar execução em background ou foreground

You’ve developed a report which you know will take over 12 hours to run. So you don’t want anyone to try to run it in foreground. I’ll show you a way to make sure it doesn’t happen.

Ler o resto do artigo! »

How to sabotage standard texts

Some times I don’t like the names SAP gave to things. So I change them.

For example, one day I was very angry and thought all customers were parasites.

So I did the following:

Ler o resto do artigo! »

How to avoid timeout when running a program

Usually SAP systems have a predefined time limit for running a program interactively. If the program takes longer to run than that you’ll get a runtime execution error. A dump.

Ler o resto do artigo! »

SE16H – Aggregate data without using Excel

A long time ago transaction SE17 was used to look at database tables content.
They quickly felt ashamed and decided to improve it, creating SE16.
When ALV was invented, SE16N was released (although until today many people still use SE16, go figure!).

Today I present you SE16H.

Ler o resto do artigo! »

Multiple OR selections in SE16N

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?

Ler o resto do artigo! »

(Português) CALL FUNCTION com DESTINATION ‘NONE’ cria nova LUW

Sorry, this entry is only available in European Portuguese. For the sake of viewer convenience, the content is shown below in the alternative language. You may click the link to switch the active language.

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.

Há um exemplo disto na nota OSS 770626.

Obrigado Artur Moreira pela dica.

Quanto à foto, decidi que os dentes do Elvis são uma boa forma de representar LUWs.

O Abapinho saúda-vos.

(Português) Debug de um job

Sorry, this entry is only available in European Portuguese. For the sake of viewer convenience, the content is shown below in the alternative language. You may click the link to switch the active language.

Para fazeres debug a um programa que faça parte de um job faz o seguinte:

Ler o resto do artigo! »

Stop the functions module’s error messages

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.
 
Ler o resto do artigo! »

Text search in a WebDynpro

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:

Ler o resto do artigo! »

How many includes is a class made of?

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.
Ler o resto do artigo! »


About Abapinho
Abapinho runs on WordPress
Articles (RSS) e Comments (RSS).