Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

TRY and ENDTRY

Former Member
0 Kudos
108

Hi all,

I have program to upload data in XML format, in certain cases, the program end with shortdump.

It's happen when program reading upload file (READ DATASET).

Is it posible we avoid the shortdump? may be there is any statement to handle the error so program can continue run?

Because i can to create error log report for this upload program, so we can inform to user which file is error.

I read TRY-ENDTRY, is it posible to user it?

regards,

Hengky

4 REPLIES 4

Former Member
0 Kudos
67

what is the dump?

Sumit

0 Kudos
67

I'm forget the Shortdump, it looked like unicode error or something.

The thing that I need is I want program can continue even the file is error, so I can report to user which file is needed correction.

regard,

Hengky

Former Member
0 Kudos
67

Hi,

do it like this:

TRY.
 READ DATASET...
 CATCH CX_SY_CODEPAGE_CONVERTER_INIT.
* Log message: The required conversion in not supported
 CATCH CX_SY_CONVERSION_CODEPAGE.
* Log message: Convesrsion is not possible
 CATCH CX_SY_FILE_AUTHORITY.
*Log message: No authorization for access to a file
 CATCH CX_SY_FILE_IO.
* Log message: When reading the file, an error occured
 CATCH CX_SY_FILE_OPEN.
*Log message: The file could not be opened
 CATCH CX_SY_PIPE_REOPEN.
* Log message: Pipe closed
ENDTRY.

For more info on these exceptions, see [READ DATASET|http://help.sap.com/abapdocu_70/en/ABAPREAD_DATASET.htm].

Regards,

Adrian

0 Kudos
67

And if You want to make it properly, do the same also for OPEN DATASET and CLOSE DATASET. Exceptions which can occur by these two statements can be found in [Statements for the ABAP File Interface |http://help.sap.com/abapdocu_70/en/ABENFILE_INTERFACE_STATEMENTS.htm].

Adrian