Skip to Content
author's profile photo Former Member
Former Member

Q: What does this statement do?

Hi Experts,

I have come across the following code (in a SAP standard function module):

F 1 = 2. MESSAGE E008(R3). ENDIF.

Can somebody please explain what this does? As I see it 1 is never equal to 2, so this if-statement is never true, hence I do not see the point of having it...

Thank you in advance,

Mikael

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    Posted on Aug 14, 2009 at 07:30 AM

    > Hi Experts,

    >

    > I have come across the following code (in a SAP standard function module):

    >

    > IF 1 = 2. MESSAGE E008(R3). ENDIF.

    >

    > Can somebody please explain what this does? As I see it 1 is never equal to 2, so this if-statement is never true, hence I do not see the point of having it...

    >

    > Thank you in advance,

    > Mikael

    Hello Mikael,

    This gives a reference as to where the message E008 of Message Class R3 is being used.

    SAP uses this cheeky trick to keep track where this message is being used.

    BR,

    Suhas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 14, 2009 at 07:44 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 14, 2009 at 07:28 AM

    It will throw an compilation error.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 14, 2009 at 07:36 AM

    Check if Is validating for variable F1 = 2

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 14, 2009 at 07:37 AM

    Hi Mikael Kilåker ,

    This type of comment is being used when we are developing smart forms, in that case if we need to comment some text box then in condition tab we used to put 1 = 2, which is never possible and that is commented.

    So its totally upto the developer if he even uses it in normal coding.

    Thanks

    Rohit G

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 14, 2009 at 07:38 AM

    Hi,

    If 1 = 2.

    msg..........

    endif.

    If the condition is true then only it will show that message in else part you should give some message.

    That condition is useless. No use in the progarm,

    Did u check out declaration part? wheather macros are defind?

    regards,

    pravin

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.