Introduction To ABAP

April 20, 2004


A Brief Intro To ABAP/4




  • href="##Introduction"> size=1>Introduction
  • href="##Database_Integration"> size=1>Database Integration
  • href="##Technical_Implementation"> size=1>Technical Implementation
  • href="##Development_Tools"> size=1>Development Tools


Introduction


size=1>ABAP/4 is the language created by SAP AG for
implementation and customization of their R/3 system.

The rough English translation of the acronym would be A Business
Application Programming language, with the 4 indicating that it is a
fourth-generation language.

It is a block-structured language much like Cobol that has
evolved over the years to include modern language constructs like object
oriented techniques.

It contains a moderately rich set of data structures; integers,
“packed” BCD numbers, character strings, dates, times, …

A basic size=1>ABAP program consist of online executable code.
Encapsulation of code is done via performs of internal/external forms. External
processing is also often done via calls to globally defined function modules.

The presentation interface SAPGUI (GUI = Graphical User
Interface) implements the platform-specific input and output functions of an
size=1>ABAP program. The SAP GUI is primarily based on
the Windows Style Guide and is available for several platforms providing the
same functions for each.


Database Integration


In SAP, relational database management systems (RDBMS) like
Oracle are used to manage large sets of data. An RDBMS saves data and
relationships between data in the form of two-dimensional tables. These are
known for their logical simplicity. The data, tables, and table relationships
are defined in the database catalog (the data dictionary) of the database
system.

Interaction between programs and the database system are done
via SAP’s OPEN SQL constructs (e.g. select, modify, delete etc).

Operations which manipulate significant amounts of data and/or
have large amounts of database I/O can make use of internal tables, which are
array structures that are populated with data only at the program run-time.
Using internal tables decreases both the load on the network and on the database
server, and is highly encouraged, at least for moderate quantities of data.
Internal table data is manipulated internally via a set of
size=1>ABAP keywords (e.g. loop at, read etc). In
addition, SAP implements a concept called logical databases for related
multi-table data manipulation.

Extensive OPEN SQL operations are supported; for example a
select statement is represented by a loop structure, where operations are placed
within the loop. e.g. A typical selection would look like:

select * from mytable where key = ‘XYZ’. write: / mytable-key,
mytable-value. perform do_something using mytable-value. endselect.

size=1>ABAP/4 event-driven control structures used to be
predominantly report-driven. Since 4.6C, extensive use has been made of
drill-down capabilities, and new
size=1>ABAP list viewer style reports.


Technical Implementation


size=1>ABAP/4 is a byte-compiled language. The virtual
machine is fairly well hidden from view, but core dumps can be examined, most
commonly via the SAP transaction code ST22. (Learn basic
size=1>ABAP/4 debugging size=1>here).

The core kernal of the language is written predominantly in ‘C’.
Sitting on top of this,
size=1>ABAP/4 is used to implement substantially all of
the visible R/3 system functionality. The R/3 ‘kernel’ represents some (albeit
fairly large) programs written in C that interpret
size=1>ABAP/4 bytecode. There is so much infrastructure
built up around this that most users and indeed many developers are probably not
aware of where or what the kernel is.


Development Tools


The size=1>ABAP/4 dictionary uses standard relational
database concepts to store all master, transactional and configuration data.

A standard function library exists for code encapsulation, and
custom function modules are often written to supplement the processing with user
requirements.

Data conversion is most commonly done via the use of BDC
programs, though a certain level of automation has been achieved from 4.6C on
with the introduction of the LSMW tool.

SAP invariable cannot cater to every user requirement. In cases
where custom development is required, SAP provides ‘user exits’ that allow users
to alter the standard processing.