Blake's SAP ABAP 01-18 Document

SAP PM Prerequisite Modules - Navigational Tutorial and Resources Links
Module Module Name Links Links Blake's Links
PM Plant Mantenance tutorials point   Blake
MM Material Management tutorials point Overview Guru99 Blake: 1-10 | 11-20 | 21-25
SD Sales and Distribution tutorials point Tutorial Guru99 Blake
PP Production Planning tutorials point Tutorial Guru99 Blake | 1-7
External Links
Google NewLanguage.html  FICO Module: Blake's 1-28 29-56 57-66 67-83 : Tutorials Point
  Download Info  ABAP Module: Blake's  1-18  19-36  37-52       : Tutorials Point


SAP ABAP (Advanced Business Application Programming) - ABAP Tutorial and ABAP Resources
1 Home ABAP_Doc     Tutorials Point   19 Tables ABAP_Doc     Tutorials Point   37 Object Orientation ABAP_Doc     Tutorials Point
2 Overview ABAP_Doc     Tutorials Point   20 Structures ABAP_Doc     Tutorials Point   38 Objects ABAP_Doc     Tutorials Point
3 Environment ABAP_Doc     Tutorials Point   21 Views ABAP_Doc     Tutorials Point   39 Classes ABAP_Doc     Tutorials Point
4 Screen Navigation ABAP_Doc     Tutorials Point   22 Search Help ABAP_Doc     Tutorials Point   40 Inheritance ABAP_Doc     Tutorials Point
5 Basic Syntax ABAP_Doc     Tutorials Point   23 Lock Objects ABAP_Doc     Tutorials Point   41 Polymorphism ABAP_Doc     Tutorials Point
6 Data Types ABAP_Doc     Tutorials Point   24 Modularization ABAP_Doc     Tutorials Point   42 Encapsulation ABAP_Doc     Tutorials Point
7 Variables ABAP_Doc     Tutorials Point   25 Subroutines ABAP_Doc     Tutorials Point   43 Interfaces ABAP_Doc     Tutorials Point
8 Constants & Literals ABAP_Doc     Tutorials Point   26 Macros ABAP_Doc     Tutorials Point   44 Object Events ABAP_Doc     Tutorials Point
9 Operators ABAP_Doc     Tutorials Point   27 Function Modules ABAP_Doc     Tutorials Point   45 Report Programming ABAP_Doc     Tutorials Point
10 Loop Control ABAP_Doc     Tutorials Point   28 Include Programs ABAP_Doc     Tutorials Point   46 Dialog Programming ABAP_Doc     Tutorials Point
11 Decisions ABAP_Doc     Tutorials Point   29 Open SQL Overview ABAP_Doc     Tutorials Point   47 Smart Forms ABAP_Doc     Tutorials Point
12 Strings ABAP_Doc     Tutorials Point   30 Native SQL Overview ABAP_Doc     Tutorials Point   48 SAPscripts ABAP_Doc     Tutorials Point
13 Date & Time ABAP_Doc     Tutorials Point   31 Internal Tables ABAP_Doc     Tutorials Point   49 Customer Exits ABAP_Doc     Tutorials Point
14 Formatting Data ABAP_Doc     Tutorials Point   32 Creating Internal Tables ABAP_Doc     Tutorials Point   50 User Exits ABAP_Doc     Tutorials Point
15 Exception Handling ABAP_Doc     Tutorials Point   33 Populating Internal Tables ABAP_Doc     Tutorials Point   51 Business Add-Ins ABAP_Doc     Tutorials Point
16 Dictionary ABAP_Doc     Tutorials Point   34 Copying Internal Tables ABAP_Doc     Tutorials Point   52 SAP ABAP - Web Dynpro ABAP_Doc     Tutorials Point
17 Domains ABAP_Doc     Tutorials Point   35 Reading Internal Tables ABAP_Doc     Tutorials Point        
18 Data Elements ABAP_Doc     Tutorials Point   36 Deleting Internal Tables ABAP_Doc     Tutorials Point        

(01) SAP ABAP - Home

SAP ABAP Tutorial



(02) SAP ABAP - Overview

ABAP stands for Advanced Business Application Programming, a 4GL (4th generation) language. Currently it is positioned, along with Java, as the main language for SAP application server programming.

Let's start with the high level architecture of SAP system. The 3-tier Client/Server architecture of a typical SAP system is depicted as follows.

3-tier Client/Server Architecture

The Presentation layer consists of any input device that can be used to control SAP system. This could be a web browser, a mobile device and so on. All the central processing takes place in Application server. The Application server is not just one system in itself, but it can be multiple instances of the processing system. The server communicates with the Database layer that is usually kept on a separate server, mainly for performance reasons and also for security. Communication happens between each layer of the system, from the Presentation layer to the Database and then back up the chain.

Note − ABAP programs run at the application server level. Technical distribution of software is independent of its physical location. It means basically all three levels can be installed on top of each other on one computer or each level can be installed on a different computer or a server.

ABAP programs reside inside the SAP database. They execute under the control of the runtime system that is a part of the SAP kernel. The run-time system processes all ABAP statements, controlling the flow logic and responding to user events.

So, unlike C++ and Java, ABAP programs are not stored in separate external files. Inside the database, ABAP code exists in two forms −

The run-time system can be considered as a virtual machine, just similar to Java virtual machine. A key component of the ABAP run-time system is the database interface that turns database independent statements (Open SQL) into the statements understood by the underlying database (Native SQL). SAP can work with a wide variety of databases and the same ABAP program can run on all of those.

(03) SAP ABAP - Environment

Reports are a good starting point for familiarizing yourself with general ABAP principles and tools. ABAP reports are used in many areas. In this chapter, we will see how easy it is to write a simple ABAP Report.

Hello ABAP

Let's get started with the common "Hello World" example.

Each ABAP statement starts with an ABAP keyword and ends with a period. Keywords must be separated by at least one space. It does not matter whether or not you use one or several lines for an ABAP statement.

You need to enter your code using the ABAP Editor that is a part of ABAP Tools delivered with the SAP NetWeaver Application Server ABAP (also known as ‘AS ABAP’).

‘AS ABAP’ is an application server with its own database, ABAP run-time environment, and ABAP development tools such as ABAP Editor. The AS ABAP offers a development platform that is independent of hardware, operating system, and database.

Using the ABAP Editor

Step 1 − Start the transaction SE38 to navigate to the ABAP Editor (discussed in the next chapter). Let's start creating a report that is one of the many ABAP objects.

Step 2 − On the initial screen of the editor, specify the name of your report in the input field PROGRAM. You may specify the name as ZHELLO1. The preceding Z is important for the name. Z ensures that your report resides in the customer namespace.

The customer namespace includes all objects with the prefix Y or Z. It is always used when customers or partners create objects (like a report) to differentiate these objects from objects of SAP and to prevent name conflicts with objects.

Step 3 − You may type the report name in lower case letters, but the editor will change it to upper case. So the names of ABAP objects are ‘Not’ case sensitive.

Step 4 − After specifying the name of the report, click the CREATE button. A popup window ABAP: PROGRAM ATTRIBUTES will pop up and you will provide more information about your report.

Step 5 − Choose "Executable Program" as the report type, enter the title “My First ABAP Report” and then select SAVE to continue. The CREATE OBJECT DIRECTORY ENTRY window will pop up next. Select the button LOCAL OBJECT and the popup will close.

You can complete your first report by entering the WRITE statement below the REPORT statement, so that the complete report contains just two lines as follows −


Starting the Report

We can use the keyboard (Ctrl + S) or the save icon (right hand side beside the command field) to save the report. ABAP development takes place in AS ABAP.

Starting the report is as simple as saving it. Click the ACTIVATION button (left hand side next to the start icon) and start the report by using the icon DIRECT PROCESSING or the F8 function key. The title "My First ABAP Report" along with the output “Hello World” is displayed as well. Here is the output −

My First ABAP Report  Hello World  

As long as you do not activate a new report or activate a change to an existing report, it is not relevant to their users. This is important in a central development environment where you may work on objects that other developers use in their projects.

Viewing the Existing Code

If you look at the field Program and double-click on the value ZHELLO1, the ABAP editor will display the code for your report. This is called Forward Navigation. Double clicking on an object's name opens that object in the appropriate tool.

(04) SAP ABAP - Screen Navigation

In order to understand SAP ABAP, you need to have basic knowledge of screens like Login, ABAP Editor, Logout and so on. This chapter focuses on screen navigation and the standard toolbar functionality.

Login Screen

After you log on to SAP server, SAP login screen will prompt for User ID and Password. You need to provide a valid user ID and Password and press Enter (the user id and password is provided by system administrator). Following is the login screen.






(05) SAP ABAP - Basic Syntax

(06) SAP ABAP - Data Types


(07) SAP ABAP - Variables


(08) SAP ABAP - Constants & Literals


(09) SAP ABAP - Operators

(10) SAP ABAP - Loop Control


(11) SAP ABAP - Decisions


(12) SAP ABAP - Strings


(13) SAP ABAP - Date & Time

(14) SAP ABAP - Formatting Data


(15) SAP ABAP - Exception Handling


(16) SAP ABAP - Dictionary


(17) SAP ABAP - Domains

(18) SAP ABAP - Data Elements