Copyright 2024 - BV TallVision IT

BSP control from ABAP programming is done by 6 event handlers. How they should (could) be used is outlined in this article.

An example BSP program run

Let's say your end user starts your BSP application. Event handlers are called in the following sequence and a brief example of what can be done in the event is explained:

  1. The BSP is started (the BSP url is being addressed) - when the BSP first starts, the OnCreate handler is called. In effect the html page which is set up as the first page in the Navigation tab on the BSP itself is called. This page is often called default.htm. For this page the OnCreate handler is called starting off your application. The main selections that are needed for your BSP are done here, much comparable with the INITIALIZATION event from a regular ABAP report. Data selection before the report event shows a selection screen. OnCreate is only started once per (statefull) BSP session.
  2. Then event handler OnRequest is started, which is much like the PBO (Process Before Output) of a classic dynpro. When you are displaying e.g. a company code, this is where the company code description can be picked up. The OnRequest handler is called every time the html is about to be displayed.
  3. The next event handler to be started is OnInitialization, which is called when first processing a page (but after OnRequest). Thus: you have prepared a page which is presented to the end user. When it "comes back" the first time the OnInitialization event handler is called.
  4. Event handler OnManipulation can be used to "post-process" the http data stream. Typically for HTTP requests that are not about a user dialog...
  5. Then there is the OnInputProcessing event handler, which is all about user dialog. The end-user input is picked up and a response is prepared. Maybe best compared with PAI processing of the end-user action (a menu option).
  6. To clear up whichever loose ends the BSP application may have, the OnDestroy event handler is called just before deleting the page instance.