Application Development 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: 

appending specific rows to specific columns

former_member586174
Participant
0 Kudos

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

0 Kudos

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 .

0 Kudos

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.

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

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

Yes, follow the link I gave above.

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

Sorry, I do not understand.

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.

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

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

7.40, SP08