Function
To continue the script that is in debugging mode in the current context (only after it is called by EXECUTE). CONTINUE executes the function right to the end or to the next breakpoint and, therefore, has the same effect as Execute (F8) in the ABAP Debugger.
Returning Parameter
RESULT (Type STRING)
Value of the last statement executed in the script. The result of CONTINUE is, therefore, only achieved when the final statement has been reached.
Example
report DEMO_JAVA_SCRIPT_CONTINUE.
data SOURCE type STRING.
data GET_VALUE type STRING.
data JS_PROCESSOR type ref to CL_JAVA_SCRIPT.
JS_PROCESSOR = CL_JAVA_SCRIPT=>CREATE( ).
concatenate
'var string = "Hello World,"; '
'function Set_String() '
' { string += " this"; '
' string += " is"; '
' string += " JavaScript!";} '
'Set_String(); '
'string; '
into SOURCE separated by CL_ABAP_CHAR_UTILITIES=>CR_LF.
JS_PROCESSOR->COMPILE(
exporting
SCRIPT_NAME = 'HELLO_WORLD.JS'
SCRIPT = SOURCE ).
JS_PROCESSOR->SET_BREAKPOINT(
exporting
SCRIPT_NAME = 'HELLO_WORLD.JS'
LINE_NUMBER = 1 ).
JS_PROCESSOR->SET_BREAKPOINT(
exporting
SCRIPT_NAME = 'HELLO_WORLD.JS'
LINE_NUMBER = 4 ).
JS_PROCESSOR->EXECUTE(
exporting SCRIPT_NAME = 'HELLO_WORLD.JS' ).
JS_PROCESSOR->CONTINUE( ).
GET_VALUE = JS_PROCESSOR->GET( NAME = 'string' ).
write: / JS_PROCESSOR->BREAKPOINT_LINE_NUMBER, GET_VALUE.
JS_PROCESSOR->CONTINUE( ).
GET_VALUE = JS_PROCESSOR->GET( NAME = 'string' ).
write: / JS_PROCESSOR->BREAKPOINT_LINE_NUMBER, GET_VALUE.
Two breakpoints are set in the HELLO_WORLD.JS script. After switching to debugging mode with EXECUTE, CONTINUE is executed twice and the value of the variable string is read with GET. After the first CONTINUE, the script stops at the breakpoint in line 4. After the second CONTINUE, the script is executed to the end.
s