2008 Jul 20 9:28 AM
Hi, is there anything similar to ORACLE's DECODE statement I can use in my OPEN SQL query ?
Thanks
Avraham
2008 Jul 20 4:30 PM
Hi,
ANSI's SQL-92 standard foresees for such kind of logic the "CASE" expression. It can be used in the SELECT, WHERE or HAVING component of your SQL statement. I have never tried it in ABAP's open sql, so I am not sure, but maybe it is worth a try?
Kind regards,
Nico
2008 Jul 20 4:30 PM
Hi,
ANSI's SQL-92 standard foresees for such kind of logic the "CASE" expression. It can be used in the SELECT, WHERE or HAVING component of your SQL statement. I have never tried it in ABAP's open sql, so I am not sure, but maybe it is worth a try?
Kind regards,
Nico
2008 Jul 20 5:50 PM
Hi Avraham,
In ABAP we cannot have the exact functionality of DECODE statement, as we cannot compare any expression in WHERE conditon of SELECT statement.
Instead, we can use the IF-ENDIF condition in SELECT-ENDSELECT and then append it into the internal table. But SELECT-ENDSELECT is not adviced to use as it has performance issued.
Hope this helps you.
Regards,
Chandra Sekhar