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:
- 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 calleddefault.htm
. For this page theOnCreate
handler is called starting off your application. The main selections that are needed for your BSP are done here, much comparable with theINITIALIZATION
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. - 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. TheOnRequest
handler is called every time the html is about to be displayed. - The next event handler to be started is
OnInitialization
, which is called when first processing a page (but afterOnRequest
). Thus: you have prepared a page which is presented to the end user. When it "comes back" the first time theOnInitialization
event handler is called. - Event handler
OnManipulation
can be used to "post-process" the http data stream. Typically for HTTP requests that are not about a user dialog... - 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). - To clear up whichever loose ends the BSP application may have, the
OnDestroy
event handler is called just before deleting the page instance.