05-17-2005 7:26 PM
Hi,
i have a variable NAME which should not take 5 different values.
i want to check NAME againist these 5 values at run time. is there any way to check NAME againist these 5 values like NAME in X, where x contains these 5 values.
could someone let me know the syntax and approach to do that.
your help would be appreciated.
thanks,
kranthi.
Message was edited by: kranthi kumar
Message was edited by: kranthi kumar
05-17-2005 7:35 PM
Hi Kranthi
If you want a method to set this property persistently via definitions made in DDIC, I do not know any way. If the values that the parameter can take are definite, then you can set up a check table.
Otherwise, one should achieve this programatically.
i.
IF name = <i><prohibited_val1></i> OR
name = <i><prohibited_val2></i> OR
name = <i><prohibited_val3></i> OR
name = <i><prohibited_val4></i> OR
name = <i><prohibited_val5></i> .
*-- The rule is broken
ENDIF .
ii. Define a range and check with it.
TABLES mytable .
RANGES grn_namepval FOR mytable-name .
*-- Begin of block A
CLEAR grn_namepval .
grn_namepval-sign = 'I' .
grn_namepval-option = 'EQ' .
grn_namepval-low = <i><prohibited_val1></i> .
APPEND grn_namepval .
*-- End of block A
*--Do block A for each prohibited value
IF name IN grn_name_pval .
*--Your rule is broken
ENDIF .
Regards
*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>
05-17-2005 7:33 PM
Sure...check out this same code.
report zrich_0001 .
data: t_name(30) type c.
ranges: r_name for t_name.
parameters: p_name like t_name.
initialization.
clear r_name. refresh r_name.
r_name-sign = 'I'.
r_name-option = 'EQ'.
r_name-low = 'RICH'. append r_name.
r_name-low = 'BRAD'. append r_name.
r_name-low = 'ANAND'. append r_name.
r_name-low = 'SERDAR'. append r_name.
r_name-low = 'SRINIVAS'. append r_name.
at selection-screen.
if not p_name in r_name.
message e000(00).
endif.
Regards,
Rich Heilman
05-17-2005 7:35 PM
Hi Kranthi
If you want a method to set this property persistently via definitions made in DDIC, I do not know any way. If the values that the parameter can take are definite, then you can set up a check table.
Otherwise, one should achieve this programatically.
i.
IF name = <i><prohibited_val1></i> OR
name = <i><prohibited_val2></i> OR
name = <i><prohibited_val3></i> OR
name = <i><prohibited_val4></i> OR
name = <i><prohibited_val5></i> .
*-- The rule is broken
ENDIF .
ii. Define a range and check with it.
TABLES mytable .
RANGES grn_namepval FOR mytable-name .
*-- Begin of block A
CLEAR grn_namepval .
grn_namepval-sign = 'I' .
grn_namepval-option = 'EQ' .
grn_namepval-low = <i><prohibited_val1></i> .
APPEND grn_namepval .
*-- End of block A
*--Do block A for each prohibited value
IF name IN grn_name_pval .
*--Your rule is broken
ENDIF .
Regards
*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>
05-17-2005 7:49 PM