Wednesday, March 25, 2009

Pseudo Comments and Pragmas in ABAP

In very often case you might meet with pseudo comments in ABAP. It is used when you want to switch off "Extended Program Check" functionality for some lines in your custom ABAP code. Extended Program Check (TA SLIN) does check ABAP source code for statically recognizable errors. ABAP with such an error is executable by system but normally result in runtime exception. It is very common practice within customers that before transport of any custom code to production systems ABAP Quality Assurance guys are running SLIN (apart of other checker tools) and in case of any errors indicated by SLIN transport is denied. In this matter it should be mandatory for ABAP programmers to check them code by this tool up-front. Following see list of pseudo codes ("#EC ... ##....) which are available to be used in ABAP reports:

1. ("#EC *) - excludes error messages regarding the current ABAP command
2. ("#EC NOTEXT) - indicates that a string does not have to be stored as a text element
3. ("#EC CALLED) - indicates that a FORM has a PERFORM call
4. ("#EC NEEDED) - no messages are output about a field that is only read
5. ("#EC NOBREAK) - no messages are sent at BREAK-POINTs
6. ("#EC TRANSLANG) - specifies that the use of TOUPPER or TOLOWER is also safe in multilingual systems
7. ("#EC SYNTCHAR) - specifies that the data TOUPPER or TOLOWER is used on contains only characters from the syntactical character set
8. ("#EC ARGCHECKED) - no number of arguments is checked while calling of function module

Since introduction of NetWeaver Release 7.1, EhP1 (Enhancement Package (EHP)) pseudo comments became obsolete and pragmas should be used instead of the pseudo comments. Pragmas have same purpose as pseudo codes plus they are used to hide warning from other checks tools like: ABAP Compiler, SLIN, Code Inspector (TA SCI). For more details see online documentation.

- 04/13/2014 update -
Corrected link to pragmas documentation.

- 10/01/2020 update -
Corrected link to pragmas of 752 version.


Guillaume Garcia said...

Thanks for sharing this!
Looks like the link doesn't work anymore. Try instead.
Best regards,

Martin Maruskin said...

Hi Guillaume, thanks for notifying me. I just have corrected link.


Anonymous said...

Or even