2006 Oct 16 7:40 AM
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
2006 Oct 16 7: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.
2006 Oct 16 7: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.
2006 Oct 16 7:55 AM
hi,
or put your parametrs to compare in customizing table,
do a select single or read table and anayse sy-subrc.
A.
2006 Oct 16 8:00 AM
CAN U HELP ME WITH A CODE PLZ AND YES HOW TO CREATE A RANGE FOR VALUES WHICH ARE NOT EVEN THAT IS SOME ARE '76' SOME ARE 'R1' SOME ARE 'RA'....
2006 Oct 16 8:12 AM
you can do something like this :
ranges : r_value for selopt-low
*fill the values
r_value-sign = 'I'.
r-value-option = 'EQ'.
r_value-low = '76'.
append r_value.
*Similarly fill other values
now search the range
search r_value for <key value>
if sy-subrc eq 0.
*do something.
else.
*do something.
endif.
2006 Oct 16 8:29 AM
2006 Oct 16 8:40 AM
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.