Preface
Advanced Business Application Programming, or ABAP, is a programming language used to develop applications in an SAP environment. ABAP contains numerous language elements that are stored in different libraries, and ABAP programs are developed in development environments as part of SAP NetWeaver AS ABAP. All application development objects are created within the SAP NetWeaver AS ABAP environment.
ABAP was developed to meet the business processing needs of ERP systems, and has evolved over time to meet other enterprise requirements as well. More information on the evolution of SAP ERP and ABAP will be discussed in Chapter 1 and Chapter 2.
With the advent of SAP NetWeaver AS ABAP 7.5 and higher, new innovations have emerged that make the lives of developers that much easier. In this introduction, we’ll discuss the primary objective of this book and how it addresses both standard practices and new innovations in ABAP. We will also discuss who this book is targeted at as well as its structure and methodology.
The Objective of this Book
The objective of this book is to offer complete coverage on the most important elements of ABAP, explaining both the concepts at hand and then providing examples of their practical application.
The book is divided into chapters based on the major concepts in ABAP programming, and are ordered according to how one would learn ABAP. For example, we explain the elements of the ABAP Data Dictionary that are relevant in their respective chapters: data elements are discussed when explaining data types, table types are explored when discussing procedures, and so on. The idea is to provide a book that focuses on your learning process.
Target Audience
This book is an everyday reference for ABAP developers of all program levels. While the beginning chapters tend to cater to a more beginner audiences, the most advanced chapters provide refreshers and insights that even seasoned ABAP developers will be interested in reviewing. Taking a good look at the table of contents will allow you to identify which topic areas you may need more insight into. This book also provides a detailed index if you have a particular subject in mind you’d like to jump to.
Structure of this Book
This book starts off with basic concepts and then transitions into more advanced topics. Understanding the prerequisites discussed in the beginning chapters is important for grasping the more advanced topics explained later on in the book.
The following overview offers details on individual chapters and the overall structure of the book:
- Chapter 1, Introduction to ERP and SAP, provides an overview of enterprise resource planning (ERP) systems and the advantages this type of software offers. We then look at the different SAP modules, both functional and technical, used in SAP. From there, we discuss how you can customize your SAP system per your business requirements using custom development, modifications, and enhancements. Finally, we begin shifting the focus to the main topic of this book, ABAP, and the system requirements necessary for carrying out the different examples discussed throughout this book.
- Chapter 2, The Architecture of an SAP System, offers a “nuts-and-bolts” look at the SAP system architecture. The topics in this chapter will help you clearly understand the type of environment your ABAP programs will be run in. We’ll look at the different architectural layers: presentation, application, and database. Finally, we’ll close out our discussion with an overview of data structures and the use of clients and packages.
- Chapter 3, Introduction to the ABAP Environment, discusses two different integrated development environments (IDEs) that can be used when working with ABAP: SAP GUI and Eclipse. This chapter begins by looking at the different elements of an SAP screen and how to use transaction codes to navigate between these screens. We then dive into the tools found in the ABAP Workbench: the ABAP Editor, ABAP Data Dictionary, Screen Painter, Menu Painter, and Object Navigator. We round out our discussion with a look at Eclipse and its setup.
- Chapter 4, ABAP Programming Concepts, introduces the basics of ABAP: key concepts, general program structures, syntax, keywords, and more. In addition, we’ll also look at using data types, data elements, data objects, and domains. We end the chapter with steps to create your first ABAP program.
- Chapter 5, Structures and Internal Tables, explores complex data types and lays the foundation for working with the data stored in a typical database. We begin the chapter by looking at local and global structures and how to define them. We then move on to working with internal tables, before jumping into an introduction to Open SQL. The chapter ends with a practice example that highlights the concepts taught throughout the chapter.
- Chapter 6, User Interaction, takes us beyond the basics and introduces user interaction within our ABAP code. The chapter begins with instructions for using a special kind of dynpro: selection screens. Implementing selection screens enables users to provide selection criteria for a report program, while also providing an interface for data transfer between two executable programs. We then move on to using messages to communicate with users from ABAP programs.
- Chapter 7, Modularization Techniques, teaches how to implement modularization into your code to provide, among other things, better readability and organization in your programs. Specifically, this chapter looks at the structure of an ABAP program, including processing blocks, events, and procedures. The chapter ends by discussing a feature introduced in SAP NetWeaver 7.4: inline declarations.
- Chapter 8, Object-Oriented ABAP, takes a walk on the object-oriented side of ABAP. As we will discuss, there are two programming approaches to ABAP: procedural and object-oriented (OOP). While we discuss both techniques throughout the book, this chapter focuses on the general concepts of OOP. This includes key features such as encapsulation, inheritance, polymorphism, and more.
- Chapter 9, Exception Handling, explains how to implement messages to users when an error has occurred in the system (for example, inputting an incorrect field value). The chapter will look at both procedural and OOP (class-based) exception handling approaches.
- Chapter 10, ABAP Data Dictionary, reviews concepts previously mentioned about the ABAP Data Dictionary thus far and offers a complete discussion on topics not yet covered. This includes more detailed information on database tables, views, data types, domains, type groups, search helps, and lock objects.
- Chapter 11, Persistent Data, explains how persistent data is used in ABAP programs. ABAP programs generally work with data that is read from a persistent storage source, such as a database, meaning that data exists even when the program is not reading it. In this chapter, we’ll look at how to work with data in a database, persistent object services, file interfaces, and data clusters. We’ll end the chapter with a look at key security concepts to keep in mind when dealing with persistent data.
- Chapter 12, Dialog Programming, provides steps for creating screens, flow logic, menu bars, and more for an application. The end of the chapter offers a practice example where you can implement what you learned into a real application.
- Chapter 13, List Screens, explains one of the most basic ways to develop reports in ABAP: list screens. There are three types of screens in ABAP: selection screens (discussed previously in Chapter 6 and to be discussed in Chapter 14), general dialog screens, and list screens. This chapter provide steps for creating list screens for developing reports using program types, program execution, list events, and more. We again end this chapter with a series of exercises.
- Chapter 14, Selection Screens, offers more details on selection screens and how you can use them to display information to application users. Specifically, we’ll dive into the events, input validations, variants, and batch jobs used with selection screens. We’ll also provide tips for displaying and hiding screen elements dynamically and steps for calling a program.
- Chapter 15, ALV Reports, discusses how to develop reports using procedural and OOP ALV function modules. ALV function modules are another way to create reports in ABAP.
- Chapter 16, Dynamic Programming, explains how to enable dynamic programs in ABAP. Dynamic programs return results based on user inputs. In this chapter, we’ll look specifically at using field symbols, data references, specifications, procedure calls, and more, dynamically.
- Chapter 17, Debugging, takes a close look at the two primary debuggers used in ABAP: the Classic Debugger and the New Debugger. In addition to learning how to implement debugging via these two debuggers, we’ll also take a brief look at the new AMDP Debugger for ABAP Managed Database Procedures (AMDP). We’ll end the chapter with a discussion on using debugging tools for troubleshooting and for learning purposes.
- Chapter 18, Forms, explores the three main types of form technology that can be used to create forms in ABAP: SAPscripts, smart forms, and SAP Interactive Forms by Adobe. Each section describes the step-by-step process for creating forms. We then compare and contrast the advantages and disadvantages of these three technologies.
- Chapter 19, Interfaces, focuses on interface development. Each section is devoted to a different type of interface, including LSWM, web and OData services, ALE/EDI/IDocs, XSL transformations, and more. We begin by explaining the concept behind each interface technology, then dive into the steps for working with them.
- Chapter 20, Modifications and Enhancements, provides information on how to modify and enhance repository objects. We begin with an overview of the Modification Assistant and Modification Browser, and how they can be used to modify objects within the ABAP Workbench. Moving on to enhancements, we’ll look at how to best implement user exits, customer exits, BAdIs, and more.
- Chapter 21, Test and Analysis Tools, concludes our book with a look at the tools for testing and analyzing your ABAP code. As any good developer will tell you, it is important to test your code to ensure that it is error-free. Therefore, we’ll look at a number of tools to guarantee this, including ABAP Unit for creating unit tests, Code Inspector for analyzing program code, Memory Inspector for creating memory snapshots of the memory consumed by an ABAP program, and many more.
It is our hope that this book serves as a roadmap for your journey as an ABAP developer. Now, roll up your sleeves and get ready to work!