ABAP - Keyword Documentation →  ABAP - Programming Guidelines →  ABAP-Specific Rules →  Program Type and Program Properties → 
Mail Feedback

Program Properties

Background  

Alongside various, less important properties, each ABAP program has a set of program properties that control specific aspects of the program behavior and syntax check severity:

The program properties are defined when a program is created the relevant tool (Class Builder, Function Builder, ABAP Editor). It is possible to change them later.

Rule  

Use the default settings for program properties

Set the program properties for new programs as follows:

When a new program is created, these settings are the same as the default values. This means that they can be applied without making any changes. Once the program properties are set they should no longer be modified.

Details  

Different behaviors or check severities are only provided for compatibility reasons, to ensure that existing programs can still be compiled and executed. New programs should definitely not use obsolete settings.

Because any later changes to the program properties potentially involve extra work, the correct properties should be configured right from the start and not changed later.

The following sections assume that fixed point arithmetic is always activated and that logical databases are not used.

Hint

From ABAP release 740, SP05, the strict modes in the ABAP SQL syntax check require programs with the ABAP language version Standard ABAP in which the program property fixed point arithmetic is switched on.

Example

In the following source code performs a substring write across two numeric components of a structure.

METHOD ...
  DATA:
    BEGIN OF struct,
      comp1 TYPE i,
      comp2 TYPE i,
    END OF struct.
  struct+2(4) = 'XXXX'.
ENDMETHOD.

This was only possible for programs in the obsolete ABAP language version Non-Unicode ABAP. Here an implicit casting of the subarea is performed for type c. The result in the components depends on the alignment gaps, the internal presentation of numeric values (byte order), and the code page used. Therefore, the result is extremely platform-dependent. A live program must never contain this type of code. This type of code often produces data with errors or runtime errors that are difficult to trace.

The above code produces a syntax error when used in an ABAP program defined as Standard ABAP or higher in the program properties (in accordance with the above rule). Unwanted substring accesses are prohibited, just like any other unwanted accesses to structures or other parts of the working memory. If these accesses cannot be identified by the syntax check, a runtime error occurs with a descriptive short dump while the program is running.