Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Does Open SQL support if statement

Former Member
0 Likes
1,319

Hi all

Wanted to ask how to or is it possible to include if-statement or case in a ABAP Open SQL

example

SELECT IF(NAME = '' , 'UNKNOWN', NAME ) FROM TABLE1 order by NAME ASCENDING.

Because I am trying to sort the data and the null value should be the last record to be seen.

2 REPLIES 2
Read only

Former Member
0 Likes
829

Hi

It is not possible to include if-statement or case in Abap open sql.

Inorder to get the null value as last record sort the table with key as field which as null values.

Thanks!!

Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
829

More proper way to do this in ABAP is IMHO to use SELECT ... WHERE into an internal table and then sort the table (SORT).