11-19-2008 7:11 AM
Hello Guru's
Can anyone explain to me how the syntax
IF 1 = 2.
.....
ENDIF.
works, is this ever the case?
11-19-2008 7:13 AM
Hi,
This situation should ideally never occur.
Well some abapers do use this to say log dummy messages or handle imaginary situations like system crash .
Rgds,
Sandeep
11-19-2008 7:13 AM
We generally use this condition when some code is required to be place for future use or for certain requirements and dont want to get it executed.
Its like commention.
11-19-2008 7:17 AM
Hi
You can write the syntax like this but for this sy-subrc allways return value 4 means not successfull.
it won't give any error.
there is no meaning to keep if condition like this.
the code inside the if condition won't execut
11-19-2008 2:44 PM
>
> You can write the syntax like this but for this sy-subrc allways return value 4 means not successfull.
Picture of an owl.
Rob
11-19-2008 7:32 AM
One use of this "1=2" is in smartforms also, it will comment the window. :). I dont see any other use anywhere.
11-19-2008 8:46 AM
Thank you i found a suitable conclusion thanks. The problem was that there was a dynamic function which is using another which when i looked i only found that the function was being used between
if 1 = 2
(Function module)
endif.
so i was wondering where else it was used.
Thank you all.
11-19-2008 8:01 AM
If have seen this in SAP standard programs when an error message is created dynamically e.g. via a subroutine. By sending the error message also directly inside this never-true-condition, the where-used-list for that message will find this spot, otherwise it would not.
Thomas