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.

How to sabotage tables

images/thumbnail.jpg - Thumbnail

Another article to help those who are into sneaky subversion Spies, take note on how to edit a table that cannot be (and probably shouldn’t be) edited. I’ll show you three techniques. The first stopped being useful a few years ago, the second is about to become obsolete and the third, well, we’ll just have to see for how long it will work.

1. SE16 /H OK_CODE EDIT The first technique dates back to the twentieth century and uses the old transaction SE16.

When an internal table is not structured

images/thumbnail.jpg - Thumbnail

When you want to select some lines in an internal table you normally do something like this:

DATA: BEGIN OF itbl,
            campo1 TYPE c,
            campo2 TYPE c,
          END OF itbl.

READ TABLE itbl WITH KEY campo1 = 'X' campo2 = 'Y'.

LOOP AT itbl WHERE campo1 = 'X' and campo2 = 'Y'.
  COISO.
ENDLOOP.

But what if the table is not structured and you want to search on the line as a whole? Well in this case here’s a tip. Use the special word TABLE_LINE :

DATA: itbl TYPE STANDARD TABLE OF string,
            wa LIKE LINE OF itbl.

READ TABLE itbl WITH KEY table_line = 'X'.

LOOP AT itbl INTO wa WHERE table_line = 'X'.
  COISO.
ENDLOOP.

(Thanks to Aaron Escobar for the photo.)

Create test variants within functions from the debugger

images/thumbnail.jpg - Thumbnail

Imagine that you are debugging a transaction, you enter into a function and find something interesting. So interesting that you have to debug it several times. The conventional way is to start the debug of the transaction again from the beginning. How tedious.

But there is a more direct route. When you are debugging a function you can create test data for this function directly from the debugger, using the values with which the function had been called at that time. For instance: