‎2007 Aug 14 4:24 AM
Hello Experts,
Can you please explain on when will this IF condition take effect? Thank you guys and take care!
IF wa_vbrp-fklmg NE 0 OR ( ( wa_vbak-auart EQ c_auart_zuci OR wa_vbak-auart EQ c_auart_zurv )
AND wa_mseg-menge NE 0 ).
ENDIF
‎2007 Aug 14 5:40 AM
hi,
in your if condition u have used two logical operators.
1. or
2. and
or is some thing like this if any one of the conditions are correct then if is executed
and 'AND' is if both conditions are correct only then if is executed.
i.e wa_vbrp-fklmg NE or
( wa_vbak-auart EQ c_auart_zuci OR wa_vbak-auart EQ c_auart_zurv ) in this any one
conditions is correct then its enough for execution and it will check or another condition
wa_mseg-menge NE 0 -it must be true. then if the outer condition isfalse then if condition is executed or else part is executed.
and also if outer condition wa_vbrp-fklmg NE is true then it won't go to another condition and it will directly executes the if condition.
if helpful reward some points.
with regards,
Suresh Babu Aluri.
‎2007 Aug 14 4:38 AM
there are 3 cdn's
1. wa_vbrp-fklmg NE 0
2. OR wa_vbak-auart EQ c_auart_zuci OR wa_vbak-auart EQ c_auart_zurv
3. AND wa_mseg-menge NE 0 ).
‎2007 Aug 14 4:45 AM
Hi,
Indented code will always help you understand this things better:
IF wa_vbrp-fklmg NE 0 OR
( ( wa_vbak-auart EQ c_auart_zuci OR
wa_vbak-auart EQ c_auart_zurv )
AND wa_mseg-menge NE 0 ).
[Conditions true = execute code inside IF]
ENDIF
Code will execute when:
a) fklmg is not zero
b) fklmg is zero, and auart is equal either to c_auart_zuci or c_auart_zurv, and menge is not zero.
(mentioning only field name in the sake of simplicity).
Regards.
Please reward points if helpful.
‎2007 Aug 14 4:47 AM
hi,
the if condition will trigger when either of following or both is true
1. wa_vbrp-fklmg NE 0
2. either wa_vbak-auart EQ c_auart_zuci OR wa_vbak-auart EQ c_auart_zurv
and
wa_mseg-menge NE 0
hope that helps
‎2007 Aug 14 4:52 AM
Hi,
It will be executed when:
1. wa_vbrp-fklmg NE 0
2. wa_vbak-auart EQ c_auart_zuci AND wa_mseg-menge NE 0
3. wa_vbak-auart EQ c_auart_zurv AND wa_mseg-menge NE 0
‎2007 Aug 14 5:40 AM
hi,
in your if condition u have used two logical operators.
1. or
2. and
or is some thing like this if any one of the conditions are correct then if is executed
and 'AND' is if both conditions are correct only then if is executed.
i.e wa_vbrp-fklmg NE or
( wa_vbak-auart EQ c_auart_zuci OR wa_vbak-auart EQ c_auart_zurv ) in this any one
conditions is correct then its enough for execution and it will check or another condition
wa_mseg-menge NE 0 -it must be true. then if the outer condition isfalse then if condition is executed or else part is executed.
and also if outer condition wa_vbrp-fklmg NE is true then it won't go to another condition and it will directly executes the if condition.
if helpful reward some points.
with regards,
Suresh Babu Aluri.
‎2007 Aug 14 6:03 AM
this if condition will effect based two coditions if either one of given below satisfy.
1. when <b>wa_vbrp-fklmg NE 0</b> - the if statement executes.
2. when <b>wa_vbak-auart</b> is equal to(<b>EQ</b>) either c<b>_auart_zuci </b> or
<b>c_auart_zurv </b>
and <b>wa_mseg-menge </b> not eual to(<b>NE</b>) <b>0</b> .
regards
Vijaykumar Reddy. S
‎2007 Aug 14 6:58 AM
Hai Viray,
It will execute the conditions in the following manner:
1. wa_vbak-auart EQ c_auart_zuci OR wa_vbak-auart EQ c_auart_zurv
Anyone of the condition has to be satisfied
2. wa_mseg-menge NE 0
The above conditon mingles with the present one
3. wa_vbrp-fklmg NE 0
It will give the value by satisfying any one of the condition( 2 or 3)
Gokul.N