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

ABAP – APO Planning book macros on aggregated levels

SAPHere I’d like to present my solution of a problem in APO planning books where it was necessary to load multiple products and locations at the same time into the planning view and execute some Default macros on all of them. Continue reading

ABAP – Convert numbers on input and output

SAPI’m affraid there might be a standard function module already available to achieve the same what I’m going to write myself, but I believe it is good to know that the number format can be different when different user settings is used in SAP.
If you forget about this during your development you might start fighting serious problems in the future.
Therefore I’ve written two short code snippets for numbers conversion for INPUT (save to database) and OUTPUT (display to the user) Continue reading

ABAP – How to declare a variable dynamically

SAPIn case you need to create a variable dynamically during runtime with different type, length or precision, you can use the following piece of code to achieve the same – the variable is created dynamically based on given type, length and number of decimals. Continue reading

Secured FTP – ProFTP + TLS in Ubuntu

FTP is considered as very insecure protocol because all data transferred using this protocol is passed between client and server in clear text and can be hacked by someone listening on your line. But you can easily encrypt the whole communication by enabling/forcing TLS and make FTP much more secure. This article explains how to set up ProFTPd with TLS on an Ubuntu server. Continue reading

ABAP – How to search across Web Dynpro methods

SAPThere’s no direct way how to search for a string across all methods of a Web Dynpro, it is always possible to search in just one method only. Using the approach I’m going to present it is possible to find the SAP internal name of the impementing class and then search across the whole class in classic SE24 transaction for editing classes. Continue reading