Category > Articles
Supported by
Supported by Inetum

Abapinho Dev Tools: Dependencies

images/thumbnail.jpg - Thumbnail

Nuno Morais developed a very useful tool which can compare objects between systems and works much better than transaction SREPO. Abapinho will be its official repository. Code in GitHub. Soon, an instruction manual. Until then, go on and try it. If you like it or have any suggestion please leave a comment here. Thank you Nuno for having developed this and for sharing it with the world in Abapinho. Greetings from Abapinho.

DELETE vs CLEAR vs REFRESH vs FREE

images/thumbnail.jpg - Thumbnail

DELETE CLEAR REFRESH FREE

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

Converting an exception into an exception

images/thumbnail.jpg - Thumbnail

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.

Teach ABAP to juggle

images/thumbnail.jpg - Thumbnail

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

Text search in a WebDynpro

images/thumbnail.jpg - Thumbnail

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:

Chained exceptions

images/thumbnail.jpg - Thumbnail

Today I will teach you how to chain exceptions. It’s a very practical solution to a complicated, not so obvious problem. Let’s start by describing the problem. Imagine you are in the application BANANA. The application is quite complex. It has three modules: BANANA1, BANANA2 and BANANA3. Each one has its exception class ZCX_BANANA1, ZCX_BANANA2 and ZCX_BANANA3. Since the application is in fact well designed, all the exception classes inherit from the same ZCX_BANANA.

Communication by event between programmes

images/thumbnail.jpg - Thumbnail

In Greek mythology, the gods’ most commonly used means of communication with mortals was rape. They would rape for no reason whatsoever.

The closest thing we have to rape in ABAP is the command “SUBMIT”, which is also the most common way of communicating between two programmes.

Packages 2.0

images/thumbnail.jpg - Thumbnail

SAP R/3 repository is a wonderful thing. A vast warehouse of data elements, structures, tables and much more, readily available to one and all. As developers, it is extremely convenient to quickly pick these elements and pull them into our programs as necessity conveys, while our string of thought remains virtually uninterrupted. Well, not all is sunshine and roses. If you are not careful with the mushrooms you pick you might get a poisoned one.

Request Based Debugging

images/thumbnail.jpg - Thumbnail

If you look up the UNAME system variable in debug within a RFC call you may think it kind of odd to find a username that is not your own. What happens is that the system adopts a specific username for remote calls and a new session is started. A new session implies a new execution context and, hence, all our strategically placed breakpoints will no longer be recognised.

This problem can hinder a simple debug forcing us to run through the code looking for THAT remote call to THAT particular system.

SAP has a solution.

The ABAP detective

images/thumbnail.jpg - Thumbnail

When a development is completed in SAP, the time to send it to other systems where it can be duly tested and then executed by users has finally arrived. Before that occurs, however, it has to be checked for lapses, errors and other problems that could lead to our programmes behaving in an unpredictable manner. There is a very useful tool that allows some of these errors and gaps to be filtered out. It is called ABAP Code Inspector.

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.

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.

Have you used regular expressions before?

images/thumbnail.jpg - Thumbnail

Regularly expressions have been around for ages. But they’re not very well known and even less used. They are a sort of descriptive language that allows for making research and very sophisticated replacements in alpha-numeric chains. A simple example: to validate an email address. If you have to do this through an algorithm you’ll have to work hard. However, with regular expressions, only two or three code lines and the regular expression "\b[A-Z0-9.

Read code from the web and execute it

images/thumbnail.jpg - Thumbnail

This is a 2-in-1 article. That is to say, you’ll learn two subjects at once.

But get ready, what you’ll learn is dynamite, and, in the wrong hands, it can implode your universe.

First, you’ll learn how to read content on the web. And right after that, assuming that this content is ABAP code, you’ll learn how to execute it in the blink of an eye.

With many fields avoid INTO CORRESPONDING FIELDS

images/thumbnail.jpg - Thumbnail

I have already advised here that, in tables with many fields, it’s always recommended to avoid using SELECT *, you must always select, explicitly, only the necessary fields.

But I didn’t warn you that there’s yet another optimisation worth making: avoid INTO CORRESPONDING FIELDS OF TABLE.