Entering content frameFunction documentation OnCreate Locate the document in its SAP Library structure

Use

OnCreate is used when a page is called for the first time, and performs a once-off data initialization or object creation.

OnCreate is called each time that the BSP page class is created. You can therefore initialize the page object (in object-oriented thought, this corresponds to the constructor). OnCreate initializes the parts of the object that are created once and then used for the entire lifetime of the object, such as the online shopping basket.

create object shopbasket.

The data that is used to fill the object is read in the event handler OnInitialization

The BSP application is called in the following cases:

The opposite of OnCreate is OnDestroy.

Integration

OnCreate is useful mainly in stateful applications, because in stateless mode, the page object is reinitialized every time the page is called. In you are working in stateful mode without an explicit navigation path, and if you run the page a second time (reuse the page), the page instance remains constant. OnCreate is not run the second time.

See also: Stateful and Stateless BSP Applications

Functions

You can access the following objects in the implementation:

Object

Reference Type

Description

APPLICATION

type ref to application class

Application class refers to the individual application or application class specified in the BSP application. If there is no application class in the BSP application, this means that the object application is not available.

RUNTIME

type ref to IF_BSP_RUNTIME

The runtime object is defined in interface IF_BSP_RUNTIME .

PAGE

type ref to IF_BSP_PAGE

Page object is defined in interface IF_BSP_PAGE.

PAGE_CONTEXT

type ref to IF_BSP_PAGE_CONTEXT

Page context object is defined in interface IF_BSP_PAGE_CONTEXT.

 

 

Leaving content frame