"
Categoria > Articles
Supported by

INSERT wa INTO itbl REFERENCE INTO ref. Bug?

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.

Ler o resto do artigo! »

We should be accountable for the crap we make

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.

Ler o resto do artigo! »

ABAP Code PushDown in HANA

[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).

Ler o resto do artigo! »

GROUP BY in LOOPs on internal tables

We’ve all sorted internal tables to use AT NEW on a LOOP.
But starting from 7.40, we can use GROUP BY on LOOPs.

The ability to group by values based on expressions or even methods is great.

The grouping is done on the first LOOP and can be processed afterwards. Try running the code below and I bet you’ll be as impressed as I was.

Ler o resto do artigo! »

Can you really do it right the first time?

Checkpoints is a very powerful ABAP framework which almost nobody uses. Why? Probably for the same reason hardly anyone listens to Sun Ra and knows that Frank Zappa has 102 albums. Because, even though really good, it’s obscure and not commercial. Checkpoints are, indeed, really good and not commercial. But they should be more like Mozart and the Beach Boys which are both good and commercial.

Ler o resto do artigo! »

STA Ticket System improve SAP incident handling times

Today we have a guest, Tamás Holics. He owns STA Consulting, a Hungarian company which has created 2 very interesting SAP products. In this article Tamás presents the STA Ticket System.

The problem

A lot of time is wasted in SAP software testing and maintenance processes due to incomplete or incorrect error reports from users and testers. Support people (analysts, developers) usually have to ask for more information about the error. This takes a lot of valuable working time from both the reporters of the error and support people. Solving the problem is often blocked until every information is available.

Ler o resto do artigo! »

The rot is noble after all

For many years I’ve been complaining about how backward ABAP development ecosystem is and how long it takes to evolve. Every time he heard me saying it a good friend of mine would wisely advise me to never bite the hand that feeds you.

But how can a man not speak out?

Ler o resto do artigo! »

Software design patterns in ABAP

We are constantly learning. But once in a while we learn something which is a leap forward forcing us to look in a new way to everything we do.

The last time this had happened was when I started using OO in ABAP. OO was not new to me as I had already used it extensively in Java, C#, C++, etc. But to finally be able to apply these precious concepts on my daily job was a relief and a big improvement in the quality, flexibility and speed of my work.

I feel now in the middle of a new leap forward. Because I’m finally learning how to use software design patterns. I’ve always heard about them but never gave them much though. For example, the ABAP site ZEVOLVING already talked about them a long time ago and I remember having read many of these articles. But somehow I still hadn’t found a text which not only explains them but also makes their advantages clear.

Now, thanks to Miguel Jorge, I have found one:: Head First Design Patterns. Besides being funny, it explains in a clear and simple way, the limitations of OO paradigms and how patterns can help overcome them.

This site has links to several interesting texts on this subject. It even has a link to a PDF version of the aforementioned book. And also to this page which lists them and even criticizes them.

From now on, whenever I’m designing software in OO I’ll always try to be aware of the available patterns and try to apply them whenever appropriate.

Thank you Miguel Jorge!

Greetings from Abapinho.

Internal table secondary indexes

This is how internal tables used to be declared:


DATA: itbl TYPE TABLE OF bkpf.

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! »

In ABAP’s name, I baptize you

When we learn ABAP, we are taught a series of rules on how to name variables. Not everyone uses the same rules but, still, some strict rules are shared between many people:

  • Local variables must start with L: L_BUKRS;
  • Global variables must start with G: G_MODE;
  • Internal tables must have T_: LT_MARA;
  • Structures must have S_: LS_MARA;
  • Object references must have R_: R_CUSTOMER;
  • input parameters must start with I, output with O, changing with C and returning with R.
  • And the most stupid of all, field-symbols must start with FS_: <FS_MARA>.

In the early XXI century those rules made some sense (except for the field-symbols on, which was, and still is, as stupid as writing ‘pencil’ in all our pencils). Today they don’t make much sense anymore. Let me explain.

Ler o resto do artigo! »

DELETE vs CLEAR vs REFRESH vs FREE

DELETE
CLEAR
REFRESH
FREE

These are different ways of deleting all data from an internal table. They look the same. But they aren’t.

Ler o resto do artigo! »

Converting an exception into an exception

If you’re still not using exception classes, then you’re making a mistake. Cause they are very healthy for your code. They’re not only good nutrients for the system, they also make it lean and less vulnerable to diseases.

There are cases where you still need to deal with the old exceptions. For example, when a function module is invoked.

In this article I am presenting a suggestion that seems a little complex, but it works very well if you need to integrate the old exceptions with exception class in a simple way. And though it is sophisticated, you only need to do it once. Once it’s done, it’s easy to use.

Ler o resto do artigo! »

Teach ABAP to juggle

What can be done when a night is not enough to complete the daily processes?

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! »


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