ABAP Basics II: Northern Arizona University College of Business
ABAP Basics II: Northern Arizona University College of Business
Printing
To print the program code, copy the code into
capture the screen (Alt/print screen) and paste into Word. Then print from word.
Character
Integer Packed Decimal
Whatever
25 19.95
D
T
Date
Time
20030121
143000
Data Statement
Data D_num Type I value 1 .
Data D_num LIKE sy-subrc .
The data type is determined dynamically at runtime from the like field .
Records
Data Begin of Demo_Record,
D_ID Type I , D_Name(30) Type C , End of Demo_Record .
Constants
Constants:
C_Number Type I value 1 , C_Name(20) Type C value Joe .
Write statement
Write Whatever .
Write Whatever . Write: Whatever: , Whatever . Write 20 Whatever .
Goes to column (position) 20 .
Write statement
Write 20(6)Whatever .
Goes to position 20, and prints for a length of 6 . Advances to the next line .
Write / .
Text Elements
Three types of Text Elements
Text Symbol
Text Elements
GoTo
Text Elements
10
Text Symbols
Alternate method of defining character
variables.
Number, Text, Length
001 Hi There
10
Write Text-001 .
11
Selection Texts
Text identifiers for parameter fields
Select REPS for the program from the worklist, and click on the continue icon
12
Selection Texts
Must SAVE the program
13
Today = sy-datum .
Now
= sy-uzeit .
14
Formatting
Write Today mm/dd/yyyy .
Write Now Using Edit Mask __:__ .
15
Alignment
Write Field1 Left-Justified .
Write Field2 Centered . Write Field3 Right-Justified . Write: /20 Field1 . Write: / Field2 under Field1 .
16
No Gaps
Write: Field1 No-Gap, Field2 .
17
Horizontal Lines
Uline .
Uline /20 . Uline /20(10) .
Uline: /20(10) .
18
Line Spacing
Skip .
Skip 3 . Skip to line 20 .
19
Column Spacing
Position 20 .
20
21
Split F1 at , into F2 F3 .
22
Concatenate F2 - F3 into F1 .
23
Condense F1 No-Gaps .
24
25
Time Fields
Data: Now Now_Plus1
type T , type T .
26
If Statement
If
Else . Whatever = 1 . EndIf .
A=B.
Whatever = 0 .
27