‎2018 Aug 30 5:28 AM
guys i have written a program to evaluate the string but while writing exception it is giving an error so i have tried an exception handling method i.e try and catch .
following is my code
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
DATA: value TYPE p DECIMALS 3 ,
str TYPE string.
DATA: ocx_root TYPE REF TO cx_root.
START-OF-SELECTION.
str = '( ( 1830 * 1000 ) / 31104 ) / 0 ' .
try.
value = cl_java_script=>create( )->evaluate( str ).
catch CX_SY_CONVERSION_NO_NUMBER into ERROR_REF.
ERR_TEXT = ERROR_REF->GET_TEXT( ).
write ERR_TEXT.
endtry.
‎2018 Aug 30 12:53 PM
Your syntax (implicit conversion expected?) triggered a non-handleable exception in the call of the class, you could use an intermediate string field to get a handleable exception.
numfield = cl_java_script=>create( )->evaluate( str ). " not handleable
numfield = stringfield = cl_java_script=>create( )->evaluate( str ). " handleable
‎2018 Aug 31 6:42 AM
first of all thanks for precious reply brother
but this code is not working as i have use this code before u send me i was thinking i have written it wrong way.
will send me complete code so i can added it in my program .
‎2018 Aug 31 9:13 AM
‎2018 Sep 01 3:43 AM
thank you 'ray' brother yesterday only done that report using this method thank you once again