Skip to Content
0
Former Member
Jul 30, 2008 at 06:56 PM

Dynamic where condition - Problem

250 Views

Hi All,

I have a problem in a select statement where I use a dynamic condition.It gives me a dump

SAPSQL_WHERE_PARENTHESES

CX_SY_DYNAMIC_OSQL_SYNTAX.

Please find the below code which I implemented.

*SELECT * FROM ZXR5*

WHERE (SOURCE).

The value of SOURCE is 'MATNR EQ '000000000000200066'.

When I checked the help, it is advised to use a CATCH exception which I did as below:

TRY.

*SELECT * FROM ZXR5*

WHERE (SOURCE).

CATCH cx_sy_dynamic_osql_error.

MESSAGE `Wrong WHERE condition!` TYPE 'I'.

ENDTRY.

Now, the select statement gives an exception and is not executing to fetch the values.

I need some input on the above issue. Any help on this would be greatly appreciated.

Regards,

Rajmohamed.M