BSP Concepts

 

Application Class
Statefull/Stateless

 

Application Class

The application class, is a regular ABAP Objects class, that can be assigned to the BSP application, to ebcapsulate the BSP logic ans store data and make it available across BSP pages. This data is stored as attributes.

The only requirement for an application is that the constructor is parameter-less. If not, the application class cannot be generically instantiated by the BSP runtime environment.

The global object application can be used in the BSP application to access the attributes and methods of the application class.

You do not have to use an application class in your BSP application. It is an optional way for you to structure your BSP application

The application class is assigned to the properties of the BSP application:

 

Application Basis Class CL_BSP_APPLICATION

If an application class does not already have a super class, it can be derived from the predefined base class CL_BSP_APPLICATION. This class provides methods that are typically required by a BSP application for embedding in a Web environment. This is how information about the current BSP application (such as session timeout, current URL of BSP application, state mode, and so on) can be called or set.

As the application object is an application attribute in every BSP event handler, the methods of the CL_BSP_APPLICATION class are also available with the corresponding inheritance. This makes it easy to provide the relevant functionality to lower application levels using a single object reference

Using the application class in an event

The application class is used just as an ordinary class
CALL METHOD application->kunde_gettable
  IMPORTING
    kunde_table = i_zkunder.

Statefull/Stateless

Statefull

A stateful BSP application is executed like a normal SAP transaction, – independent of all user interactions - in one single context (roll area). This means that data specified by the user during the application execution or data determined by the application itself is available potentially throughout the entire execution duration of the session.

Stateless

Stateless BSP applications only block resources on the SAP Web Application Server during the time one single request is being processed. When the request has been processed, all resources in particular the application context are returned to the system for use in other requests.

Statefull or Stateless ?

As a rule of thumb, it is recommended that Internet scenarios used at the same time by a large number of users operate in stateless mode. Stateful programming is recommended for more complex applications that are used by a limited number of users in parallel and that operate with data that is expensive to determine.

Converted from CHM to HTML with chm2web Standard 2.7 (unicode)