Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

declarative and non declarative

Former Member
0 Kudos

What are declarative and non-declarative statements??

3 REPLIES 3

Former Member
0 Kudos

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

Declaring Data Objects

Apart from the interface parameters of routines, you declare all of the data objects in an ABAP program or routine in its declaration part. The declarative statements establish the data type of the object, along with any missing technical attributes, such as its length or the number of decimal places. This all takes place before the program is actually executed. The exception to this are internal tables.

When you declare an internal table, you specify the above details. However, you do not need to specify the overall size of the data object. Only the length of a row in an internal table is fixed. The number of rows (the actual length of the data object in memory) is adapted dynamically at runtime. In short, internal tables can be extended dynamically while retaining a fixed structure.

The interface parameters of routines are generated as local data objects, but not until the routine is called. You can define the technical attributes of the interface parameters in the routine itself. If you do not, they adopt the attributes of the parameters from which they receive their values.

Non declarative statements means other than data or type statements

In executable programs, all non-declarative statements between the REPORT or PROGRAM statement and the first processing block are assigned to the default event START-OF-SELECTION.

All non-declarative statements automatically belong to the default event block START-OF-SELECTION

0 Kudos

What about form ... endform.. is that a nondeclarative or declarative?

0 Kudos

ENDFORM ---> Non declarative

Declarative statements are used to DECLARE variables, tables, etc.

DeclaratiVE

TYPES, DATA, TABLES

ModularizaTion.

-EVENTS

AT SELECTION SCREEN, START-OF-SELECTION, AT USER-COMMAND

-DefINITION.

FORM..ENDFORM, FUNCTION...ENDFUNCTION.

control

WHILE, IF, CASE.

CALLING.

PERFORM, CALL, SET USER-COMMAND, SUBMIT, LEAVE TO

OperaTions

WRITE, MOVE, ADD

DATABASE:

Open SQL

Native SQL

Edited by: Jose Hugo De la cruz on Nov 7, 2008 9:12 PM