Entering content frame

Function documentation CLEAR_BREAKPOINT Locate the document in its SAP Library structure

Function

Clears a breakpoint in a script of the current context.

Importing Parameter

SCRIPT_NAME (Type STRING)

Name of the script in the current context.

LINE_NUMBER (Type I)

Line number in which the breakpoint is to be cleared.

Example

Example

report DEMO_JAVA_SCRIPT_CLEAR_BREAK.

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,"; '
  'string += " this";           '
  'string += " is";             '
  'string += " JavaScript!";    '
  '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 = 2 ).

JS_PROCESSOR->EXECUTE(
              exporting SCRIPT_NAME = 'HELLO_WORLD.JS' ).

GET_VALUE = JS_PROCESSOR->GET( NAME = 'string' ).
write / GET_VALUE.

JS_PROCESSOR->CLEAR_BREAKPOINT(
       exporting
         SCRIPT_NAME = JS_PROCESSOR->BREAKPOINT_SCRIPT_NAME
         LINE_NUMBER = JS_PROCESSOR->BREAKPOINT_LINE_NUMBER ).

JS_PROCESSOR->EXECUTE(
              exporting SCRIPT_NAME = 'HELLO_WORLD.JS' ).

GET_VALUE = JS_PROCESSOR->GET( NAME = 'string' ).
write / GET_VALUE.

In the script HELLO_WORLD.JS, a breakpoint is set in line 2 with SET_BREAKPOINT, the script is executed with EXECUTE, the breakpoint is cleared using the instance attributes BREAKPOINT_SCRIPT_NAME and BREAKPOINT_LINE_NUMBER with CLEAR_BREAKPOINT, and the script executed once again. Each time the script is executed, the current value of the variable string is read with GET.

 

 

Leaving content frame