Category > Tips & tricks
Supported by
Supported by Inetum

Lock data in Z-tables without a locking object

images/thumbnail.jpg - Thumbnail

If I needed to create locking entries in a ZCOISO table I had created, up to two days ago I would have gone to SE11 to create a locking object for the ZCOISO table so that I could then use the function module generated by the locking object to lock the data.

But not anymore.

SAP system name in the window title

images/thumbnail.jpg - Thumbnail

The client where I’m working at the moment owns more SAP systems than the number of volcanoes in Chile. And, of course, it’s inevitable to have multiple sessions open for several of those systems. With the windows minimized it’s impossible to know the matching between systems and sessions. I mean, it was impossible, because today that’s already possible:

Execute commands in the user’s computer

images/thumbnail.jpg - Thumbnail

It’s been a while since Abapinho played with fire. Today he will. Because today he’ll show you how to execute DOS commands on the user’s local machine. After you finish reading this article, you’ll be ready to format the hard disks of all your users. Dealing with danger helps make us aware of the power we have and the responsibility that comes with it. Dear reader, listen to your conscience.

Benefits of LIKE LINE OF

images/thumbnail.jpg - Thumbnail

Let’s start by assuming that you have some dignity and so you don’t use internal tables with HEADER LINE anymore ;)

Given this, let’s suppose you declare an internal table:

Maintaining table maintenance authorisation groups

images/thumbnail.jpg - Thumbnail

There are some projects in which the authorisations group associated with table maintenance is always &NC;&, that is, Not Classified. It signals that everything there is friendly and nobody is hurting anyone else. But there are other projects where authorisation groups are taken seriously. But this is not synonymous with saying that they are organised. Serious or not, usually it all ends in a big mess, with nobody knowing who is authorised to do what.

This tip may help.

INSERT and APPEND with ASSIGNING FIELD-SYMBOL

images/thumbnail.jpg - Thumbnail

The harsh truth, at all costs, is that structures are out of date. Nowadays FIELD-SYMBOLS are in.

When you make a LOOP to an internal table of course that you also use ASSIGNING FIELD-SYMBOL instead of INTO Structure,correct?

But what was screwing everything over was APPEND and INSERT. I did not know how to use a structure to add records

No one cares for LISTBOX

images/thumbnail.jpg - Thumbnail

For some strange reason, LISTBOX is rarely used in report selection screens. Even though it’s widely used throughout the web. Who knows why.

Dear reader, I suggest you pay attention to its advantages:

SAParrot

images/thumbnail.jpg - Thumbnail

Go to SE38 and create a program with the code below. Then turn the computer sound on and press F8. INCLUDE ole2incl. DATA : ole TYPE ole2_object, voz TYPE ole2_object, texto TYPE string. CREATE OBJECT voz 'SAPI.SpVoice'. texto = 'Olá eu sou o SAP e falo português com sotaque estrangeiro'. CALL METHOD OF voz 'Speak' = ole EXPORTING #1 = texto. Note: the parrot not in the photo, just the macaw with which he was talking :)

Are you serious or just joking?

images/thumbnail.jpg - Thumbnail

Some things can only happen in production. While with some others it’s quite the opposite.

If you still don't use ABAP Objects you're chicken

images/thumbnail.jpg - Thumbnail

SAP has a book called Official ABAP Programming Guidelines which describes rules and best practices on how to program in ABAP. In there you can read: Page 42: Rule 3.1: Use ABAP Objects whenever possible for new and further developments. Classic processing blocks may be newly created in exceptional cases only. Page 45: Within such a [classic] processing block, however, you should immediately delegate the execution to a suitable method (see Rule 6.

Beautiful table relationships diagrams

images/thumbnail.jpg - Thumbnail

Nice relation diagrams for standard tables. Rui Dias revealed me a site where you can check the relation between any standard table with each other. For instance for T012. And if you try KNA1 it gets even better. Do you like it? I do. Thanks Rui Dias. Greetings from Abapinho.

Keyboard shortcut to transaction field

images/thumbnail.jpg - Thumbnail

And there you are madly typing with SAP when suddenly you need to go to the transaction field and write /OS37 or whatever. But you are writing with so much passion that the thought of leaving the keyboard for a moment to use your mouse seems catastrophic. Instead, you just press 3 keyboard keys: CTRL-SHIFT-7. Thank you Renato Sousa for the tip. Greetings from Abapinho.

Create sessions with the keyboard

images/thumbnail.jpg - Thumbnail

You need to start a new session but your mouse was stolen. No problem. Press CTRL and then the + key and you will see a new session coming in. Thank you Renato Sousa for the tip. And thank you freeimageslive / gratuit for the photo. Greetings from Abapinho.

Digital narcissism

images/thumbnail.jpg - Thumbnail

Reflection is the ability of a program to see itself. ABAP has a series of reflective capabilities, such as RTTS or the ability to dynamically generate code. There are also a few other so-and-so functions that do this and that. Today I present one of them to you:

GET_GLOBAL_SYMBOLS

Good program to find user-exits

images/thumbnail.jpg - Thumbnail

Every now and then we’ll be looking for user-exits and BADIs, BTEs and the like. SAP doesn’t help. But programs appear here and there, almost always called Z_USEREXIT, which help with this unappreciated search. Recently I learned of another one. I share it here because it is the best I have ever seen: https://wiki.sdn.sap.com/wiki/display/Snippets/Find+User-exits,+BADIs,+BTEs,+Etc+by+TCode+or+Program Thanks to Bruno Esperança for the tip. And thank you rverscha for the photo. Greetings from Abapinho.