Skip to Content
author's profile photo Former Member
Former Member

declarative and non declarative

What are declarative and non-declarative statements??

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 17, 2008 at 08:54 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.