3

I'm looking for a pragma I can use to hide the compiler warning generated when a field used in the WHERE condition of a select may contain NULL values in the database.

Having read SAP note 1088403, I am aware of the possible issues here but I cannot apply the solutions suggested there since I'm using a range, not a single value in the WHERE clause. In either case this is legacy code that was never found to be defective (as far as we know) and will be replaced before long.

However while I'm rewriting other sections of the program, I'd like to disable this warning with a pragma. Could anyone tell me what pragma I'd be able to use for this?

Example Select:

SELECT d~matnr d~werks d~lgort d~bdmng k~maktx
INTO CORRESPONDING FIELDS OF TABLE itab
FROM resb AS d
INNER JOIN makt AS k ON d~matnr = k~matnr
WHERE
    k~spras = syst-langu
    AND d~werks = p_werks
    AND d~matnr IN s_matnr
    AND d~bwart IN r_bwart.

Note that I've since replaced this select with one using a dynamic where clause which also hides the warning since the compiler obviously can't check a text-based where.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Lilienthal
  • 4,327
  • 13
  • 52
  • 88
  • Could you please provide a tiny piece of code? Also, the pragma `#EC * ` applies to everything. – Eduardo Copat Dec 18 '13 at 12:06
  • I've added an example select as requested. As for the pragma you mentioned, I believe it's actually a pseudo comment to disable warnings from Extended Program Check. These pseudo comments are made obsolete by pragmas and using both in one program will trigger a EPC warning that can't be deactivated (according to the ABAP reference). Additionally the warning I encounter is not generated by the EPC but is a compile time warning that this pseudo comment does not seem to disable. – Lilienthal Dec 19 '13 at 08:35

1 Answers1

3

If you run the extended syntax check over a program with this snippet in, you will see that it specifically states there is no pragma to suppress this (emphasis mine):

Program: <program_name> Row: <row>
Syntax check warning
The field "BWART" used in the WHERE condition may contain NULL values.
Internal message code: MESSAGE GYT
Cannot be suppressed using a pragma or pseudo-comment

Smigs
  • 2,362
  • 1
  • 21
  • 24