Skip to Content
author's profile photo
Former Member

Syntax

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 04: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.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 23, 2007 at 04:28 PM
     if V_low+v_high < v_low+v_med.
      message e001(00) with 'Hey, you can't proceed'.
     else.
      write:/ 'You can proceed'.
     endif.

    Regards,

    RIch Heilman

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 04: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

    Add comment
    10|10000 characters needed characters exceeded