Tag > segredo
Supported by
Supported by Inetum

The RANGEs double negatives

images/thumbnail.jpg - Thumbnail
RANGEs have interesting properties.

Manually populate a LISTBOX

images/thumbnail.jpg - Thumbnail
In 2012 I wondered why LISTBOX is so rarely used. I taught how to use it with standard data elements, which automatically populate it. Today I’ll teach you how you can populate it yourself.

Change selection screen texts without hard coding them

images/thumbnail.jpg - Thumbnail
Even though many ABAP programmers tend to forget this, the less texts you hard code in your program the simpler it will be to translate it. Here’s a simple but rather obscure way to manipulate selection screen texts while still being able to translate then. This way you can, for example, prefix them with icons.

Use CL_GUI_ALV_GRID without having to create a screen

images/thumbnail.jpg - Thumbnail
Nowadays I rarely use CL_GUI_ALV_GRID because SALV is so much better. But when I am asked to make an editable ALV I still use it. Until very recently, I thought that, in order to use it, I needed a screen with a container. And because I’m using ABAP OO, I’d need a function group to host it and a function module to call it. Painful.

Magical shortcuts to menus

images/thumbnail.jpg - Thumbnail
If you, who are reading this, believe that everything written in Abapinho is literally true, what I’m about to tell you will be a disappointment: when I said magical I didn’t mean that it was supernatural. It is just a nicer way of saying it is surprising and unexpected. I took this liberty just as you’d say “I could kill for a glass of water” knowing that you would never do it. Having made this clear, let’s continue.

Shortcut to save list local file

images/thumbnail.jpg - Thumbnail
SAP is full of hidden corners rarely visited. Abapinho is happy to shed some light on them. The command %pc is equivalent to the menu option System/List/Save/Local file:

Implicit enhancements in data structures

images/thumbnail.jpg - Thumbnail
We have all used implicit enhancements to add code to the beginning or end of a standard function, form or method. But you may not know that it can also be used to add fields to data structures, whether they’re declared as TYPES or directly as DATA.

Save XML data in an ST (Simple Transformation)

images/thumbnail.jpg - Thumbnail
Some days ago I was using an ST (Simple Transformation) and thought that, even though its job is to convert an input into an output, it is can be used to store XML data. Let’s asy we have the following XML: <cocktails> <cocktail id="gt" nome="Gin Tonic"/> <cocktail id="ws" nome="Whiskey Sour"/> <cocktail id="cl" nome="Campari Laranja"/> </cocktails>

Inject ABAP commands into a productive system

images/thumbnail.jpg - Thumbnail
The view below shows how simple it is to create the conditions to inject ABAP commands into programs in a productive system. I considered whether to publish this. But, as it already happened in the past, I believe it is better for this to be known because it is very important for system administrators to be aware of this so they can protect their systems against this threat. Thank you Ricardo Monteiro for the tip.

Transport a local table with its maintenance screens

images/thumbnail.jpg - Thumbnail
Some time ago you created a table and its maintenance screens as local objects. When, later, you regret it and decide to transport the table, how will you be able to also transport the maintenance screens? Transporting the maintenance screens function group together with the table is not enough.

Test a sequence of function modules in SE37

images/thumbnail.jpg - Thumbnail
I was sure I had already posted about this before but I can’t find it so here it goes (again?). Some function modules save global data which must then be used by another function module belonging to the same function group. So, if you need to test them, they must run in sequence inside the same transaction. Everybody knows you can use SE37 to test a function module. What few people know is that you can also use SE37 to test a sequence of function modules inside the same transaction. Those who don’t know this end up creating a small program to call those functions in sequence and that’s also ok. But here’s how you can avoid that.

Have extra control over your selection screen

images/thumbnail.jpg - Thumbnail
The PARAMETERS and SELECT-OPTIONS already have some configuration options. But sometimes you need more control, more customising. Interestingly, although it’s not simple nor obvious, it can be done through a standard function module.

Debug on a user without debug permissions

images/thumbnail.jpg - Thumbnail
In a well protected system, normal users don’t have debug permissions. Very often, this makes it harder for ABAP programmers to help solve the users' problems, not being able to debug directly in their session. But there is a legit, albeit obscure, work-around for this problem.

Edit standard programs without a key

images/thumbnail.jpg - Thumbnail
Here we are again facing a dilemma: hide something because it is dangerous and someone can do bad things using this information or teach it because it would be condescending to presume the readers are not responsible enough to know it. Dictatorships usually go for the first: burning books, censorship, etc. Abapinho like to believe that its readers are responsible people and deserve the right to know. Thus, here it is. No, it’s not a user manual on how to enrich uranium nor a formula for homemade nitroglycerin. But it’s something similar: a trick that allows you to change standard objects without the need for a key.

Edit transport requests even if they don't let you

images/thumbnail.jpg - Thumbnail
As we all know, system adminstrators are very bad, cold blooded and cruel people. To prove it you just need to read the Bastard Operator from Hell. We, ABAP programmers, are hopeless victims in the hands of these evil creatures. But not always do we have to be smashed under their hairy fingers.