Supported by
Supported by Inetum

Be lazy when you write in ABAPese

images/thumbnail.jpg - Thumbnail

To find out which professions attract the laziest people, I googled the following:

Profession Results

“médico preguiçoso (lazy doctor)"| 2,140,000

“advogado preguiçoso (lazy lawyer)"| 1,430,000

“gestor preguiçoso (lazy business administrator)"| 1,020,000

“engenheiro preguiçoso (lazy engineer)"| 647,000

“político preguiçoso (lazy politician)"| 602,000

“economista preguiçoso (lazy economist)"| 284,000

“pedreiro preguiçoso (lazy builder)"| 91,200

As this conclusively proves, engineers are not lazy enough as they are beaten by lawyers and doctors. This must change. And this tip will help. But not without making the following difference clear: lazy is not work-shy. I am talking here about noble laziness, the behaviour of those who like doing things but with the least possible effort. Lazy slobs are not included here.

SAP is something that evolves slowly, and it launched a new editor a few years ago that is full of capabilities many of which, while handy, are barely used. One of them is called ‘Code templates’ which I will now demonstrate:

  1. Go to SE38, SE24, SE37 or any other transaction that offers the ABAP editor;
  2. In the bottom right-hand corner there is an icon looking like a clipboard. Click on it;
  3. The editor options appear;
  4. From the options on the left, select ‘Code templates’;
  5. There you will see various pre-defined templates (e.g. TRY) and you can set up more of your own.

Here is the code templates definition: image

As you write code, just write the name of one of the models anywhere and hit TAB to replace that name with its model.

Tip within a tip: ideal for “nuno was here!” type lines - de rigueur whenever splicing into someone else’s code.

Let’s be lazy!

Greetings from Abapinho.