ABAP – CALL TRANSFORMATION to and from Excel using XLST

SAPThis article is here to show you how to export data from ABAP internal table to XML accepted by MS Excel using XSLT transformation. In second part I’ll show the backwards transformation – Excel to ABAP internal table.

Continue reading

Design Patterns in ABAP – Observer

SAPObserver design pattern can be easily demonstrated on a chat service where you have a server and several clients (observers). Once a client sends a message, server receives it and RAISES an EVENT (eg NEW_MESSAGE_RECEIVED) which is OBSERVED by all connected clients (observers) and such message is subsequently displayed in message dialog on all clients. 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

ABAP – APO Material master version dependent extra fields

SAPAPO system offers only 5 product specific and another 5 product-location specific, version dependent fields called AT101 – AT105 and ATT01 – ATT05. But what if you need MORE than these 10 extra fields to be version dependent? You can generate more extra fields using the EEWB (Easy Enhancement Workbench) but this tool generates the extra fields as version independent (all planning versions will share the same values).
In this article I’ll show how to make these extra fields made by EEWB version dependent. Continue reading

ABAP – Multiple implementations of a “Single implementation only BAdI”

SAPIt is a problem when you need to have multiple implementations of a BAdI which does not implicitly allow multiple implementations by its definition. How to bypass this limitation? Continue reading