"
Supported by

Disable value history for a single field

adam_eve

SapGUI usually keeps a history of the last values entered on each field. This is usually a good thing. But you may very well not want it to happen (in case you’re entering pornographic values in a specific field for example). You could always turn it off globally in the SapGUI settings.

But what if you just want to disable it in one particular field? Abapinho tells you how to do it.

Ler o resto do artigo! »

Add parameters to standard methods and functions

esquilo

We are all aware of SAP implicit enhancements which allow you to add code to the top or bottom of any block of standard code (methods, functions, etc). We’ve all used it to make a change to a BAPI or other standard piece of code.

But only recently did I find that you can also use these implicit enhancements to add parameters to standard methods and functions.

Ler o resto do artigo! »

ZTOAD – Editor de SQL

toad-world-logo

Toad is a very famous SQL tool which allows you to build and execute SQL queries in an easy and interactive way. And now, thanks to Mr. Sébastien HERMANN, SAP has a simplified version of this wonder tool.

I’ll let him explain.

Thank you Sérgio Fraga for spotting this.

Greetings from Abapinho.

Internal table secondary indexes

postits

This is how internal tables used to be declared:


DATA: itbl TYPE TABLE OF bkpf.

Ler o resto do artigo! »

Program the program programming

cerebro_fios

One of the few things that separates us humans from all the other animals is our ability to think about thoughts.

A sparrow may think “I’m scared, I’ll say chirp chirp chirp” and, as a direct consequence, whoever stands close to it will hear “chirp chirp chirp”.

Ler o resto do artigo! »

Use the “where used” tool in a program

Book Illustration Depicting Sherlock Holmes and Dr. Watson in a Train Cabin

The “where used” tool is very dear to any ABAP developer. Through it one can find out where a given object is used. Doesn’t look like much but we all know how important this is.

Ler o resto do artigo! »

Class CL_GUI_FRONTEND_SERVICES

nariz

Class CL_GUI_FRONTEND_SERVICES is commonly used to upload and download files from and to the user’s local computer. But it can do many more good things. For example:

Ler o resto do artigo! »

SAP can take selfies!

selfiestick

I just found out that SAP can take selfies. I still don’t see why one would need it. But that’s understandable because I never really understood the need for selfies anyway.

Here’s how SAP can take a selfie:

Ler o resto do artigo! »

Do you know the ASCII code for CR_LF and its buddies?

carriage_return

I don’t.

And I don’t want to. Why waste memory on stuff like that?

And I don’t need to because ABAP has a class just for that.

Ler o resto do artigo! »

SELECT from a set of known values

banner-minions

Someone asks you to select records based on a criteria for which you’ll have a small set of known values which you’re told will never change. Did you know you can do it directly in the SELECT?


SELECT * INTO T_T005T
FROM T005T
WHERE LAND1 = I_LAND1 AND
           SPRAS IN ( 'PT', EN' ).

I need to remind you that hard coding values in programs is not the best idea so make sure you know what you’re doing when you choose to apply this approach.

Thank you Sérgio Fraga for the tip.

Greetings from Abapinho.

You can save variants in SE16N

nariz_cao

And that’s it really. That’s the whole tip right there at the title. This has always been right under your nose but you probably never thought about it: you can save variants in SE16N. And they can even be user-specific. So useful and so little known.

Thank you Sérgio Fraga for the tip.
Thank you Cloudtail for the photo.

Greetings from Abapinho.

Limitar execução em background ou foreground

semaforo

You’ve developed a report which you know will take over 12 hours to run. So you don’t want anyone to try to run it in foreground. I’ll show you a way to make sure it doesn’t happen.

Ler o resto do artigo! »

How to sabotage standard texts

sabotage

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

Formating variables when concatenating strings using pipes

filtros

Pipes are the new trend when it comes to manipulating strings:


str = |Hi { sy-uname }, | &
      |today's date is { sy-datum }.|.

Besides looking cool, it’s way more practical than using the dreaded CONCATENATE.

But I only recently found out that you can directly apply formatting to the variables:

Ler o resto do artigo! »

Is the GUI available?

guilherme-leicam

To check if a program is running in background usually one takes a peek at SY-BATCH. SY-BINPT can also be used to check if the background program is a BDC session. You usually check one of these.

There is a similar but not exactly equal question, though. How do you ask if the GUI is available? Most times both questions will have the same answer. But not always.

It’s like saying the Sun can be seen during the day while the Moon can be seen during the night. If the sky is cloudy you won’t be seeing them.

Ler o resto do artigo! »

How to avoid timeout when running a program

dynamite

Usually SAP systems have a predefined time limit for running a program interactively. If the program takes longer to run than that you’ll get a runtime execution error. A dump.

Ler o resto do artigo! »

In ABAP’s name, I baptize you

letras_frigorifico

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

Abapinho Dev Tools: Translator

torre_babel

Nuno Morais has developed another very useful tool to help simplify mass translations of most SAP objects.

The toold is not for automatic translation between two languages. Instead, it has the following features:

  • Export an Excel file with texts
  • Import an Excel file with texts
  • Copy texts from one language into one or more languages
  • Create a transport order with the changed texts
  • Find object dependencies which lack translations
  • Provides a nicer browsing interface to help on manual translation

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.

Abapinho Dev Tools: Dependencies

canivete_suico

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.

Thank you AJ Cann for the photo.

Greetings from Abapinho.

Shortcuts for making small and big letters

OLYMPUS DIGITAL CAMERA

You may not even know how to program but if you’re able to type fast and know enough keyboard shortcuts everyone will think you’re an expert.

In the ABAP editor write the following word: subdermatoglyphic

Now try the following shortcuts:

CTRL+U: SUBDERMATOGLYPHIC BIG LETTERS! UPPER CASE!
CTRL+L: subdermatoglyphic small letters! lower case!
CTRL+J: Subdermatoglyphic The First Letter Of Each Word In Upper case!
CTRL+K: sUBDERMATOGLYPHIC tHe BiG aRe NoW sMaLl AnD tHe SmAlL ArE nOw BiG!

Thank you José Vília for the tip.

Thank you Chris for the photo.

Greetings from Abapinho.


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