Application Development and Automation 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: 
Read only

try and catch

Former Member
0 Likes
709

hi , i am getting a value from file . i have to check whether it is pacri decimal value or not . for this which exception should i raise in the try and catch block. can any one give me the code???

2 REPLIES 2
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
489

Hi,

Try using CX_SY_CONVERSION_NO_NUMBER.

OR you can create an exception class specific to your need in SE24.

Regards,

Sesh

Read only

Former Member
0 Likes
489

Depending on whether your report has the flag "Unicode-enabled" set or not you will get a different result of the syntax check (SLIN) for statement

s_struc-t_table = itab1.

- Unicode-enabled = 'X': => syntax error if the structures do not match exactly

- Unicode-enabled = ' ': => perhaps no syntax error but system-exceptions due to type conversion errors possible

In the latter case you would use the following statement:

CATCH SYSTEM-EXCEPTIONS <type conversion error> = 1.

s_struc-t_table = itab1.

...

ENDCATCH.

However, please note that the CATCH SYSTEM-EXCEPTIONS is different from class-based exception handling because this statement does not return any error object.

Regards