Skip to Content
Author's profile photo Horst Keller

ABAP Feature Set Backport 7.X to 7.02 – Pragmas

 

Situation before 7.02

 

Before Release 7.02 there was no way to suppress warnings from the syntax check. Warnings and messages from the extended program check could be suppressed by pseudo comments. The latter had an unclear correlation with the target statement, e.g.:

DATA html_tag TYPE string     “#EC NEEDED

VALUE “. “#EC NOTEXT

If you needed more than one pseudo comment, you had to spilt a statment into several lines.  Also, using pseudo comments in chained statements can be problematic.

 

Situation as of 7.02

 

Pragmas offer an uniform mechanism to suppress warnings from compiler and SLIN. They are placed inside a statement, e.g.:

 

LOOP AT … WHERE … ##PRIMKEY[…].

Pragmas always only affect the current statement. A pragmas can only occur:

    • At the end of a line; possibly followed by a sentence delimiter ( . , : )
    • But not after a statement delimiter

Pragmas are case insensitive and begin with two characters ## and can have parameter tokens:

 

##PRAGMA[PAR1][PAR2]

 

The parameter tokens are matched against syntax warnings.

 

Pragmas applicable for syntax warnings are documented in the long texts of the syntax warnings.

 

Pragmas applicaple for SLIN warnings and messages are documented in the SLIN error report. An alphabetical mappling list of old SLIN pseudo comments vs. new pragmas is shown by my program ABAP_SLIN_PRAGMAS.

 

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.