2009 Jul 06 10:42 AM
Hi Gurus,
I have a question. Will the code inside try...endtry be executed if TRY statement fails.
To be specific, see my scenario below. itab is an internal table with only one field 'line' of type c and length 100. cx_sy_conversion_codepage is used to handle unicode error. How will the code below work if itab-line has a unicode error?
Will it skip that particular line or will that line be moved to the unix file?
LOOP AT itab.
TRY.
TRANSFER itab-line TO unix_file.
CATCH cx_sy_conversion_codepage.
ENDTRY.
ENDLOOP.
Thank you,
Nobin
Hi Gurus,
I have a question. Will the code inside try...endtry be executed if TRY statement fails.
To be specific, see my scenario below. itab is an internal table with only one field 'line' of type c and length 100. cx_sy_conversion_codepage is used to handle unicode error. How will the code below work if itab-line has a unicode error?
Will it skip that particular line or will that line be moved to the unix file?
LOOP AT itab.
TRY.
TRANSFER itab-line TO unix_file.
CATCH cx_sy_conversion_codepage.
ENDTRY.
ENDLOOP.
Thank you,
Nobin
2009 Jul 06 10:45 AM
As per ur sample code. The exception will be caught. No DUMP will happen.
U can you that exception & raise a message or do the further processing.
Regards,
Bhargava
2009 Jul 06 10:50 AM
Hi,
Will that particular record be moved to the unix file or will that be skipped?
Thanks
2009 Jul 06 10:56 AM
Hi,
The record won't be moved if an exception occurs.
Regards,
Anand Patil.
2009 Jul 06 11:04 AM
2009 Jul 06 10:58 AM
The catch statement will only handle the class-based exception in the try block, since the error in your case is not the class based one, it will not be handled. It is handled by the system in the same way as it is written outside the try block.