140 likes | 331 Views
ABAP BASICS I. Northern Arizona University College of Business. ABAP Statements. The ABAP editor converts all statements to uppercase, except string constants A statement can begin anywhere on a line Multiple statements can be on a line. ABAP Statements.
E N D
ABAP BASICS I Northern Arizona University College of Business
ABAP Statements • The ABAP editor converts all statements to uppercase, except string constants • A statement can begin anywhere on a line • Multiple statements can be on a line
ABAP Statements • A single statement can be on multiple lines • Blank lines can be anywhere • One or more spaces can separate statement words
Comments • An asterisk (*) in the first position of a line, makes the entire line a comment * This is a comment • A double quote (“) after a statement creates a partial line comment Write ‘Hi’ . “ This is a comment
Defining a program • REPORT program name . • REPORT Z34_LMF_list_spfli . • PROGRAM program name . • PROGRAM Z34_LMF_list_spfli . • 3 = Year 2003 and 4 = CIS 435
Defining variables • Variables must be defines before they are used. • Variables can be placed anywhere in the program. • Normally all variables should be defined together at the top of a module.
Defining variables • Variables can be up to 30 characters in length. • Begin a variable name with a letter. • Numbers are allowed in variable names. • The underscore (_) is allowed in a variable name.
Defining variables – Data Types C Character ‘Whatever’ I Integer 25 P Packed Decimal 19.95
Data Statement Data D_num Type I value 1 .
Data Statement – Colon Notation Data: D_num1 Type I value 1 , D_num2 Type P Decimals 2 value ’19.95’ , D_name(20) value ‘Whatever’ .
Runtime Parameters Parameters: P_ID Type I Obligatory , P_Name(20) Type C Obligatory Lower Case .
Assigning Values to Variables Move P_ID to D_ID . Move: P_ID to D_ID , P_Name to D_Name .
Writing Write D_ID . Write: / , P_ID to D_ID , P_Name to D_Name .