Application Development and Automation 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: 
Read only

If ( 1 = 2 )

Former Member
0 Likes
1,207

I was debugging a standard BAPi and found one statement which is as below:-

if ( 1 = 2 ). message e537(b1) with '' '' ''. endif.

Could anyone please let me know what really does the statement mean??

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
967

Hello Abhishek,

This is a street-smart trick by SAP

In BAPIs you donot use the message directly using MESSAGE stmt. You fill the message in the RETURN table. So while calling the BAPI if you get a message in the return it will be difficult to trace the source.

With 1 = 2 statement, you can do a "Where-Used" for the message and check where & why the message is being raised.

Hope i am clear.

BR,

Suhas

I was debugging a standard BAPi and found one statement which is as below:-

if ( 1 = 2 ). message e537(b1) with '' '' ''. endif.

Could anyone please let me know what really does the statement mean??

5 REPLIES 5
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
968

Hello Abhishek,

This is a street-smart trick by SAP

In BAPIs you donot use the message directly using MESSAGE stmt. You fill the message in the RETURN table. So while calling the BAPI if you get a message in the return it will be difficult to trace the source.

With 1 = 2 statement, you can do a "Where-Used" for the message and check where & why the message is being raised.

Hope i am clear.

BR,

Suhas

Read only

Former Member
0 Likes
967

Hello

Check this links:

May be it will help you

Read only

Former Member
0 Likes
967

This statement will never execute which anyways is obvious, but if u are asking y is it there at the first place then might be possible SAP has placed it so that it may replace the condition with some actual condition in its future releases.

Read only

former_member217544
Active Contributor
0 Likes
967

Hi,

Check this link:

Regards,

Swarna Munukoti.

Read only

Former Member
0 Likes
967

Hi

Just to skip the abap code lines into the IF control: the same result would be got if those lines were deleted or commented:

IF 1 = 2.
   message e537(b1) with....
ENDIF.

* message e537(b1) with...

I can only suppose the developer didn't want to delete or comment the line, so he has inserted the lines in a IF condition is always false.....

....only the developer can know what the statament really means....

Max