Introduction ABAP Programs
Slide 2
ABAP (History) Acronym:
Allgemeiner BerichtsAufbereitungsProzessor
Generic report preparation rocessor Advanced Business Application Programming
Created back in the 1980s Looks very much like COBOL SAP itself, is written in ABAP
Slide 3
ABAP Editor(Creating the Code) My opinion – it’s a pretty good
development environment Supports intellisense, code highlighting,
and a robust debugger Most of you have never seen COBOL,
but it looks like COBOL!
Slide 4
Introduction to the ABAP Editor It’s a unified interface for creating,
debugging, deploying, … ABAP programs
Use transaction code SE38
Slide 5
Activation Note that you must activate ABAP with
the keys I gave you before you use the software for the first time.
Slide 6
Review (A First ABAP Program -1) Create a program
Slide 7
Review (A First ABAP Program -2) Edit the program statements
Slide 8
Review (A First ABAP Program -3) Activate the application (Program /
Activate)
Slide 9
Review (A First ABAP Program -4) Run it (F8) or (Program / Test / Direct
Processing A first report is displayed
Slide 10
APAP Program Attributes (Introduction) Every program that you create has
metadata
Slide 11
APAP Program Attributes (Program Type) ABAP has it’s own program types Executable programs can be run
independently of a transaction code Remember program types from the last
lecture Our first program will be an executable
program Module Pools are made up of
processing steps and are executed from a transaction code
And other types of programs
Slide 12
APAP Program Attributes (Program Status / Application) Program status controls whether the
program is a test (local)program deployed to production systems
Application controls where in the SAP hierarchy the program “lives”
Slide 13
ABAP Program Attributes(Package) A program belongs to a package and
has an owner The package is defined when the program
is saved for the first time Use package $TMP for our “local”
packages SAP packages, in the simplest case,
allow you group code (applications) together
Slide 14
ABAP Program Attributes (Package) Use Local Page $TMP for our work
Slide 15
The ABAP Editor It’s Visual Studio for SAP
A code editor The clipboard works as we would expect Works as you would expect A list of icons appears on pages 77-79
Only activated programs can be run
Slide 16
ABAP Program Names SAP has naming conventions for
programs Local programs should ALWAYS begin
with the letter Z (for customer)
Slide 17
ABAP Syntax (Introduction) Like most programming language, we
have statements as the atomic unit of work ABAP statements always end with a period
(thanks COBOL)
Slide 18
ABAP Syntax (Getting Help) Highlight a keyword in the Code Editor
and press F1 to get the keyword documentation
Slide 19
ABAP Keywords (REPORT) REPORT rep.
It’s the first statement in an executable program
It can also be replaced with the keyword PROGRAM
Following the report keyword appears the report name
Example
Slide 20
ABAP Keywords (WRITE 1) The statement writes the content to the
output stream (current page of the current list)
Slide 21
ABAP Keywords (WRITE 2) String literals appear in single quotes Including a “/” triggers a new line
WRITE / writes a new line
Slide 22
ABAP Keywords (SKIP, ULINE) SKIP write a blank line ULINE draws a horizontal rule