Friday, March 11

ABAP Statements

ABAP Source code consists for comments and statements.
Various kind of ABAP statements are :
Declarative statements
They define data type or declare data objects. A collection of declarative statement in the program is called declaration part.
Examples of declarative keywords: TYPES, DATA, TABLES


Modularization Statements

processing blocks in an ABAP program are defined by these statements.
The modularization keywords are of two types:
 Event Keywords and Defining keywords

Event Keywords are used to define event blocks. There are no
special statements to conclude processing blocks – a processing block ends when the next proc block starts.
Examples of event keywords are:
START-OF-SELECTION, AT USER-COMMAND, AT SELECTION SCREEN,
Defining keywords Are used  to define dialog modules, methods , subroutines, function modules.
We can conclude them using the ENDstatements.

Examples of definitive keywords: MODULE ... ENDMODULE.
FORM ..... ENDFORM, FUNCTION ... ENDFUNCTION.


Control Statements

within a processing block , Control statements control the flow of an ABAP program
according to certain conditions.
Examples of control keywords: IF, WHILE, CASE


Call Statements

Call Statements call processing blocks
The block can reside anywhere either in the same program or in other program.
Examples of call keywords:
SUBMIT, LEAVE TO, PERFORM, CALL, SET USER-COMMAND,


Operational Statements

Operational Statements process the data.
 Examples of operational keywords:
MOVE, ADD. WRITE,

Database Statements

Database Statements access the tables form central database
system. These are of 2 types: Open SQL and Native SQL.
Open SQL
Open SQL contains only Data Manipulation
Language (DML) statements, such as , IINSERT, DELETE and SELECT.No
Data Definition Language (DDL) statements (such as CREATE TABLE or CREATE INDEX) are present in open SQL..
Functions of this type are contained in the ABAP Dictionary
ABAP programs that use only Open SQL statements to
access the database are fully portable ie they can be run on a different database or operating system. Database interface helps in the conversion of OPEN SQL into commands of the relevant database.

Native SQL
These statements go directly from the database interface to the database without
being converted. It is possible to use DDL operations in native SQL. The ABAP Dictionary uses
Native SQL for database tables creation.it is recommended to use open sql in ABAP programs. Data dictionary used native sql and is created for DDL so better make use of Data dictionary if you are creating a ABAP program.

No comments:

Post a Comment

You are welcome to express your views here...