问题
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.
回答1:
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
来源:https://stackoverflow.com/questions/20654903/pragma-to-hide-warning-the-field-used-in-the-where-condition-may-contain-null-v