07-18-2007 3:51 PM
I case statements can i give a range
eg:
Case my_field.
when GE 'a' and LE 'l'
do something.
when others.
endcase.
07-18-2007 3:53 PM
I don't think you can use GE and LT to compare characters, but give it a try and see if it works!
07-18-2007 3:54 PM
07-18-2007 3:55 PM
It does not work, I tried is there something I am missing in the syntax.
07-18-2007 3:56 PM
No, I don't think you're missing anything, it just doesn't work like that.
Try explaining what you're trying to achieve and maybe we can help you.
07-18-2007 4:00 PM
here are the details
I have to have to write the names of people who name start with 'A' to 'F' in col 10 and 'G' to 'L' on col 20 and rest in col 30.
I take move the first charcter of name in
Data: f_char type c.
than I am using case statement
Case f_char
when GE 'A' and LE 'F'
perform write-10para.
'
'
'
endcase.
07-18-2007 3:56 PM
Hi Ram..
You cannot have a range but u can put a list of values seperated by or..
DATA : val TYPE i.
val = 1.
CASE val.
WHEN '1' or '10'.
WRITE : '1to 10'.
when others.
write : ' others'.
ENDCASE.