‎2018 Jun 28 2:42 PM
Hi Experts,

I am trying to separate the column 1 to two column number 2 and 3 .
my criteria is simple and depending on current date, e.g if the lo_date (wt_exdt) => sy-datum select wt_date into 2 ..... ....
else ,
select wt_date into 3
unfortunately it is not working , can you please guide me to achieve this.
many thanks in advance.
Jenie
‎2018 Jun 28 2:55 PM
Use CASE in the SELECT list.
https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abensql_case.htm
‎2018 Jun 28 3:01 PM
can you clear this more i think CASE is sql statement,
do you have please a doc or a short example for this for select and case together .
‎2018 Jun 28 3:14 PM
i have tried it and it is not working the after WHEN after the case when need to put a 'XXXX' and this will not suit my criteria.
‎2018 Jun 28 3:39 PM
Maybe share a bit of your coding so we can maybe see what can be corrected.
‎2018 Jun 28 3:54 PM
‎2018 Jun 28 4:11 PM
‎2018 Jun 29 2:42 AM
I think what Jennifer want is something like this (just an image, not working code):
SELECT wt_date FROM dbtab WHERE CASE wt_exdt WHEN => sy-datum THEN INTO wt_date1
ELSE INTO wt_date2.
with CASE in SQL you have to put a value after WHEN but she want to put variable ( sy-datum ) as condition. i think there is no way to archive it direct in the SQL, you can get the data and loop the itab to assign value only.
‎2018 Jun 29 5:15 AM
This is possible with CASE in Open SQL. See the link above.
7.40, SP08