Book Image

Mastering SAP ABAP

By : Paweł Grześkowiak, Wojciech Ciesielski, Wojciech Ćwik
Book Image

Mastering SAP ABAP

By: Paweł Grześkowiak, Wojciech Ciesielski, Wojciech Ćwik

Overview of this book

Advanced Business Application Programming (ABAP) is an established and complex programming language in the IT industry. This book is designed to help you use the latest ABAP techniques and apply legacy constructions using practical examples. You'll start with a quick refresher on language and database concepts, followed by agile techniques for adding custom code to a modern ABAP system. After this, you will get up to speed with the complete ABAP toolset for importing data to and from different environments. Next, you'll learn how to print forms and work with the different ABAP tools for Extensible Markup Language (XML) manipulation. While covering further chapters, you'll gain insights into building stunning UI5 interfaces, in addition to learning how to develop simple apps using the Business Object Processing Framework (BOPF). You will also pick up the technique of handling exceptions and performing testing in ABAP. In the concluding chapters, you can look forward to grasping various techniques for optimizing the performance of programs using a variety of performance analysis tools. By the end of this book, you will have the expertise you need to confidently build maintainable programs in Systems, Applications, and Products (SAP).
Table of Contents (25 chapters)
Title Page
Copyright and Credits
Dedication
About Packt
Contributors
Preface
Index

Global versus local classes


In ABAP, we can create classes in two ways: locally or globally. The main differences are that local classes can be used only in the program in which the class is created, while a global class can be used in every program or function module. Also, the ways in which these classes are created are different. In a local class, we need to create a definition and implementation of the class in the program, and, in a global class, the definition and implementation are created in the class builder.

We create global classes more often than local classes because it's possible to reuse them. If we want to use a local class in a different program, we need to create the same local class in that program, which is not necessary for a global class.

Creating a local class

To create a class, first we need to create a definition of it. In this definition, we can create types, data, class data, and methods and inheritance.

It is necessary to explain the differences between data and class...