2016 Oct 03 11:39 AM
Hi ,
i have written below code.
am doing some calculations and am getting value into variable wa_final-a1 = 0.25.
IF wa_final-a1 IS NOT INITIAL AND wa_final-a1 NE 0.
endif.
Even though the condition is true but the cursor is not going inside.
Please somebody help on this.
Regards,
Naveen Bathula.
2016 Oct 03 11:43 AM
i hope Not
IF wa_final-a1 IS NOT INITIAL AND wa_final-a1 NE 0.
endif.
Like
IF wa_final-a1 IS NOT INITIAL or wa_final-a1 NE 0.
endif.
And means it is checking both , if both satisfies then only going inside.
Or means either anyone satisfies then only it will go inside.
2016 Oct 03 11:47 AM
Hi ,
1.why do you need both conditions? any one is enough
Try replacing NE with '<>'.
2. what is the data type of wa_final-a1.?
2016 Oct 03 2:37 PM
Did you declare wa_final-a1 as an integer or some other type without decimals?
2016 Oct 04 11:47 AM
it is of string why am using because in if condition am using division operation .
2016 Oct 04 12:52 PM
Hi naveen,
You code is correct. I think your data type would be wrong. Please assign packed decimal or currency data type for your variable a1.
2016 Oct 04 12:56 PM
Hello
And works for both true condition. so wa_final-a1 will be either NULL or 0 cannot be both at the same time
Please try Below code
IF Not wa_final-a1 IS INITIAL
Code A
ELSEIF wa_final-a1 NE '0'.
Code B
ELSE.
Code C
ENDIF.
Regards
Ashraf Usmani
2016 Oct 04 1:13 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |