Skip to Content

it is related to cl_java_script

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Aug 29, 2018 at 01:23 PM

    Hello,

    Need more info?

    This does not look like a Crystal Reports formula so not sure why you post with the CR SDK tag?

    Add comment
    10|10000 characters needed characters exceeded

    • extremely sorry but i dont know how ask the question so it was asking me tag somthin so ihave tag crystal report will please tell me how to write the exception :- divide by zero for above program .your help mean a lot

  • Sep 06, 2018 at 12:58 PM

    Are you using Crystal Reports?

    If you are than what version?

    If not what application are you using?

    Add comment
    10|10000 characters needed characters exceeded