What is the Mandatory ABAP Syntax that must be followed by every coder?
- ABAP is not a case sensitive language (It is case sensitive in the case of field name being passed in Function Module)
- Every Program must start with a Keyword
- Every Program must end with a Period (.)
- Every Chained statement must have a single Keyword followed by a colon (:) and the individual statement followed by a comma (,)
DATA :LV_PLAYER(10) TYPE c,
LV_SCORE (100) TYPE n,
LV_WICKET (10) TYPE n.
- To make entire line comment use asterisk (*) mark at the beginning of statement
- To make a comment after a statement in same line use double inverted comma (“) before the comment
- Use PRETTY PRINTER to provide indentation to your codes and make them readable for testers
- Nomenclature: Use following prefixes before given types of fields
|LWA||Local Work Area|
|GWA/WA||Global Work Area|
|LT||Local Internal Table|
|GT||Global Internal Table|
|ZRP||Custom Report Program|
[Note: Use underscores (_) after using prefixes]
- ABAP codes are whitespace sensitive.
Example: a = b+c(d) and a = b + c ( d ) have different meaning, the first one c(d) will give ‘c’ of length ‘d’ while second one will call function ‘c’ with parameter ‘d’.
- In ABAP custom field i.e. custom reports, custom data element, custom domain always starts with’Z’. It means everything we are going to create will be custom and not Standard (Standard ones are created by SAP). So, they will start with ‘Z’ or ‘Y’.
Example: ZBarry_Allen might be my report name
- ABAP provides both Statements based syntax as well as Expression based syntax
- ADD Tax to Total.
- Total = Total + Tax.
Both will give same output.