Dear community, in an SAP ERP system, there are many small customizing settings that have a big impact on processes. Many of these small settings are hidden in database tables that were created many decades ago. The field names are usually five-digit characters as abbreviations of German terms. Well-known representatives are “BUKRS” (company code)” or “VKORG” (sales organisation).
The use of these field names in database table design and ABAP programming is no longer up to date because they are not very informative. When you read them, you won’t learn anything about the connection to a business object or business process.
So how can you increase readability and comprehensibility?
Approaches
We cannot change the old database tables and the field names they use because they are development objects belonging to SAP. So we need a new level above them. There are three approaches:
- Read by ABAP Core Data Service
- SELECT with alternative column name (AS)
- Representation as attributes of an object
ABAP Core Data Services
If you read data records using a CDS view, the resulting structure corresponds to the structure of the CDS view and therefore uses the descriptive field names.
SELECT with alternative column name (AS)
By specifying an alternative field name via “AS”, the resulting structure uses the descriptive names.
Representation as attributes of an object
If data records need to be passed around in programming, then they should be passed around as a separate object with READ-ONLY attributes or corresponding GET-methods. As long as the object does not contain any logic, it can be seen as a kind of container (data class, not nice but works).
Have fun trying it out
Michael