‎2006 Nov 07 9:59 AM
Hi All!
I am coding as below to do some validations :
RANGES : r_uname FOR syst-uname.
r_uname-low = 'xxxxxx'.
r_uname-sign = 'I'.
r_uname-option = 'EQ'.
APPEND r_uname.
CLEAR r_uname.
r_uname-low = 'yyyyy'.
r_uname-sign = 'I'.
r_uname-option = 'EQ'.
APPEND r_uname.
CLEAR r_uname.
IF sy-uname NOT IN r_uname.
But the if condition is not validating the values in r_uname. What I see is that sy-uname is a structure and r_uname is a Internal Table without a header line because of which the if condition is not validating .Any better coding to get this functionality.
Regards
Praneeth
‎2006 Nov 07 10:05 AM
I guess this is used for validation purpose, please try with :
CHECK: NOT SY-UNAME IN R_UNAME.
Kind Regards
Eswar
‎2006 Nov 07 10:05 AM
I guess this is used for validation purpose, please try with :
CHECK: NOT SY-UNAME IN R_UNAME.
Kind Regards
Eswar
‎2006 Nov 07 10:12 AM
Hi,
Chk A sample code.
Define a range:
Ranges: r_field for <table>.
if not field1 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
r_field-option-low = field1.
append r_field.
endif.
if not field2 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
r_field-option-low = field2.
append r_field.
endif.
if field1 is initial and field2 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
append r_field.
endif.
select * from <table> where field1 in r_field.Regards
Anver
if hlped pls mark points
‎2006 Nov 07 10:21 AM
Praneeth,
try giving r_uname-low values in CAPS and check.
AND
IF sy-uname NOT IN r_uname.
sholud be like <b>IF NOT sy-uname IN r_uname</b>.
-Anu
Message was edited by: Anupama Reddy
‎2006 Nov 07 10:44 AM
You'd better clear your range work area before filling it in, not afterwards:
refresh r_uname.
clear r_uname.
..
append r_uname.
clear r_uname.
..
append r_uname.
‎2006 Nov 07 11:46 AM
Hi,
Just make sure you enter the values in capitals.
and check like this:
IF sy-uname NOT IN r_uname[].