‎2007 Aug 23 5:19 PM
Hi Gurus,
I have a condition where I need to check if V_lowv_high < v_lowv_med then don't proceed else
write " we can proceed"
else
we need to stop processing
Can you please help me how to write the "else" part
Tahnks
Rajeev Gupta
‎2007 Aug 23 5:27 PM
data : lv_value1 type i,
lv_value2 type i.
lv_value1 = v_low + v_high.
lv_value2 = v_low + v_med.
if lv_value1 < lv_value2.
proceed.
else.
<b>stop.</b> " this will take you out or program
endif.
‎2007 Aug 23 5:27 PM
data : lv_value1 type i,
lv_value2 type i.
lv_value1 = v_low + v_high.
lv_value2 = v_low + v_med.
if lv_value1 < lv_value2.
proceed.
else.
<b>stop.</b> " this will take you out or program
endif.
‎2007 Aug 23 5:28 PM
‎2007 Aug 23 5:53 PM
Hi Rajeev,
You can't use expressions in the conditions for IF...ENDIF. It only allows values to compare rather than expressions, so you need to get the value of expression and the have condition among values.
DATA:
VALUE1 TYPE I,
VALUE2 TYPE I.
VALUE1 = V_LOW + V_HIGH.
VALUE2 = V_LOW + V_MED.
write " we can proceed".
IF VALUE1 < VALUE2.
write " we can not proceed".
ELSE.
ENDIF.
In your case as you are adding V_LOW to both left hand and right hand, so you can this and write a simple conidtion as
IF V_HIGH < V_MED.
write " we can proceed".
ELSE.
write " we can not proceed".
ENDIF.
Thanks,
Vinay