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

appending specific rows to specific columns

Former Member
0 Likes
2,544

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

8 REPLIES 8
Read only

retired_member
Product and Topic Expert
Product and Topic Expert
Read only

0 Likes
2,411

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 .

Read only

0 Likes
2,411

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.

Read only

2,411

Maybe share a bit of your coding so we can maybe see what can be corrected.

Read only

0 Likes
2,411

Yes, follow the link I gave above.

Read only

0 Likes
2,411

Sorry, I do not understand.

Read only

2,411

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.

Read only

0 Likes
2,411

This is possible with CASE in Open SQL. See the link above.

7.40, SP08