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

Regarding Ranges...

Hi all,

I need to check whether a key is not equal to invoice (this has 8 different values like r1, r2, 77 etc) or payment (this has 3 different values like 05,06 etc...)...

If the above condition is correct then message 1 is passed else message 2 is passed.

Now the issue is if i want i can chek them using if statement but that is gonna turn out very lengthy... that is i will chek key is not equal to inv. 1 and not equal to inv.2 etc....and then with the payment values...

can anyone plz suggest some shorter way and preferably with a piece of code...thanx in advance

rakesh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 06:46 AM

    You can create a <b>range</b> and fill with all the possible invoice values and then you can do something like this :

    search <range> for <key>

    if sy-subrc eq 0.

    *value is present

    else.

    *value is not present

    endif.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Create a variant in table TVARVC.

      For that varibale enter ur invoice values as single in that select-options tab.

      create a ranges table in ur prog like

      DATA : y_r_ff LIKE RANGE OF vbak-auart WITH HEADER LINE.

      if field in y_r_ff.

      Mss 1.

      else.

      mss2

      endif.

      REgards,

      kishore.

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.