Skip to Content
author's profile photo Former Member
Former Member

Multiple criteria for Case statement

Hello there,

I have a code segment that would do something if one of about 40 criteria is returns true. I know that in Case statement, you can write as When...or...or...or...and so on but I am really hoping to find a better way (say for example, using internal table) or something so that my statement does not appears to be so long (imagine you have to hard-code in 40 criteria!) Could anyone help me with that? Thanks a lot!

Regards,

anyi

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2006 at 05:22 PM

    Hi,

    If all the case statement has the piece of code...or atlease some of them have the same piece of code..Use RANGES...and group them together...

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2006 at 05:19 PM

    store all ur cases to one internal table with one field named <b>CASE</b>

    then..

    loop at itab.
     case itab-<b>case</b>.
     endcase.
    endloop

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.