|
||||
| Home • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us | ||||
Document Categories:
What's New?
Contribute?Sample SpecsWhat's Hot? |
The new 'RETRY' statement in TRY...ENDTRY blockBy B.Manoj Kumar A new statement is introduced by SAP
in NetWeaver Enhancement Package 2 called ‘RETRY’,which
allows us to retry a TRY block
that raised the exception , right from the start. The RETRY
statement can only be executed in the CATCH
block. If this statement is processed in the
CATCH block of an exception the whole TRY block is processed again. To understand the statement clearly
let us take a look at an example: PARAMETERS P1_VALUE TYPE I . The
above simple example demonstrates the use of RETRY
statement. Here
if the value of P2_VALUE is zero,
then CX_SY_ZERODIVIDE
exception is raised , and when it is caught by the
CATCH block, we
are setting P1_VALUE to zero and the RETRY statement
is executed which processes the whole TRY
block once again. Here I am trying to divide 4 by 0.
If we debug and see the values of P1_VALUE and P2_VALUE
before the RETRY statement , the
value are 4 and 0 respectively.
So the result will be zero.
WORD
OF CAUTION But we have to cautious to correct the
cause of exception, otherwise the TRY
block results in an endless loop. Example of a TRY block going in an
endless loop when we do not correct the cause of exception. PARAMETERS P1_VALUE TYPE I . RETRY. Here the TRY block repeats endlessly, as we didn’t correct the cause of exception. |
|
||
|
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM Home • Contribute • About Us • Privacy • Terms Of Use • Disclaimer • Safe • Companies: Advertise on SAPTechnical.COM | Post Job • Contact Us ©2006-2007 SAPTechnical.COM. All rights reserved. All
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 |
||||