‎2008 Apr 10 1:45 PM
Hi,
Is it possible to cacht SAPSQL_INVALID_FIELDNAME error ?
When Im trying :
CATCH SYSTEM-EXCEPTIONS SAPSQL_INVALID_FIELDNAME = 1.
[...]
ENDCATCH.
I got an error that there is no such exception 😕
thx for help
‎2008 Apr 11 5:55 PM
It is not possible to catch this exception. The program will have to be modified to prevent the occurrence of this exception.
‎2008 Apr 15 8:25 AM
I cant doit in that way - I need to allow enter 'WHERE' caluse of SQL query by a user, so after that I need to determine if that query including where part is correct... cathing exception seem to be the easiest way.. 😕
‎2008 Apr 15 3:46 PM
If you are in the release 6.10 or higher, try using TRY... CATCH technique and catch the exceptions of CX_SY_SQL_ERROR class. Here is an example from ABAP Help:
PARAMETERS: column TYPE c LENGTH 8,
value TYPE c LENGTH 30.
DATA spfli_wa TYPE spfli.
DATA cond_syntax TYPE string.
CONCATENATE column '= value'
INTO cond_syntax SEPARATED BY space.
TRY.
SELECT SINGLE *
FROM spfli
INTO spfli_wa
WHERE (cond_syntax).
CATCH cx_sy_dynamic_osql_error.
MESSAGE `Wrong WHERE condition!` TYPE 'I'.
ENDTRY.
‎2008 Apr 16 5:34 AM
Hi ,,
According to your code it is not possible to catch the exception.
Regards,
Muneesh Gitta.