14.01.2020 Views

ABAP_to_the_Future

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5

Debugger Scripting

METHOD end.

*** insert your code which shall be executed at the end of the

*** scripting (before trace is saved) here

TRY.

CALL METHOD appl_log->display_log

EXPORTING

p_title = 'Laughing Monster Log'.

CATCH cx_tpda_application_log .

RETURN.

ENDTRY.

ENDMETHOD."end

Listing 5.9 End Script

Now, perform a syntax check on your script to make sure everything is okay, and

then you can save your script to the database via the Save As button (the screen

shown in Figure 5.10 appears). That way, if you need to execute the program

being debugged 500 times in a row, each time you simply press the Load Script

button to get to your debugger script, ratherthan having to write the script again.

(You will notice that you can also save debugger scripts to local files, and then

upload them to a different SAP system.)

Figure 5.10 Saving a Debugger Script

Last but not least, run your script by pressing the Start Script button. You cannot

see that anything is happening until the point is reached in your script in which

a breakpoint is forced and control is returned to the normal debugger. When that

happens, you’ll see a choice of two buttons to click (Figure 5.11).

220

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!