Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Is 1 ever equal to 2

Former Member
0 Kudos

Hello Guru's

Can anyone explain to me how the syntax

IF 1 = 2.

.....

ENDIF.

works, is this ever the case?

7 REPLIES 7

Sandeep_Kumar
Advisor
Advisor
0 Kudos

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

amit_khare
Active Contributor
0 Kudos

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.

former_member206439
Contributor
0 Kudos

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

0 Kudos

>

> You can write the syntax like this but for this sy-subrc allways return value 4 means not successfull.

Picture of an owl.

Rob

Former Member
0 Kudos

One use of this "1=2" is in smartforms also, it will comment the window. :). I dont see any other use anywhere.

0 Kudos

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.

ThomasZloch
Active Contributor
0 Kudos

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