2009 Dec 11 9:43 AM
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??
2009 Dec 11 9:47 AM
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??
2009 Dec 11 9:47 AM
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
2009 Dec 11 9:48 AM
2009 Dec 11 9:49 AM
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.
2009 Dec 11 9:49 AM
2009 Dec 11 9:51 AM
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
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |