ABAP
Step into ABAP with this beginner's guide. First understand ABAP syntax and find out how to add data and logic to your applications. Then delve into backend programming: learn to work with the ABAP data dictionary, create database objects, and process and store data. Round out your skill set by practicing error handling, modularization, string manipulation, and more. With guided examples, step-by-step instructions, and detailed code you'll become an ABAP developer in no time!
- Build your ABAP skills and write your first program
- Use the data dictionary, make programs modular, and troubleshoot errors
- Develop applications using strings and text, dates and times, and more
You'll learn about:
- ABAP Language Basics:
Learn the ABAP language, from formatting code to using variables and constants. Understand how to add binary logic to applications, create simple user interfaces, and more.
- Working with Data:
Create data dictionary objects and program ABAP applications to process and read data from a database. Use working memory to store retrieved data and display it to users.
- Manipulating Programs:
Modularize ABAP programs, handle errors, and work with strings, texts, dates, times, and currencies.
- Preparing for an ABAP Career:
Understand the SAP system landscape, prepare your development environment, and explore the official ABAP development guidelines.
Key Highlights:
- Procedural programming
- Object-oriented programming
- Flow control
- Arithmetic operations
- Data dictionary
- Defining variables and constants
- Creating tables
- Database read/write
- Modularization
- Debugging
- ABAP List Viewer (ALV)
View Full Table of Contents
- Preface
- Audience
- Your ABAP Learning Path
- SAP Professional with Some Knowledge of ABAP
- SAP Professional or Power User with No Knowledge of ABAP or Other Programming Languages
- Professional Developer with No Knowledge of ABAP
- Reader with No Knowledge of SAP, ABAP, or Any Programming Languages
- Where to Go from Here?
- 1 Introduction to SAP’s ERP Systems
- 1.1 What Are SAP and ABAP?
- 1.2 Current State of SAP’s ERP Systems
- 1.3 “Old” versus “New” ABAP
- 1.4 Navigating SAP ERP Systems
- 1.4.1 Overview of SAP GUI
- 1.4.2 Overview of SAP Fiori
- 1.5 Summary
- 2 Creating Your First Program
- 2.1 “Hello, World!”
- 2.1.1 Creating a New Program with Eclipse
- 2.1.2 Creating a New Program in Transaction SE80
- 2.1.3 Writing a “Hello, World!” Program
- 2.1.4 Adding Features to Your First Program
- 2.2 Summary
- 3 ABAP 101
- 3.1 Variables and Constants in ABAP
- 3.1.1 The DATA Keyword
- 3.1.2 Numeric Data Types
- 3.1.3 Character-like Data Types
- 3.1.4 Boolean
- 3.1.5 Structures and Internal Tables
- 3.1.6 Inline Data Declarations
- 3.1.7 Constants
- 3.1.8 System Fields and Predefined Constants
- 3.2 Arithmetic and Basic Math Functions
- 3.2.1 Arithmetic Operations
- 3.2.2 Math Functions
- 3.2.3 CLEAR Command
- 3.3 Flow Control
- 3.3.1 IF Statements
- 3.3.2 CASE Statements
- 3.3.3 DO Loops
- 3.3.4 WHILE Loops
- 3.4 Selection Screen Programming
- 3.4.1 PARAMETER
- 3.4.2 SELECT-OPTIONS
- 3.4.3 Selection Texts
- 3.4.4 SELECTION-SCREEN
- 3.4.5 BLOCK
- 3.4.6 Other Selection Screen Elements
- 3.5 Event Blocks
- 3.5.1 INITIALIZATION
- 3.5.2 AT SELECTION-SCREEN
- 3.5.3 START-OF-SELECTION
- 3.6 Formatting Code
- 3.7 Comments
- 3.7.1 Common Commenting Mistakes
- 3.7.2 Using Comments while Programming
- 3.8 Debugging Basics
- 3.8.1 Program to Debug
- 3.8.2 Breakpoints in Eclipse
- 3.8.3 Breakpoints in the SAP GUI
- 3.8.4 Watchpoints in Eclipse
- 3.8.5 Watchpoints in SAP GUI
- 3.9 Tying It All Together
- 3.9.1 The Problem
- 3.9.2 The Solution
- 3.10 Summary
- 4 Data Dictionary Objects
- 4.1 What Is a Database?
- 4.2 What Is a Data Dictionary?
- 4.3 Database Design
- 4.3.1 Entity Relationship Diagrams
- 4.3.2 Database Normalization
- 4.3.3 Relationships in ERDs
- 4.4 Navigation to ABAP Dictionary Objects
- 4.5 Table, Data Element, and Domain
- 4.6 Training Data Model and Example Definition
- 4.6.1 SAP Flight and Booking Data Model
- 4.6.2 Training Example: Enhancing the SAP Model
- 4.7 Creating a New Domain
- 4.8 Creating a New Data Element
- 4.9 Creating and Editing Tables
- 4.9.1 Viewing the Flight Table Configuration
- 4.9.2 Creating an Append Structure
- 4.9.3 Creating a Custom Transparent Table
- 4.10 Documentation
- 4.11 Viewing Data in the Database Tables
- 4.11.1 Data Preview in Eclipse
- 4.11.2 Data Browser in SAP GUI
- 4.11.3 Setting Up the Flights Example Data
- 4.12 Table Maintenance Dialogs
- 4.12.1 Generating Maintenance Dialog for a Table
- 4.12.2 Table Maintenance Transaction SM30
- 4.13 Structures and Table Types
- 4.13.1 Creating Structures
- 4.13.2 Creating Table Types
- 4.14 Search Help
- 4.15 Views
- 4.16 Summary
- 5 Accessing the Database
- 5.1 SQL Console in Eclipse
- 5.2 Reading Data
- 5.2.1 SELECT Statements
- 5.2.2 INNER JOIN
- 5.2.3 LEFT OUTER JOIN
- 5.2.4 FOR ALL ENTRIES IN
- 5.2.5 With SELECT-OPTIONS
- 5.2.6 Aggregate Expressions in SELECT Statements
- 5.2.7 New Open SQL
- 5.2.8 ABAP CDS Views
- 5.3 Changing Data
- 5.3.1 INSERT
- 5.3.2 MODIFY/UPDATE
- 5.3.3 DELETE
- 5.4 Table Locks
- 5.4.1 Viewing Table Locks
- 5.4.2 Creating Table Lock Objects
- 5.4.3 Setting Table Locks
- 5.5 Performance Topics
- 5.6 Obsolete Database Access Keywords
- 5.6.1 SELECT…ENDSELECT
- 5.6.2 Short Form Open SQL
- 5.7 Summary
- 6 Storing Data in Working Memory
- 6.1 Using ABAP Dictionary Data Types
- 6.2 Creating Data Types with the TYPE Keyword
- 6.3 Field Symbols
- 6.4 Defining Internal Tables
- 6.4.1 Defining Standard Tables
- 6.4.2 Keys in Internal Tables
- 6.4.3 Defining Sorted Tables
- 6.4.4 Defining Hashed Tables
- 6.5 Reading Data from Internal Tables
- 6.5.1 READ TABLE
- 6.5.2 LOOP AT
- 6.6 Modifying Internal Tables
- 6.6.1 Inserting/Appending Rows
- 6.6.2 Changing Rows
- 6.6.3 Deleting Rows
- 6.7 Other Internal Table Operations
- 6.7.1 Copying Table Data
- 6.7.2 SORT
- 6.7.3 DELETE ADJACENT DUPLICATES FROM
- 6.8 Which Table Should Be Used?
- 6.9 Updating ABAP Dictionary Table Type
- 6.10 Obsolete Working Memory Syntax
- 6.10.1 WITH HEADER LINE
- 6.10.2 OCCURS
- 6.10.3 Square Brackets
- 6.10.4 Short Form Table Access
- 6.10.5 BINARY SEARCH
- 6.11 Summary
- 7 Making Programs Modular
- 7.1 Separation of Concerns
- 7.2 Subroutines
- 7.3 Introduction to Object-Oriented Programming
- 7.3.1 What Is an Object?
- 7.3.2 Modularizing with Object-Oriented Programming
- 7.4 Structuring Classes
- 7.4.1 Implementation versus Definition
- 7.4.2 Creating Objects
- 7.4.3 Public and Private Sections
- 7.4.4 Class Methods
- 7.4.5 Importing, Returning, Exporting, and Changing
- 7.4.6 Constructors
- 7.4.7 Recursion
- 7.4.8 Inheritance
- 7.4.9 Composition
- 7.5 Global Classes
- 7.5.1 How to Create Global Classes in Eclipse
- 7.5.2 How to Create Global Classes in Transaction SE80
- 7.5.3 Using the Form-Based View in Transaction SE80
- 7.6 Design Patterns
- 7.7 Function Modules
- 7.7.1 Creating Function Groups and Modules in Eclipse
- 7.7.2 Creating Function Groups in Transaction SE80
- 7.7.3 Calling Function Modules
- 7.8 Summary
- 8 Error Handling
- 8.1 SY-SUBRC
- 8.2 Message Classes
- 8.2.1 Displaying a Message Class
- 8.2.2 Creating a Message Class
- 8.2.3 Using the MESSAGE Keyword
- 8.3 Exception Classes
- 8.3.1 Unhandled Exceptions
- 8.3.2 TRY/CATCH Statements
- 8.3.3 Custom Exception Classes
- 8.4 Non-Class-Based Exceptions
- 8.5 Summary
- 9 Presenting Data Using the ABAP List Viewer
- 9.1 What Is ALV?
- 9.2 Report Example Using an SALV Table
- 9.3 Report Example Using SALV Tree
- 9.4 ALV with Integrated Data Access
- 9.5 Outdated ALV Frameworks
- 9.5.1 REUSE_ALV_GRID_DISPLAY Function Module
- 9.5.2 CL_GUI_ALV_GRID Class
- 9.6 Summary
- 10 Creating a Shopping Cart Example
- 10.1 The Design
- 10.1.1 The Database
- 10.1.2 The Global Class
- 10.1.3 The Access Programs
- 10.2 Database Solution
- 10.2.1 Data Elements
- 10.2.2 Transparent Tables
- 10.3 Accessing the Database Solution
- 10.4 Creating a Message Class for the Solution
- 10.5 Creating Classic Screens for the Solution
- 10.5.1 Product Maintenance Program
- 10.5.2 Shopping Cart Maintenance Program
- 10.6 Summary
- 11 Working with Strings and Texts
- 11.1 String Manipulation
- 11.1.1 String Templates
- 11.1.2 String Functions
- 11.2 Text Symbols
- 11.2.1 Creating Text Symbols
- 11.2.2 Translating Text Symbols
- 11.3 Translating Data in Tables
- 11.4 Translating Messages
- 11.5 Obsolete String and Text Commands
- 11.6 Updating the Shopping Cart Example
- 11.6.1 Updating the Database
- 11.6.2 Using the Text Table
- 11.7 Summary
- 12 Working with Dates, Times, Quantities, and Currencies
- 12.1 Dates
- 12.1.1 Date Type Basics
- 12.1.2 Factory Calendars
- 12.1.3 Datum Date Type
- 12.1.4 System Date Fields
- 12.1.5 Date-Limited Records
- 12.2 Times
- 12.2.1 Calculating Time
- 12.2.2 Timestamps
- 12.2.3 SY-UZEIT (System Time versus Local Time)
- 12.3 Quantities
- 12.3.1 Quantity Fields in Data Dictionary
- 12.3.2 Converting Quantities
- 12.4 Currencies
- 12.4.1 Currency Fields in Data Dictionary
- 12.4.2 Converting Currencies
- 12.5 Updating the Shopping Cart Example
- 12.5.1 Updating the Database
- 12.5.2 Updating the Global Class
- 12.5.3 Updating the ABAP Programs
- 12.6 Summary
- 13 User Interface Technologies
- 13.1 Working with Classic Dynpro Screens
- 13.1.1 Dynpro Screen Events
- 13.1.2 Creating a Dynpro Screen
- 13.2 Modern UI Technologies
- 13.2.1 Web Dynpro
- 13.2.2 SAP Screen Personas
- 13.2.3 SAP Gateway, SAPUI5, and SAP Fiori
- 13.3 Summary
- 14 Working with ABAP Professionally
- 14.1 ABAP System Architecture Basics
- 14.2 Transport Management
- 14.3 Authorization Concept
- 14.3.1 Authorization Object
- 14.3.2 Performing an Authorization Check in an ABAP Program
- 14.4 Working with Files
- 14.4.1 Files on the Presentation Server
- 14.4.2 Files on the Application Server
- 14.5 ABAP Development Guidelines
- 14.6 Maintaining Documentation
- 14.7 ABAP Unit Tests
- 14.8 Background Jobs
- 14.9 Tools of the Trade
- 14.10 Backward Compatibility and Dealing with Legacy Code
- 14.11 Summary
- A Preparing Your Development Environment
- A.1 ABAP Developer Edition Overview
- A.2 ABAP Trial System Using SAP CAL
- A.3 ABAP Trial System Using the Download Option
- A.4 Getting Started with ABAP in Eclipse
- A.4.1 Eclipse Workspaces
- A.4.2 Eclipse Perspectives
- A.4.3 ABAP Projects in Eclipse
- A.5 ABAP-Based IDEs
- A.5.1 Transaction SE80
- A.5.2 Other ABAP IDE Transactions
- B Interfaces, Forms, Enhancements
- B.1 Interfaces
- B.1.1 File Interfaces
- B.1.2 Remote Function Call
- B.1.3 IDoc and EDI
- B.1.4 Web Services
- B.2 Output Implementation in SAP ERP
- B.2.1 Output Programs
- B.2.2 Forms
- B.3 Enhancements
- C Differences Between ABAP Versions
- C.1 Release 7.0
- C.2 Release 7.02 (7.0 EHP 2)
- C.3 Release 7.4
- C.4 Release 7.4 SP 5
- C.5 Release 7.4 SP 8
- C.6 Release 7.50
- C.7 Release 7.51
- C.8 Release 7.52
- C.9 Release 7.53
- D Other Resources
- D.1 SAP PRESS Books
- D.2 SAP Community
- D.3 openSAP
- D.4 SAP Certifications
- D.5 SAP TechEd Conferences
- D.6 SAP Community Events
- E The Authors
- Index