SAP ABAP Pragmas

By Mavee Solutions

Pragmas are program directives that can be used to hide warnings from various check tools. Pragmas are available from the ABAP release 7.0 EhP2. Pragmas has replaced Pseudo Comments. Pseudo Comments are absolute and should no longer be used.

Let us understand Pragmas and Pseudo Comments more.

For the demo purpose, we have created the following program:

Let us do the “Extended Program Check” for this program:

Do not check the above highlighted checkbox (“Also display hidden messages in source code”). Click on “Perform Check (F8)”.

We have 2 items listed in the report. You can observe the comment here “Can be hidden using pragma ##NEEDED”.

Let us include the Pragma in our program now:

Please note that Pragmas have to be part of program code. You might observe that the Pragma ##NEEDED is included before the end of the statement (before the period ‘.’ Symbol). Pseudo Comments were actually comments and we would put them after the ‘.’ Or ‘,’.

Activate the program and rerun the Extended Program Check (EPC).

This time we have zero errors.

Now let us rerun the EPC check by checking the checkbox “Also display hidden messages in source code”:

Here is the EPC report:

The list of available Pragmas (or the replacements for Pseudo Comments) can be obtained by executing the report ABAP_SLIN_PRAGMAS.

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image