2007 Jul 18 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.
2007 Jul 18 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!
2007 Jul 18 3:54 PM
2007 Jul 18 3:55 PM
It does not work, I tried is there something I am missing in the syntax.
2007 Jul 18 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.
2007 Jul 18 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.
2007 Jul 18 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.