ABAP (Advanced Business Application Programming, originally ''Allgemeiner Berichts-Aufbereitungs-Prozessor'', German for "general report preparation processor") is a
high-level programming language
In computer science, a high-level programming language is a programming language with strong Abstraction (computer science), abstraction from the details of the computer. In contrast to low-level programming languages, it may use natural language ...
created by the German
software
Software is a set of computer programs and associated documentation and data. This is in contrast to hardware, from which the system is built and which actually performs the work.
At the lowest programming level, executable code consists ...
company
SAP SE
Sap is a fluid transported in xylem cells (vessel elements or tracheids) or phloem sieve tube elements of a plant. These cells transport water and nutrients throughout the plant.
Sap is distinct from latex, resin, or cell sap; it is a sepa ...
. It is currently positioned, alongside
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
, as the language for programming the
SAP NetWeaver Application Server
SAP NetWeaver Application Server or SAP Web Application Server is a component of SAP NetWeaver which works as a web application server for SAP products.
All ABAP application servers including the message server represent the application layer of th ...
, which is part of the
SAP NetWeaver
SAP NetWeaver is a software stack for many of SAP SE's applications. The SAP NetWeaver Application Server, sometimes referred to as WebAS, is the runtime environment for the SAP applications and all of the mySAP Business Suite runs on SAP WebAS: s ...
platform for building business applications.
Introduction
ABAP is one of the many application-specific fourth-generation languages (
4GLs) first developed in the 1980s. It was originally the report language for
SAP R/2, a platform that enabled large corporations to build mainframe business applications for materials management and financial and management accounting.
ABAP used to be an abbreviation of ''Allgemeiner Berichts-Aufbereitungs-Prozessor'', German for "generic report preparation processor", but was later renamed to the English ''Advanced Business Application Programming''. ABAP was one of the first languages to include the concept of ''Logical Databases'' (LDBs), which provides a high level of abstraction from the basic database level(s),which supports every platform, language and units.
The ABAP language was originally used by developers to develop the
SAP R/3 SAP R/3 is the former name of the enterprise resource planning software produced by the German corporation SAP AG (now SAP SE). It is an enterprise-wide information system designed to coordinate all the resources, information, and activities needed ...
platform. It was also intended to be used by SAP customers to enhance SAP applications – customers can develop custom reports and interfaces with ABAP programming. The language was geared towards more technical customers with programming experience.
ABAP remains as the language for creating programs for the client–server
R/3 system, which SAP first released in 1992. As computer hardware evolved through the 1990s, more and more of SAP's applications and systems were written in ABAP. By 2001, all but the most basic functions were written in ABAP. In 1999, SAP released an object-oriented extension to ABAP called ABAP Objects, along with R/3 release 4.6.
SAP's current development platform
NetWeaver
SAP NetWeaver is a software stack for many of SAP SE's applications. The SAP NetWeaver Application Server, sometimes referred to as WebAS, is the runtime environment for the SAP applications and all of the mySAP Business Suite runs on SAP WebAS: s ...
supports both ABAP and
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
.
ABAP has an abstraction between the business applications, the operating system and database. This ensures that applications do not depend directly upon a specific server or database platform and can easily be ported from one platform to another.
SAP Netweaver currently runs on
UNIX
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
(
AIX
Aix or AIX may refer to:
Computing
* AIX, a line of IBM computer operating systems
*An Alternate Index, for a Virtual Storage Access Method Key Sequenced Data Set
* Athens Internet Exchange, a European Internet exchange point
Places Belgi ...
,
HP-UX
HP-UX (from "Hewlett Packard Unix") is Hewlett Packard Enterprise's proprietary implementation of the Unix operating system, based on Unix System V (initially System III) and first released in 1984. Current versions support HPE Integrity Ser ...
,
Solaris
Solaris may refer to:
Arts and entertainment Literature, television and film
* ''Solaris'' (novel), a 1961 science fiction novel by Stanisław Lem
** ''Solaris'' (1968 film), directed by Boris Nirenburg
** ''Solaris'' (1972 film), directed by ...
,
Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
),
Microsoft Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
,
i5/OS on
IBM System i
The IBM AS/400 (Application System/400) is a family of midrange computers from IBM announced in June 1988 and released in August 1988. It was the successor to the System/36 and System/38 platforms, and ran the OS/400 operating system. Lower-cost ...
(formerly iSeries, AS/400), and
z/OS
z/OS is a 64-bit operating system for IBM z/Architecture mainframes, introduced by IBM in October 2000. It derives from and is the successor to OS/390, which in turn was preceded by a string of MVS versions.Starting with the earliest:
* O ...
on
IBM System z
IBM Z is a family name used by IBM for all of its z/Architecture mainframe computers.
In July 2017, with another generation of products, the official family was changed to IBM Z from IBM z Systems; the IBM Z family now includes the newest mod ...
(formerly zSeries, S/390). Supported databases are
HANA
Hana or HANA may refer to:
Places Europe
* Haná, an ethnic region in Moravia, Czech Republic
* Traianoupoli, Greece, called Hana during the Ottoman period
* Hana, Norway, a borough in the city of Sandnes, Norway
West Asia
* Hana, Iran, a ci ...
, SAP ASE (formerly Sybase),
IBM Db2
Db2 is a family of data management products, including database servers, developed by IBM. It initially supported the relational model, but was extended to support object–relational features and non-relational structures like JSON a ...
,
Informix
IBM Informix is a product family within IBM's Information Management division that is centered on several relational database management system (RDBMS) offerings. The Informix products were originally developed by Informix Corporation, whose ...
,
MaxDB
MaxDB is an ANSI SQL-92 (entry level) compliant relational database management system ( RDBMS) from SAP AG, which was also delivered by MySQL AB from 2003 to 2007. MaxDB is targeted for large SAP environments e.g. mySAP Business Suite, and othe ...
,
Oracle
An oracle is a person or agency considered to provide wise and insightful counsel or prophetic predictions, most notably including precognition of the future, inspired by deities. As such, it is a form of divination.
Description
The word '' ...
, and
Microsoft SQL Server
Microsoft SQL Server is a relational database management system developed by Microsoft. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applications—which ma ...
(support for Informix was discontinued in SAP Basis release 7.00).
ABAP runtime environment
All ABAP programs reside inside the SAP database. They are not stored in separate external files like Java or C++ programs. In the database all ABAP code exists in two forms: source code, which can be viewed and edited with the ABAP Workbench tools; and generated code, a binary representation somewhat comparable with
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
bytecode. ABAP programs execute under the control of the runtime system, which is part of the SAP kernel. The runtime system is responsible for processing ABAP statements, controlling the flow logic of screens and responding to events (such as a user clicking on a screen button); in this respect it can be seen as a
Virtual Machine
In computing, a virtual machine (VM) is the virtualization/emulation of a computer system. Virtual machines are based on computer architectures and provide functionality of a physical computer. Their implementations may involve specialized hardw ...
comparable with the Java VM. A key component of the ABAP runtime system is the Database Interface, which turns database-independent ABAP statements ("Open SQL") into statements understood by the underlying DBMS ("Native SQL"). The database interface handles all the communication with the relational database on behalf of ABAP programs; It also contains extra features such as buffering of tables and frequently accessed data in the local memory of the application server.
SAP systems and landscapes
All SAP data exists and all SAP software runs in the context of a ''SAP system''. A system consists of a central relational database and one or more application ("instances") accessing the data and programs in this database. A SAP system contains at least one instance but may contain more, mostly for reasons of sizing and performance. In a system with multiple instances, load balancing mechanisms ensure that the load is spread evenly over the available application servers.
Installations of the
Web Application Server (''landscapes'') typically consist of three systems: one for development; one for testing and quality assurance; and one for production. The landscape may contain more systems (e.g., separate systems for unit testing and pre-production testing) or it may contain fewer (e.g., only development and production, without separate QA); nevertheless three is the most common configuration. ABAP programs are created and undergo first testing in the development system. Afterwards they are distributed to the other systems in the landscape. These actions take place under control of the Change and Transport System (CTS), which is responsible for concurrency control (e.g., preventing two developers from changing the same code at the same time), version management, and deployment of programs on the QA and production systems.
The
Web Application Server consists of three layers: the database layer; the application layer; and the presentation layer. These layers may run on the same or on different physical machines. The ''database layer'' contains the relational database and the database software. The ''application layer'' knowledge contains the instance or instances of the system. All application processes, including the business transactions and the ABAP development, run on the application layer. The ''presentation layer'' handles the interaction with users of the system. Online access to ABAP application servers can go via a proprietary graphical interface, which is called "SAP GUI", or via a Web browser.
Software layers
ABAP software is deployed in software components.
Examples for these are:
* SAP_BASIS is the technical base layer which is required in every ABAP system.
* SAP_ABA contains functionalities which is required for all kinds of business applications, like business partner and address management.
* SAP_UI provides the functionality to create SAP UI5 applications.
* BBPCRM is an example for a business application, in this case the CRM application
*SAP ABAP is an ERP programming language.
Transactions
A transaction in SAP terminology is the execution of a program. The normal way of executing ABAP code in the SAP system is by entering a transaction code (for instance, VA01 is the transaction code for "Create Sales Order"). Transactions can be called via system-defined or user-specific, role-based menus. They can also be started by entering the transaction code directly into a command field, which is present in every SAP screen. Transactions can also be invoked programmatically by means of the ABAP statements CALL TRANSACTION and LEAVE TO TRANSACTION.
The general notion of a
transaction is called a Logical Unit of Work (LUW) in SAP terminology; the short form of transaction code is ''T-code''.
Types of ABAP programs
As in other programming languages, an ABAP program is either an executable unit or a library, which provides reusable code to other programs and is not independently executable.
ABAP distinguishes two types of executable programs:
* Reports
* Module pools
Reports follow a relatively simple programming model whereby a user optionally enters a set of parameters (e.g., a selection over a subSET of data) and the program then uses the input parameters to produce a report in the form of an interactive list. The term "report" can be somewhat misleading in that reports can also be designed to ''modify'' data; the reason why these programs are called reports is the "list-oriented" nature of the output they produce.
Module pools define more complex patterns of user interaction using a collection of screens. The term “screen” refers to the actual, physical image that the user sees. Each screen also has a "flow logic", which refers to the ABAP code implicitly invoked by the screens, which is divided into a "PBO" (Process Before Output) and "PAI" (Process After Input) section. In SAP documentation the term “dynpro” (dynamic program) refers to the combination of the screen and its flow logic.
The non-executable program types are:
* INCLUDE modules - These get included at generation time into the calling unit; it is often used to subdivide large programs.
* Subroutine pools - These contain ABAP subroutines (blocks of code enclosed by FORM/ENDFORM statements and invoked with PERFORM).
* Function groups - These are libraries of self-contained function modules (enclosed by FUNCTION/ENDFUNCTION and invoked with CALL FUNCTION).
* Object classes - These are similar to Java classes and interfaces; the first define a set of methods and attributes, the second contain "empty" method definitions, for which any class implementing the interface must provide explicit code.
* Interfaces - Same as object classes
* Type pools - These define collections of data types and constants.
ABAP programs are composed of individual sentences (statements). The first word in a statement is called an ABAP keyword. Each statement ends with a period. Words must always be separated by at least one space. Statements can be indented as you wish. With keywords, additions and operands, the ABAP runtime system does not differentiate between upper and lowercase.
Statements can extend beyond one line. You can have several statements in a single line (though this is not recommended). Lines that begin with asterisk * in the first column are recognized as comment lines by the ABAP runtime system and are ignored. Double quotations marks (") indicate that the remainder of a line is a comment.
Development environment
There are two possible ways to develop in ABAP. The availability depends on the release of the ABAP system.
ABAP Workbench
The ABAP Workbench is part of the ABAP system and is accessed via
SAP GUI
SAP GUI is the graphical user interface client in SAP ERP's 3-tier architecture of database, application server and client. It is software that runs on a Microsoft Windows, Apple Macintosh or Unix desktop, and allows a user to access SAP functi ...
. It contains different tools for editing programs. The most important of these are (transaction codes are shown in parentheses):
* ''ABAP Editor'' for writing and editing reports, module pools, includes and subroutine pools (SE38)
* ''ABAP Dictionary'' for processing database table definitions and retrieving global types (SE11)
* ''Menu Painter'' for designing the user interface (menu bar, standard toolbar, application toolbar, function key assignment) (SE41)
* ''Screen Painter'' for designing screens and flow logic (SE51)
* ''Function Builder'' for function modules (SE37)
* ''Class Builder'' for ABAP Objects classes and interfaces (SE24)
The ''Object Navigator'' (transaction SE80) provides a single integrated interface into these various tools.
ABAP Development Tools
The ABAP Development Tools (ADT), formally known as "ABAP in Eclipse", is a set of plugins for the
Eclipse platform to develop ABAP.
In this scenario, the ABAP developer installs the required tools on his computer and works locally, whereas a continuous synchronization with the backend is performed.
ABAP Dictionary
The ABAP Dictionary contains all metadata about the data in the SAP system. It is closely linked with the ABAP Workbench in that any reference to data (e.g., a table, a view, or a data type) will be obtained from the dictionary. Developers use the ABAP Dictionary transactions (directly or through the SE80 Object Navigator inside the ABAP Workbench) to display and maintain this metadata.
When a dictionary object is changed, a program that references the changed object will automatically reference the new version the next time the program runs. Because ABAP is interpreted, it is not necessary to recompile programs that reference changed dictionary objects.
A brief description of the most important types of dictionary objects follows:
* ''Tables'' are data containers that exist in the underlying relational database. In the majority of cases there is a 1-to-1 relationship between the definition of a table in the ABAP Dictionary and the definition of that same table in the database (same name, same columns). These tables are known as "transparent". There are two types of non-transparent tables: "pooled" tables exist as independent entities in the ABAP Dictionary but they are grouped together in large physical tables ("pools") at the database level. Pooled tables are often small tables holding for example configuration data. "Clustered" tables are physically grouped in "clusters" based on their primary keys; for instance, assume that a clustered table ''H'' contains "header" data about sales invoices, whereas another clustered table ''D'' holds the invoice line items. Each row of H would then be physically grouped with the related rows from D inside a "cluster table" in the database. This type of clustering, which is designed to improve performance, also exists as native functionality in some, though not all, relational database systems.
* ''Indexes'' provide accelerated access to table data for often used selection conditions. Every SAP table has a "primary index", which is created implicitly along with the table and is used to enforce primary key uniqueness. Additional indexes (unique or non-unique) may be defined; these are called "secondary indexes".
* ''Views'' have the same purpose as in the underlying database: they define subsets of columns (and/or rows) from one or - using a join condition - several tables. Since views are virtual tables (they refer to data in other tables) they do not take a substantial amount of space.
* ''Structures'' are complex data types consisting of multiple fields (comparable to ''struct'' in C/C++).
* ''Data elements'' provide the semantic content for a table or structure field. For example, dozens of tables and structures might contain a field giving the price (of a finished product, raw material, resource, ...). All these fields could have the same data element "PRICE".
* ''Domains'' define the structural characteristics of a data element. For example, the data element PRICE could have an assigned domain that defines the price as a numeric field with two decimals. Domains can also carry semantic content in providing a list of possible values. For example, a domain "BOOLEAN" could define a field of type "character" with length 1 and case-insensitive, but would also restrict the possible values to "T" (true) or "F" (false).
* ''Search helps'' (successors to the now obsolete "matchcodes") provide advanced search strategies when a user wants to see the possible values for a data field. The ABAP runtime provides implicit assistance (by listing all values for the field, e.g. all existing customer numbers) but search helps can be used to refine this functionality, e.g. by providing customer searches by geographical location, credit rating, etc.
* ''Lock objects'' implement application-level locking when changing data.
ABAP syntax
This brief description of the ABAP syntax begins with the ubiquitous "
Hello world
''Hello'' is a salutation or greeting in the English language. It is first attested in writing from 1826. Early uses
''Hello'', with that spelling, was used in publications in the U.S. as early as the 18 October 1826 edition of the ''Norwich C ...
" program.
Hello world
REPORT TEST.
WRITE 'Hello World'.
This example contains two statements:
REPORT
and
WRITE
. The program displays a list on the screen. In this case, the list consists of the single line "Hello World". The
REPORT
statement indicates that this program is a report. This program could be a module pool after replacing the
REPORT
statement with
PROGRAM
.
Chained statements
Consecutive statements with an identical first (leftmost) part can be combined into a "chained" statement using the chain operator
:
. The common part of the statements is written to the left of the colon, the differing parts are written to the right of the colon and separated by commas. The colon operator is attached directly to the preceding token, without a space (the same applies to the commas in the token list on, as can be seen in the examples below).
Chaining is often used in
WRITE
statements.
WRITE
accepts just one argument, so if for instance you wanted to display three fields from a structure called FLIGHTINFO, you would have to code:
WRITE FLIGHTINFO-CITYFROM.
WRITE FLIGHTINFO-CITYTO.
WRITE FLIGHTINFO-AIRPTO.
Chaining the statements results in a more readable and more intuitive form:
WRITE: FLIGHTINFO-CITYFROM, FLIGHTINFO-CITYTO, FLIGHTINFO-AIRPTO.
In a chain statement, the first part (before the colon) is not limited to the statement name alone. The entire common part of the consecutive statements can be placed before the colon. Example:
REPLACE 'A' WITH 'B' INTO LASTNAME.
REPLACE 'A' WITH 'B' INTO FIRSTNAME.
REPLACE 'A' WITH 'B' INTO CITYNAME.
could be rewritten in chained form as:
REPLACE 'A' WITH 'B' INTO: LASTNAME, FIRSTNAME, CITYNAME.
Comments
ABAP has 2 ways of defining text as a
comment
Comment may refer to:
* Comment (linguistics) or rheme, that which is said about the topic (theme) of a sentence
* Bernard Comment (born 1960), Swiss writer and publisher
Computing
* Comment (computer programming), explanatory text or informa ...
:
* An
asterisk
The asterisk ( ), from Late Latin , from Ancient Greek , ''asteriskos'', "little star", is a typographical symbol. It is so called because it resembles a conventional image of a heraldic star.
Computer scientists and mathematicians often voc ...
(*) in the leftmost column of a line makes the entire line a comment
* A
double quotation mark
Quotation marks (also known as quotes, quote marks, speech marks, inverted commas, or talking marks) are punctuation marks used in pairs in various writing systems to set off direct speech, a quotation, or a phrase. The pair consists of an ...
(") anywhere on a line makes the rest of that line a comment
Example:
***************************************
** Program: BOOKINGS **
** Author: Joe Byte, 07-Jul-2007 **
***************************************
REPORT BOOKINGS.
* Read flight bookings from the database
SELECT * FROM FLIGHTINFO
WHERE CLASS = 'Y' "Y = economy
OR CLASS = 'C'. "C = business
(...)
Spaces
Code in ABAP is whitespace-sensitive.
x = a+b(c).
assigns to variable x the substring of the variable a, starting from b with the length defined by the variable c.
x = a + b( c ).
assigns to variable x the sum of the variable a and the result of the call to method b with the parameter c.
ABAP statements
In contrast with languages like C/C++ or Java, which define a limited set of language-specific statements and provide most functionality via libraries, ABAP contains an extensive amount of built-in statements. These statements traditionally used sentence-like structures and avoided symbols, making ABAP programs relatively verbose. However, in more recent versions of the ABAP language, a terser style is possible.
An example of statement based syntax (whose syntax originates in COBOL) versus expression-based syntax (as in C/Java):
ADD TAX TO PRICE.
* is equivalent to
PRICE = PRICE + TAX .
Data types and variables
ABAP provides a set of built-in data types. In addition, every structure, table, view or data element defined in the ABAP Dictionary can be used to type a variable. Also, object classes and interfaces can be used as types.
The built-in data types are:
Date variables or constants (type D) contain the number of days since January 1, 1 AD. Time variables or constants (type T) contain the number of seconds since midnight. A special characteristic of both types is that they can be accessed both as integers and as character strings (with internal format "YYYYMMDD" for dates and "hhmmss" for times), which can be used for date and time handling. For example, the code snippet below calculates the last day of the previous month (note: SY-DATUM is a system-defined variable containing the current date):
DATA LAST_EOM TYPE D. "last end-of-month date
* Start from today's date
LAST_EOM = SY-DATUM.
* Set characters 6 and 7 (0-relative) of the YYYYMMDD string to "01",
* giving the first day of the current month
LAST_EOM+6(2) = '01'.
* Subtract one day
LAST_EOM = LAST_EOM - 1.
WRITE: 'Last day of previous month was', LAST_EOM.
All ABAP variables have to be explicitly
declared in order to be used. They can be declared either with individual statements and explicit typing or, since ABAP 7.40, inline with
inferred typing.
Explicitly typed declaration
Normally all declarations are placed at the top of the code module (program, subroutine, function) before the first executable statement; this placement is a convention and not an enforced syntax rule. The declaration consists of the name, type, length (where applicable), additional modifiers (e.g. the number of implied decimals for a packed decimal field) and optionally an initial value:
* Primitive types:
DATA: COUNTER TYPE I,
VALIDITY TYPE I VALUE 60,
TAXRATE(3) TYPE P DECIMALS 1,
LASTNAME(20) TYPE C,
DESCRIPTION TYPE STRING.
* Dictionary types:
DATA: ORIGIN TYPE COUNTRY.
* Internal table:
DATA: T_FLIGHTS TYPE TABLE OF FLIGHTINFO,
T_LOOKUP TYPE HASHED TABLE OF FLT_LOOKUP.
* Objects:
DATA: BOOKING TYPE REF TO CL_FLT_BOOKING.
Notice the use of the colon to chain together consecutive DATA statements.
Inline declaration
Since ABAP 7.40, variables can b
declared inlinewith the following syntax:
DATA(variable_name) = 'VALUE'.
For this type of declaration it must be possible to infer the type statically, e.g. by
method signature or database table structure.
This syntax is also possible in OpenSQL statements:
SELECT * FROM ekko into @DATA(lt_ekko) WHERE ebeln EQ @lv_ebeln.
ABAP Objects
The ABAP language supports
object-oriented programming
Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of pr ...
, through a feature known as "ABAP Objects". This helps to simplify applications and make them more controllable.
ABAP Objects is fully compatible with the existing language, so one can use existing statements and modularization units in programs that use ABAP Objects, and can also use ABAP Objects in existing ABAP programs. Syntax checking is stronger in ABAP Objects programs, and some syntactical forms (usually older ones) of certain statements are not permitted.
Objects form a capsule which combines the character to the respective behavior. Objects should enable programmers to map a real problem and its proposed software solution on a one-to-one basis. Typical objects in a business environment are, for example, ‘Customer’, ‘Order’, or ‘Invoice’. From Release 3.1 onwards, the Business Object Repository (BOR) of SAP Web Application Server ABAP has contained examples of such objects. The BOR object model will be integrated into ABAP Objects in the next Release by migrating the BOR object types to the ABAP class library.
A comprehensive introduction to object orientation as a whole would go far beyond the limits of this introduction to ABAP Objects. This documentation introduces a selection of terms that are used universally in object orientation and also occur in ABAP Objects. In subsequent sections, it goes on to discuss in more detail how these terms are used in ABAP Objects. The end of this section contains a list of further reading, with a selection of titles about object orientation.
* ''Objects'' are instances of classes. They contain data and provide services. The data forms the attributes of the object. The services are known as methods (also known as operations or functions). Typically, methods operate on private data (the attributes, or state of the object), which is only visible to the methods of the object. Thus the attributes of an object cannot be changed directly by the user, but only by the methods of the object. This guarantees the internal consistency of the object.
* ''Classes'' describe objects. From a technical point of view, objects are runtime instances of a class. In theory, any number of objects based on a single class may be created. Each instance (object) of a class has a unique identity and its own set of values for its attributes.
* ''Object References'' are unique addresses that may be used to identify and point to objects in a program. Object references allow access to the attributes and methods of an object.
In object-oriented programming, objects usually have the following properties:
* Encapsulation - Objects restrict the visibility of their resources (attributes and methods) to other users. Every object has an interface, which determines how other objects can interact with it. The implementation of the object is encapsulated, that is, invisible outside the object itself.
* Inheritance - An existing class may be used to derive a new class. Derived classes inherit the data and methods of the superclass. However, they can overwrite existing methods, and also add new ones.
* Polymorphism - Identical (identically-named) methods behave differently in different classes. In ABAP Objects, polymorphism is implemented by redefining methods during inheritance and by using constructs called interfaces.
CDS Views
The ABAP Core Data Services (ABAP CDS) are the implementation of the general CDS concept for AS ABAP. ABAP CDS makes it possible to define semantic data models on the central database of the application server. On AS ABAP, these models can be defined independently of the database system. The entities of these models provide enhanced access functions when compared with existing database tables and views defined in ABAP Dictionary, making it possible to optimize Open SQL-based applications. This is particularly clear when an AS ABAP uses a SAP HANA database, since its in-memory characteristics can be implemented in an optimum manner.
The data models are defined using the data definition language (DDL) and data control language (DCL) provided in the ABAP CDS in the ABAP CDS syntax. The objects defined using these languages are integrated into ABAP Dictionary and managed here too.
CDS source code can only be programmed in the Eclipse-based ABAP Development Tools (ADT). The Data Definition Language (DDL) and the Data Control Language (DCL) use different editors.
Features
Internal tables in ABAP
Internal tables are an important feature of the ABAP language. An internal table is defined similarly to a vector of ''struct''s in C++ or a vector of objects in Java. The main difference with these languages is that ABAP provides a collection of statements to easily access and manipulate the contents of internal tables. Note that ABAP does not support arrays; the only way to define a multi-element data object is to use an internal table.
Internal tables are a way to store variable data sets of a fixed structure in the working memory of ABAP, and provides the functionality of dynamic arrays. The data is stored on a row-by-row basis, where each row has the same structure.
Internal tables are preferably used to store and format the content of database tables from within a program. Furthermore, internal tables in connection with structures are an important means of defining complex data structures in an ABAP program.
The following example defines an internal table with two fields with the format of database table VBRK.
* First define structured type
TYPES: BEGIN OF t_vbrk,
VBELN TYPE VBRK-VBELN,
ZUONR TYPE VBRK-ZUONR,
END OF t_vbrk.
* Now define internal table of our defined type t_vbrk
DATA : gt_vbrk TYPE STANDARD TABLE OF t_vbrk,
gt_vbrk_2 TYPE STANDARD TABLE OF t_vbrk. "easy to define more tables
* If needed, define structure (line of internal table)
* Definition with type or with reference to internal table:
DATA : gs_vbrk TYPE t_vbrk,
gs_vbrk_2 LIKE LINE OF gt_vbrk_2.
* You can also define table type if needed
TYPES tt_vbrk TYPE STANDARD TABLE OF t_vbrk.
History
The following list only gives a rough overview about some important milestones in the history of the language ABAP. For more details, se
ABAP - Release-Specific Changes
See also
*
ERP software
Enterprise resource planning (ERP) is the integrated management of main business processes, often in real time and mediated by software and technology. ERP is usually referred to as a category of business management software—typically a sui ...
*
Secure Network Communications
SAP NetWeaver is a software stack for many of SAP SE's applications. The SAP NetWeaver Application Server, sometimes referred to as WebAS, is the runtime environment for the SAP applications and all of the mySAP Business Suite runs on SAP WebAS: ...
*
SAP Logon Ticket
SAP Logon Tickets represent user credentials in SAP systems. When enabled, users can access multiple SAP applications and services through SAP GUI and web browsers without further username and password inputs from the user. SAP Logon Tickets can a ...
*
Single sign-on
Single sign-on (SSO) is an authentication scheme that allows a user to log in with a single ID to any of several related, yet independent, software systems.
True single sign-on allows the user to log in once and access services without re-enterin ...
References
External links
ABAP — Keyword DocumentationSAP Help PortalABAP Developmentdiscussions, blogs, documents and videos on th
SAP Community Network (SCN)
{{Authority control
Cross-platform software
Fourth-generation programming languages
SAP SE