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.

Coding the INIT and END Methods 5.3

Figure 5.11 Exit or Continue Script

If you press the Continue Script button, then nothing at all happens; the program

ends normally. If you press the Exit Script button, then the script does

indeed finish, but first the END method is run, resulting in the application log

being displayed as shown in Figure 5.12. The log is displayed because of the code

in the END method (Listing 5.9) that makes it happen.

One of the great features of the application log is that you can nest messages in a

tree structure. Therefore, if you are loggi ng a colossal amount of steps, you can

set the initial display to be at a very high level, with a red blob at the top level if

any of the lower steps caused an error. In this example, a programmer can look at

the error lines on the application log and see at once that the first two trigger

points are the numbers one and two instea d of three, six, and nine. Then the

cause of the error becomes obvious, the programmer changes the DIV to MOD, and

all is well.

Figure 5.12 Application Log in a Debugger Script

221

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

Saved successfully!

Ooh no, something went wrong!