Supported by
Supported by Inetum

DDIC structure key

images/thumbnail.jpg - Thumbnail

Today when I want to create a SALV I always create a DDIC structure with the data elements already set to show the texts I need. This avoids the need for code to manipulate the field catalog.

Find everything at once

images/thumbnail.jpg - Thumbnail

The ABAP editor is full of functionalities yet to be discovered.

When I do CTRL-F to search for text, the option I usually choose is “Find next”.

APPEND STRUCTURES do more stuff than I thought

images/thumbnail.jpg - Thumbnail

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:

INSERT wa INTO itbl REFERENCE INTO ref. Bug?

images/thumbnail.jpg - Thumbnail

Every day I use more reference variables in ABAP. First I used REF TO just for classes but, as I become more familiarized with its advantages, I start using them more and more for data structures, instead of field-symbols.

But I recently found na unfortunate behavior of the following command:

INSERT wa INTO itbl REFERENCE INTO ref.

Let me give you some context before I complain about it.

We should be accountable for the crap we make

images/thumbnail.jpg - Thumbnail

If, when building a bridge, a civil engineer makes a mistake in one of the calculations, the bridge falls. But the bridge won’t fall alone. Most probably that engineer will also fall with it. He is accountable for what he did because he must sign his projects.

ABAP programmers don’t have that kind of problems.

Search form methods, attributes, types, events, etc

You remember having written a method some years ago which you need now. You know it had the word MALMEQUER somewhere in its name. But what now? How will you find it? You could use transaction SE24 to look at every class you worked on since then. But that would probably keep you busy for ages. Don’t do that. Try using transaction SE84 instead:

Yet another way to see a method's parameters

images/thumbnail.jpg - Thumbnail

Let’s say you want to call a method for which you don’t know the parameters. What do you do?

You used to have to use the “pattern” button. Or open the class in a new window to look at the method’s parameters. But then the ABAP Editor evolved and we got auto-complete which made everything much more easy.

But there is yet another way.

ABAP Code PushDown in HANA

images/thumbnail.jpg - Thumbnail

[Guest post by Artur Moreira]

From ABAP version 7.4, SAP introduced the code pushdown concept, which means using more database for calculations (data aggregation, sums and previous calculations).

Incremental search

images/thumbnail.jpg - Thumbnail

When I want to search for a word in an ABAP program I usually press CTRL-F to use the normal search feature of the ABAP editor. I enter the word I want to find and then press “NEXT” to look for it.

But there is another way. And it’s not better nor worse. Just different: the incremental search.

Pass internal tables by value is good

images/thumbnail.jpg - Thumbnail

When a method returns a value as a RETURNING parameter this is always done by value and not by reference. Several of my methods return internal tables, some of them quite large. It always worried me the idea that, since it’s being passed by value, ABAP would be returning a copy of the internal table, impacting both performance and the program’s used memory.

Fortunately, I recently learned that this is not​ a problem.

INSERT dbtab ACCEPTING DUPLICATE KEYS

images/thumbnail.jpg - Thumbnail

When you try to insert a record with a key which already exists in the table the program dumps. This, in some cases, is not desirable because, even if you don’t care, it forces you to check if the keys already exist before trying to insert then. But ABAP has a solution for these situations: INSERT dbtab FROM TABLE itab [ACCEPTING DUPLICATE KEYS]. Don’t worry because this will not violate the first law of thermodynamics: the duplicate records are not inserted.

Export and import the ABAP Workbench settings

images/thumbnail.jpg - Thumbnail

Sometimes a thing is right under your nose and your still don’t see it.

At my current client I daily work with a lot of different systems. When I make a change in a setting of one system, either because I’m lazy or because I forget, I end up not applying it to all the others.

But there is a simple way to copy all the ABAP Workbench settings at once from one system to the other.

Use the Split Screen Editor in the version comparison

images/thumbnail.jpg - Thumbnail

By default, the ABAP version comparison tool is horrible. It displays both versions in a single column and, even though the differences are highlighted, it’s awfully confusing. But it doesn’t have to be this way. Press the “settings” button at the top and you’ll find that there are 3 different display modes (besides some other nice options): one-column, two-columns and, surprise, the Split Screen Editor. This is probably the option you’ll want to choose since it’s the most powerful.

Spot the differences with SE39

images/thumbnail.jpg - Thumbnail

Earlier today I was doing a QC review to a new program named ZSDFAKSPE with almost 1000 lines and no comment whatsoever. An obvious clone of a standard program called SDFAKSPE.

So I decided to use the Spli-screen editor, found in transaction SE39. Having entered both programs I could then compare them side-by-side.

Source-code based class development

images/thumbnail.jpg - Thumbnail

Being used to develop in Java and C++, the way transaction SE24 forces you to navigate between each of its parts and the fact that every method has its own include was very confusing to me when I first started using it. Why does SAP always have to make things so complicated? I eventually got used to it. At some point in time SE24 introduced the option source-code based which shows the class and all its methods in a single text.