1. Software Engineering
1.1. Advanced Business Application Programming Language
ABAP (Advanced Business Application Programming) is a 4th generation programming language which is used for developing applications for SAP Software. ABAP is mainly used for enhancing various SAP applications by developing custom reports and many different interfaces. ABAP can be positioned alongside JAVA in 3-tier client-server architecture of SAP software which can be represented as below figure.
Figure 1: SAP ABAP 3-Tier Architecture (Moxon, 2013)
The different layers of the main architecture are the Presentation Layer, Application Layer and the Database Layer.
The presentation layer is the interface between an SAP System and its users which consists of an input device which can be used to control the SAP system. Moreover, it also provides an intuitive graphical interface for entering and displaying data in the system.
The entire central processing takes place in this layer. Application layer consists of ABAP Workbench – a tool used for programming using ABAP language. Application layer executes ABAP/JAVA programs and acts as an interface between the database and the Presentation Layer.
Database Layer consists of a Database Management System along with a Central Database. It is this layer where all the data is stored and processed with the help of Database Management System. Unlike programming languages like C++ or JAVA, ABAP programs are not stored inside any files, infact, all the ABAP programs reside inside the Database. A key component of the ABAP system is the database interface which converts database independent statements into the statements understood by the underlying database. It, thus, makes ABAP a database independent language and can work on a variety of databases.
An ABAP report is used to show an organized data by executing ABAP statements or code. Reports are usually created by writing the output data into a program with the help of iterations. SAP supports with many standards reports like RSCLTCOP – used to copy tables across SAP clients. ABAP reports consist of only one screen (ABAP screen) as an output. An ABAP report consists of various events which are associated with some user actions and are triggered when the user executes them. Below listed are a few such events which we may find in an ABAP report.
SELECTION-SCREEN- It defines the screen and various screen elements to be displayed once the report has been executed.
INITIALIZATION – It is triggered and executed by displaying the selection screen.
AT SELECTION SCREEN – This event verifies the user input prior to the execution of a program. After processing the user input, the selection screen remains in the active mode, indicating that you are at that selected screen.
START-OF-SELECTION – This event is triggered as soon as the user executes the report.
Figure 2: A Simple ABAP Screen with Elements (Author, 2018)
A simple ABAP screen is represented by the above figure which consists of few basic screen elements.
Parameters – Parameters are used to get the input from the user.
Selection– Options – This element is used to get a range of inputs from the user where he gets a list of options to select from.
Block – Block is used to organize different input items on the screen.
1.3. Function Modules
Function Modules are used as sub-programs which consist of a set of reusable statements which can be invoked at any point of program execution. SAP provides many pre-defined Function modules which could be either used directly into a program or as a reference while creating your own Function Modules.
Function groups with similar kind of functionality are further grouped together to form a Function Group. It is basically a container containing user-defined Function Modules representing some common functionality.
1.4. Object-Oriented Concepts
ABAP also support Object Oriented concepts like polymorphism, inheritance, Encapsulation and Exception Handling. Within ABAP we can create classes, objects and methods while developing a program.
Polymorphism is a technique which is used for creating many forms of a single existing functionality or method. It is best used in conjunction with inheritance to inherit few properties of a parent class and modifying it while adding some additional functionality to it. This simply means that we can redefine the existing functionality by processing the objects differently depending on their data types or class.
Data Encapsulation allows important data to be protected by binding functions and data together into one single unit to avoid inheritance and misuse of data. It is also often used to hide the internal representation of an object from outside. ABAP supports this by allowing objects to classified as Public, Private and Protected, just like we use them in JAVA language.
1.5. Exception Handling
An exception is an issue raised during the execution of a program as a result of a syntactical or a logical failure of a certain code. Exceptions if raised, causes the program to end thereby disrupting the flow of execution of a program. Although it raises issues for the program execution, it could also be used to transfer the execution control from one part to another part of a program, thus avoiding the termination. ABAP supports many exceptions handling keywords such as RAISE, TRY, CATCH, CLEANUP, etc.
RAISE ? Exceptions are raised to indicate that some exceptional situation has occurred. Usually, an exception handler tries to repair the error or tries for an alternative solution.
TRY ? The TRY block contains the application coding whose exceptions are to be handled. It asks the compiler to check if a certain condition can raise an exception and when it does, catch it using the CATCH block.
CATCH ? A program catches an exception with an exception handler at the place in a program where you want to handle the problem. CATCH is always used in sync with TRY block which could basically generate the exception.