Category > Tips & tricks
Supported by
Supported by Inetum

Shortcut for time travelling

images/thumbnail.jpg - Thumbnail

Some months ago I showed how to transform the debugger into a time machine. Today’s tip is simple but useful: there is a keyboard shortcut which makes it even simple to travel in time: shift + F12 Just place the cursor in the line you want to travel to and then… shift+F12. Thank you Maxsuel Maia for the tip. Greetings from Abapinho.

Use a password manager in your life

images/thumbnail.jpg - Thumbnail

And there you go, if you read the title you know the hint.

Now, here are some hints about the hint:

Close the frozen window

images/thumbnail.jpg - Thumbnail

How many times have you been left with a “hanging” window when you end a debug?

Exemplary example of SALV

images/thumbnail.jpg - Thumbnail

Unless you want to do data editing, the only dignified way to use ALVs these days is through SALV classes. They are more modern and more elegant, and those who use them can achieve a social status until now only available to owners of a license plate.

Hold on… but not yet

images/thumbnail.jpg - Thumbnail

You are doing a LOOP AT in a 1000-line table, and you know that you want line 853. Until recently, you had two options: either hit F8 852 times, running the risk of hitting it 853 times and having to start all over again, or create a watchpoint with the condition SY-TABIX = 852 or something close, and pray that it worked.

Now you have a third option.

APPEND LINES OF class->method() TO itbl

images/thumbnail.jpg - Thumbnail

ABAP is getting smarter all the time. Back in my day, no one did anything with it. And now, slowly, more than a fifth of a century late, it’s trying to imitate C and Java, and becoming more flexible.

I was going to do something like this:

Automatic keyboard

images/thumbnail.jpg - Thumbnail

Every programmer knows about the intimate relationship between batch-inputs and paperweights, staplers and similar heavy objects. These precious little helpers can keep us from spending up to eight hours hitting the “ENTER” key with one finger.

Although these objects have a certain charm, the law of gravity - the same one that makes them useful - sometimes makes them fall over and stop pushing this key.

Adding values to a standard domain

images/thumbnail.jpg - Thumbnail

If you think it’s impossible to add values to a standard SAP domain without requesting an activation key, you’re wrong.

Always use message classes in exception classes.

images/thumbnail.jpg - Thumbnail

Exception classes let you state multiple texts describing the different possible errors that they can represent.

However, there exists an option to associate it with a message class (SE91). This allows texts to be defined as classic SE91 messages instead of being defined directly in the exception class. And it has advantages.

The ABAP editor has a good memory

images/thumbnail.jpg - Thumbnail

Select a word in the ABAP editor and choose CTRL-C. Then select another word and choose CTRL-C again. Then another word and so on. You have copied words several times to the clipboard. Experience and common sense tells us that if you choose CTRL-V you can only paste the last word you copied to the clipboard. But that is not quite right. You may not be aware of it, but the ABAP editor has a good memory.

Compare a table across two systems

images/thumbnail.jpg - Thumbnail

The SCMP transaction compares the content of a table across two systems. It is very useful, especially for parameterization tables. It is very easy to use. It allows for the pre-selection of the registers and fields to compare. It also allows you to only display the differences, which is convenient for tables with lots of data. I don’t think any more explaining is required. Ite et videte. This tip recently appeared in the ex SAPtricks blog and I think it is so useful that I have reposted it here, in case you haven’t already seen it.

SELECT... ...ORDER BY PRIMARY KEY

images/thumbnail.jpg - Thumbnail

Although I have been using ABAP since 1998, I learn new features or options every week, and sometimes even new commands. It’s hard to believe. Today, I’ll share a little SQL option that I recently discovered. SELECT * FROM T001 INTO TABLE T_T001 ORDER BY PRIMARY KEY. I have known SELECT, FROM, INTO, TABLE and even ORDER BY for a long time. I just didn’t know of PRIMARY KEY. It orders the internal table by its key.

Function to create cartoons

images/thumbnail.jpg - Thumbnail

Cartoons always look good in a report. In a SAPGui that is boredom in blue, the more colours and cartoons there are the better it is. Luís Rocha showed me a very convenient function to fill up a report with icons.

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.

Syntax error when returning tables of a method

images/thumbnail.jpg - Thumbnail

When you create a return parameter in a method of a class that is a TABLE TYPE based on a type declared in the class proper, an error sometimes pops up that says:

“Type of RETURNING parameters must be fully specified.”