01 - Introduction To ABAP Programming
01 - Introduction To ABAP Programming
Course Objectives
Screens Values in
variants
xy 007
Source code xz 008 Docum entation
Text elem ents Application Help
D e c la r a tio n s P R O G R AM s apbc402_rund_test.
T Y P E S : . . .
D A T A : .. . .
D ia lo g m o d u le C O N S T ANT S : ...
M O D U L E s _ 100 OUTPUT.
. . .
E N D MODULE.
. . .
. . .
E v e n t b lo c k
I N I TIALIZATION.
. . .
. . .
S T A RT-OF-SELECTION.
. . .
. . .
. . .
. . .
. . .
P ro c e d u re F O R M calc USING ...
CHANGING ...
...
ENDFORM.
Terms to Remember
Program
•A series of ABAP statements.
Report:
An ABAP program whose output is a list:
Module Pool:
A dialog program which is a collection of screens
List:
The output generated by an ABAP report
program.
The ABAP Editor
Programming Environment: ABAP Editor
Programming Environment: Online Debugging
Basic Functions of the ABAP Editor
Standard toolbar
Find and
Repeat Find
Syntax
SyntaxCheck
Check Execution (F8)
(Ctrl+F2) ABAP help (F1)
A B A P P ro g ra m
P ro c e s s in g
D e c la ra tio n s
b lo c k
p a s s iv e p a s s iv e
ABAP
ru n tim e
s y s te m
P ro c e s s in g P ro c e s s in g a c tiv e
b lo c k b lo c k
p a s s iv e p a s s iv e
Basic ABAP Program syntax
Statement.
Word 4
Word 1 Word2 Word3
.
Declaration Section
Used for defining tables,variables and constants
Statement Section
MOVE: 1 TO COUNT,
‘President’ TO TITLE.
An Alternative Method:
From the system
Menu,choose Services
->Reporting to launch
the program.
OR
From the ABAP Editor: From the ABAP Editor: Initial Screen, type
With the program displayed, the program name, then click on the
“Execute” push-button.
program->Execute
Topic Objectives
report zitatrg1.
write ‘Hello World – SAP R/3’.
“WRITE” Statement – Simple Form
• Syntax:
WRITE [AT] [/P(L)] v1[+O(SL)]
[UNDER v2 | NO-GAP].
• Used to output contents of a field (or sub-field)
in a certain format
• The output of the WRITE statement is printed
as a “List”
• Specify additions to position, color, mask,
and format variables and print Symbols,
Icons and Lines
“WRITE” Statement (contd.)
WRITE ‘**************************’
SKIP 2.
WRITE: ‘The date today is:’, SY-DATUM,
‘The current time is:’ SY-UZEIT.
Note that there is an automatic
SKIP 2. space between the fields written
WRITE ‘***************************’. to the list.
******************************
ABAP Format Specifications
Write 10 ‘****City of Mumbai****’.
SKIP2.
WRITE: 10 ‘Ticket Date’ , SY-DATUM.
WRITE: /10 ‘Ticket Time’ , SY-UZEIT.
ULINE /10(60).
SKIP2.
WRITE 10 ‘****Department of Public Safety****’
Up to four lines of
column headings can
be maintained for the
list.
Numbered Texts ( Text Symbols )
WRITE: /TEXT-001,
TEXT-002,
SY-DATUM.
Text symbols
are referenced
by a unique
three character
code.