Entering content frameFunction documentation STEP_INTO Locate the document in its SAP Library structure

Function

Single step of the script that is in debugging mode in the current context. STEP_INTO goes to function calls and, therefore, has the same effect as the Single step function (F5) in the ABAP Debugger.

Returning Parameter

RESULT (Type STRING)

Value of the last statement executed in the script. The result in STEP_INTO is, therefore, only achieved when the final statement has been reached.

Example

Example

report DEMO_JAVA_SCRIPT_STEP_INTO.

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->EXECUTE(
              exporting SCRIPT_NAME = 'HELLO_WORLD.JS' ).

while JS_PROCESSOR->LAST_CONDITION_CODE =
                    CL_JAVA_SCRIPT=>CC_BREAKPOINT.

  get_value = JS_PROCESSOR->get( NAME = 'string' ).
  write: / JS_PROCESSOR->BREAKPOINT_LINE_NUMBER, get_VALUE.

  JS_PROCESSOR->STEP_INTO( ).

endwhile.

The example works in the same way as the STEP example. The Set_String function is, however, resolved here.

Leaving content frame