Thursday, 17 August 2017

ABAP Syntax



a.   ABAP program is a collection of ABAP statements.

b.    Every ABAP statement ends with '.' (dot).

Ex:
Write "Hello World".

Above ABAP statement writes the string "Hello World" to the console.

c.    Every ABAP statement follows following syntax
Keyword + Operand + Operator

Ex:
IF age < 18.
                  Write "Not Eligible to vote".
ENDIF

In the above example, 'IF' is the keyword, 'age' is the operand and '<'
is the operator.

d.   ABAP syntax is not case sensitive. The variable placeOfBirth,PLACEOFBIRTH, PLACEofBIRTH are same.

To make the programs, more readable, define a variable such that, each word in the variable name separated by underscore (_).
        
Ex:
place_of_birth, rate_of_intrest

e.   While defining classes, procedures you are supposed to use maximum of 30 characters. ABAP constrains 30 characters’ limitation on class and procedure names. There is no limit on variable names.

f.     A variable name should have only a-z, 0-9, _. You are not supposed to use special symbols like ?, $, % ( etc., while defining a variable.

g.   * is used to write full line comments and " is used to write partial line comments.

h.   String are enclosed in single quotes.
Ex:
name = 'Hari Krishna'
place_of_birth = 'Punuru'



Previous                                                 Next                                                 Home

No comments:

Post a Comment