ABAP – Add working days to a date using Factory Calendar

SAPThis article contains a code snippet showing how to add given number of WORKING days to a given starting date. To get the correct factory calendar, you have to search in Plant data. Continue reading

ABAP – NO-BREAK space (U+00A0)

SAPThis is just a note that you should be aware of using different kind of space character.
The classical space – you can type it by pressing spacebar – has unicode number U+0020.
The NO-BREAK space character is different – you can type it by pressing ALT+255 – this character will look the same like normal space but in unicode it will have number U+00A0. Continue reading

ABAP – ITAB and CLEAR vs REFRESH vs FREE

SAPI experienced lot of confusion when I faced internal tables with header lines during my professional life. Therefore I strongly advice NOT to use internal tables with header lines. But they are heavily used in older programs so it’s good to know what is the difference between how to clear the header line and how to clear the itab contents and how it is different from internal tables WITHOUT header line. Continue reading

ABAP – Hierarchical View Clusters

SAPThis article is a tutorial on how to create a View Cluster on top of SAP tables. It is extremly useful when you have several SAP tables with hierarchical dependency. This hierarchy is nicely visible on eg. MARA -> MARC -> MARD tables where the KEY grows from MATNR (MARA table) to MATNR + WERKS (MARC) to MATNR + WERKS + LGORT (MARD). To view/edit data using this hierarchy folding you can use the “View clusters” approach.
Continue reading

Design Patterns in ABAP – Factory Method

SAPFactory Method design pattern provides unique interface to object instantiation. The decision on which object is to be instantiated is hidden from the outside world in the code. Using this approach different objects can be instantiated dynamically. Continue reading

Design Patterns in ABAP – Singleton

SAPIn software engineering, the singleton pattern is a design pattern that restricts the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system. The concept is sometimes generalized to systems that operate more efficiently when only one object exists, or that restrict the instantiation to a certain number of objects. The term comes from the mathematical concept of a singleton. Continue reading