|Home • Trainings • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us|
If 1=2. What is this code about?
We all might have seen the code "IF 1=2. ....do this...EndIF" and we also know that this code never turns true. The main purpose of such code is for "Maintainability" of the program. Confused?? Read the following:
Depending upon the scenario, we would either issue the messages in the program using MESSAGE statement or sometimes might have to call the standard function module MESSAGE_PREPARE to prepare the whole message and use it wherever required.
CALL FUNCTION 'MESSAGE_PREPARE'
Assume that we have defined custom message class for issuing the messages. If we have to modify certain message in this message class, we first need to check for the where-used list of the message to study the impact of the message change. If the message is issued using the MESSAGE statement in any program, then that program would appear in the where-used list. But if the message is used in the program using the FM MESSAGE_PREPARE or any similar function module, then this program would not appear in the where-used list. So in order to have this program include in the where-used list, we would code the following after the call to the function module MESSAGE_PREPARE.
Since the check "IF 1=2" never gets true, the message would never trigger in the program and this program would appear in the where-used list of that message.
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM
©2006-2007 SAPTechnical.COM. All rights reserved.
product names are trademarks of their respective companies. SAPTechnical.COM
is in no way affiliated with SAP AG.
Graphic Design by Round the Bend Wizards