A little trick, let your ABAP open SQL have self description effect

Time:2020-10-17

ABAP developers must have dealt with the confusing database table fields in Figure 1. To understand its meaning, you have to open se11 to see the field description.

A little trick, let your ABAP open SQL have self description effect
A little trick, let your ABAP open SQL have self description effect

If you use as to set more readable aliases for these field names when writing code after viewing the description information, it will be more convenient to read them next time you or others maintain them.

A little trick, let your ABAP open SQL have self description effect
A little trick, let your ABAP open SQL have self description effect

This tip, or initiative, comes from the sap community blog:

It can greatly improve the readability of the code and reduce the burden of future maintenance personnel to read the code without much effort. Writing readable code is also one of the embodiment of the professional quality of developers.

Of course, there are also some friends who are against it, such as:

I think this is not easy to use at this stage. SQL is easy to read here, but most of the subsequent processing needs type global structure to create local structure variables. When assigning values and calling FM, they are not easy to handle because of different field names.

A little trick, let your ABAP open SQL have self description effect

For more original articles on Jerry, please pay attention to the official account of “Wang Zixi”:
A little trick, let your ABAP open SQL have self description effect

Recommended Today

On the theoretical basis of SRE

What is SRE? When I first got into contact with SRE, many people thought that it was a post with full stack capability in Google and could solve many problems independently. After in-depth exploration, it is found that SRE can solve many problems, but there are too many problems. It is difficult for a post […]