2009 Mar 26 2:06 PM
Hello All,
Is there any disadvantage to use try and end try in the program.
I have developed a custom program. At starting of the program i have used TRY and at end of the program i have used catch and end try.
In order to avoid at any case short dumps in program.
Again inside the code at certain cases were the shot dump is expected i have used TRY and Catch, End try.
Please let me know is this good idea, to use try and End try in first and last of the program.
Thank you very much in advance.
Code :
Staring of the program TRY.
Select....
Perofm.....
Write ,....
Perofm.....
End of the program CATCH cx_root INTO l_oref.
l_text = l_oref->get_text( ).
MESSAGE l_text TYPE 'E'.
ENDTRY.
Thanks,
Feroz.
Hello All,
Is there any disadvantage to use try and end try in the program.
I have developed a custom program. At starting of the program i have used TRY and at end of the program i have used catch and end try.
In order to avoid at any case short dumps in program.
Again inside the code at certain cases were the shot dump is expected i have used TRY and Catch, End try.
Please let me know is this good idea, to use try and End try in first and last of the program.
Thank you very much in advance.
Code :
Staring of the program TRY.
Select....
Perofm.....
Write ,....
Perofm.....
End of the program CATCH cx_root INTO l_oref.
l_text = l_oref->get_text( ).
MESSAGE l_text TYPE 'E'.
ENDTRY.
Thanks,
Feroz.
2009 Mar 26 2:12 PM
I don't see any disadvantage in using TRY.. ENDTRY block.
But if you are expecting runtime erroe in your code then you should first try to fix the logic rather than using TRY..ENTRY...
In other cases for example sap standard FM or method call it is nice to keep it in TRY .. ENTRY...
Thats my opinion...
2009 Mar 26 4:28 PM
Hello all,
I have developed an Input interface. For this interface i will get the data from the external system in text file format. If the text file contains any unexpected error data then program should not go to dump it should raise an error message.
So i have added Try and EndTRY block for the whole program so i f any unusnally un expected cases this try block and avoid the short dump.
Note : For all the expected cases i have did the required error handling.
Thanks,
Feroz.
2009 Mar 26 2:27 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |