ABAP statements always begin with an ABAP keyword and are always concluded with a period (.) . Statements can be several lines long; conversely, a line may contain more than one statement.
Comments are distinguished by the preceding signs * (at the beginning of a line) and “ (at any
position in a line).
ABAP statements use ABAP data types and objects.
Statements and Keywords : The first element of an ABAP statement is the ABAP keyword. This determines the category of the statements. The different statement categories are as follows:
Declarative Statements :
These statements define data types or declare data objects which are used by the other statements in a program or routine. The collected declarative statements in a program or routine make up its declaration part.
Examples of declarative keywords: TYPES, DATA, TABLES
Modularization Statements :
1) Event Keywords : You use statements containing these keywords to define event blocks. There are no special statements to conclude processing blocks - they end when the next processing block is introduced.
Examples of event keywords are: AT SELECTION SCREEN, START-OF-SELECTION, AT USER-COMMAND
2) Defining keywords : You use statements containing these keywords to define subroutines, function modules, dialog modules and methods. You conclude these processing blocks using the ENDstatements.
Examples of definitive keywords:
FORM ..... ENDFORM, FUNCTION ... ENDFUNCTION,
MODULE ... ENDMODULE.
Control Statements :
You use these statements to control the flow of an ABAP program within a processing block
according to certain conditions.
Examples of control keywords: IF, WHILE, CASE
Call Statements :
You use these statements to call processing blocks that you have already defined using modularization statements. The blocks you call can either be in the same ABAP program or in a
different program.
Examples of call keywords: PERFORM, CALL, SET USER-COMMAND, SUBMIT, LEAVE TO
Operational Statements : These keywords process the data that you have defined using declarative statements.
Examples of operational keywords: WRITE, MOVE, ADD
Database Statements :
These statements use the database interface to access the tables in the central database system. There are two kinds of database statement in ABAP: Open SQL and Native SQL.
Open SQL : Open SQL is a subset of the standard SQL92 language. It contains only Data Manipulation Language (DML) statements, such as SELECT, IINSERT, and DELETE. It does not contain any Data Definition Language (DDL) statements (such as CREATE TABLE or CREATE INDEX). Functions of this type are contained in the ABAP Dictionary. Open SQL contains all of the DML functions from SQL92 that are common to all of the database systems supported by SAP. It also contains a few SAP-specific functions. ABAP programs that use only Open SQL statements to access the database are fully portable. The database interface converts the OPEN SQL commands into commands of the relevant database.
Native SQL : Native SQL statements are passed directly from the database interface to the database without first being converted. It allows you to take advantage of all of your database’s characteristics in your programs. In particular, it allows you to use DDL operations. The ABAP Dictionary uses Native SQL for tasks such as creating database tables. In ordinary ABAP programs, it is not worth using DDL statements, since you cannot then take advantage of the central administration functions of thie ABAP Dictionary. ABAP programs that use Native SQL statements are database-specific, because there is no standardized programming interface for SQL92.
Declarative Statements :
These statements define data types or declare data objects which are used by the other statements in a program or routine. The collected declarative statements in a program or routine make up its declaration part.
Examples of declarative keywords: TYPES, DATA, TABLES
Modularization Statements :
1) Event Keywords : You use statements containing these keywords to define event blocks. There are no special statements to conclude processing blocks - they end when the next processing block is introduced.
Examples of event keywords are: AT SELECTION SCREEN, START-OF-SELECTION, AT USER-COMMAND
2) Defining keywords : You use statements containing these keywords to define subroutines, function modules, dialog modules and methods. You conclude these processing blocks using the ENDstatements.
Examples of definitive keywords:
FORM ..... ENDFORM, FUNCTION ... ENDFUNCTION,
MODULE ... ENDMODULE.
Control Statements :
You use these statements to control the flow of an ABAP program within a processing block
according to certain conditions.
Examples of control keywords: IF, WHILE, CASE
Call Statements :
You use these statements to call processing blocks that you have already defined using modularization statements. The blocks you call can either be in the same ABAP program or in a
different program.
Examples of call keywords: PERFORM, CALL, SET USER-COMMAND, SUBMIT, LEAVE TO
Operational Statements : These keywords process the data that you have defined using declarative statements.
Examples of operational keywords: WRITE, MOVE, ADD
Database Statements :
These statements use the database interface to access the tables in the central database system. There are two kinds of database statement in ABAP: Open SQL and Native SQL.
Open SQL : Open SQL is a subset of the standard SQL92 language. It contains only Data Manipulation Language (DML) statements, such as SELECT, IINSERT, and DELETE. It does not contain any Data Definition Language (DDL) statements (such as CREATE TABLE or CREATE INDEX). Functions of this type are contained in the ABAP Dictionary. Open SQL contains all of the DML functions from SQL92 that are common to all of the database systems supported by SAP. It also contains a few SAP-specific functions. ABAP programs that use only Open SQL statements to access the database are fully portable. The database interface converts the OPEN SQL commands into commands of the relevant database.
Native SQL : Native SQL statements are passed directly from the database interface to the database without first being converted. It allows you to take advantage of all of your database’s characteristics in your programs. In particular, it allows you to use DDL operations. The ABAP Dictionary uses Native SQL for tasks such as creating database tables. In ordinary ABAP programs, it is not worth using DDL statements, since you cannot then take advantage of the central administration functions of thie ABAP Dictionary. ABAP programs that use Native SQL statements are database-specific, because there is no standardized programming interface for SQL92.


No comments:
Post a Comment