
Interface IF_BSP_PAGE provides access to information about a BSP such as page names, lifetime, the associated BSP application, URL of the page, etc. IF_BSP_PAGE is implemented by class CL_BSP_PAGE, which is the the base class of all BSPs. Consequently, the methods and attributes of this interface are indirectly available by inheritance in all BSPs and can be accessed with the appropriate qualification via the interface name (for example name = if_bsp_page~get_page_name( ).). This interface can also be accessed in all BSP event handlers (see Event Handler) by using parameter page (see page). It can therefore also be accessed in deeper-lying application layers, should this be necessary. In particular, the BSP page attributes can be read and set using the methods get_attribute() and set_attribute().
Implementing Classes |
CL_BSP_PAGE |
Enhanced Interface |
None |
Specializing Interfaces |
None |
Attribute Name |
Declaration Type |
Description |
co_format_currency |
Constant |
write() or to_string() method: Displayed as currency |
co_format_long |
Constant |
write() or to_string() method: Long output |
co_format_lower |
Constant |
write() or to_string() method: Displayed in lower case |
co_format_none |
Constant |
write() or to_string() method: Default format |
co_format_short |
Constant |
write() or to_string() method: Short display |
co_format_upper |
Constant |
write() or to_string() method: Display in upper case |
lifetime_page |
Constant |
Page is valid until explicit navigation away from this page |
lifetime_request |
Constant |
Page is only valid for this HTTP request |
lifetime_session |
Constant |
Page is valid for the complete session (only for stateful BSP applications) |
messages |
Instance attribute |
Reference to the messages object of this BSP |
Signature |
method get_application
returning
application type ref to object
.
|
|
Description |
This method returns the application object for this BSP. If no application class was defined for the BSP application of this page, a zero (0) reference is returned. |
|
Parameter |
- |
- |
Return Values/Exceptions |
application | Name of the BSP application |
Cross References |
||
Signature |
method get_application_name
returning
name type string
.
|
|
Description |
This method returns the name of the BSP application of this page as defined in the development environment (transaction SE80). |
|
Parameter |
- |
- |
Return Values/Exceptions |
name |
Name of the BSP application |
Cross References |
- |
|
Signature |
method get_application_start_page
returning
start_page type string
.
|
|
Description |
This method returns the start page of the corresponding BSP application as defined in the development environment (SE80). If no page was explicitly specified, the method returns the name default.htm. The start page of a BSP application is called if no specific page is included in the URL when the application is started, in other words, when the URL ends with the application name. |
|
Parameter |
- |
- |
Return Values/Exceptions |
start_page |
Start page of BSP application |
Cross References |
- |
|
Signature |
method get_application_url
returning
url type string
.
|
|
Description |
This method returns a server-specific URL that references the current BSP application, for example /sap/bc/bsp/sap/retailstore. |
|
Parameter |
- |
- |
Return Values/Exceptions |
url |
Server-specific URL of current BSP application. |
Cross References |
- |
|
Signature |
method get_attribute
importing
name type string
exporting
value type any
.
|
|
Description |
This method returns the value of the requested attribute. Since attributes can be of any type, the return value can only be untyped and must be integrated type-related when called. Caution
ABAP move logic plays a role in the assignment of the attribute value to the return value to enable the type conversion to take place. The ABAP restrictions regarding type conversion apply so that exceptions may occur in the event of incompatible type assignments. |
|
Parameter |
name | Name of attribute (case-insensitive) |
Return Values/Exceptions |
value | Attribute value |
| cx_bsp_inv_attr_name | Exception: Attribute does not exist |
|
Cross References |
See also: set_attribute() |
|
Signature |
method get_lifetime
returning
lifetime type i
.
|
|
Description |
This method returns the current settings of the lifetime of this BSP page (see lifetime_ constants of the IF_BSP_PAGE). This method has no effect on stateless applications and always returns the value lifetime_request. |
|
Parameter |
- |
- |
Return Values/Exceptions |
lifetime | Current lifetime of the BSP (see lifetime_ constants of the IF_BSP_PAGE): lifetime_page | lifetime_request | lifetime_session |
Cross References |
See also: set_lifetime, lifetime_page, lifetime_request, lifetime_session |
|
Signature |
method get_page_name
returning
name type string
.
|
|
Description |
This method returns the name of this BSP. |
|
Parameter |
- |
- |
Return Values/Exceptions |
name |
Name of BSP |
Cross References |
- |
|
Signature |
method get_page_url
returning
url type string
.
|
|
Description |
This method returns the server-specific URL for this BSP. |
|
Parameter |
- |
- |
Return Values/Exceptions |
url |
Server-specific URL of the BSP |
Cross References |
- |
|
Signature |
method get_request
returning
request type ref to if_http_request
.
|
|
Description |
This method returns an interface reference to the current HTTP request object. |
|
Parameter |
- |
- |
Return Values/Exceptions |
request | Interface reference to the HTTP request object |
Cross References |
See also: |
|
Signature |
method get_response
returning
response type ref to if_http_response
.
|
|
Description |
This method returns an interface reference to the current HTTP response object. |
|
Parameter |
- |
- |
Return Values/Exceptions |
response |
Interface reference to the HTTP response object |
Cross References |
See also: |
|
Signature |
method get_runtime
returning
runtime type ref to if_bsp_runtime
.
|
|
Description |
This method returns an interface reference to the current BSP runtime object. |
|
Parameter |
- |
- |
Return Values/Exceptions |
runtime | Interface reference to the BSP runtime object |
Cross References |
- |
|
Signature |
method serialize
returning
data type string
.
|
|
Description |
This method serializes the content of this page (after processing in the Layout event handler) in a string. This method is typically only called in the OnManipulation section of the BSP when the generated output needs to be postprocessed. However, for performance reasons this is not recommended unless absolutely necessary. Caution
The output of a BSP is no longer automatically returned to the client in the HTTP Response when this method is called explicitly. Instead, the developer is responsible for sending it. This can be done with the method if_http_response~set_cdata() and the HTTP Response Object. |
|
Parameter |
- |
- |
Return Values/Exceptions |
data |
Serialized response of the BSP after the layout section is processed. |
Cross References |
See also: |
|
Signature |
method set_attribute
importing
name type string
value type any
.
|
|
Description |
This method sets the value of the specified attribute. Since attributes can be of any type, the parameter value can only be untyped and must be integrated type-related when called. Caution
This method does not let you define new attributes dynamically at runtime. On the contrary, only attributes that were defined in the development environment (SE80) statically for the BSP page can have values assigned. Otherwise, the method will terminate with the exception cx_bsp_inv_attr_name. Caution
ABAP move logic plays a role in the assignment of a value to the attribute to enable the type conversion to take place. The ABAP restrictions regarding type conversion apply so that exceptions may occur in the event of incompatible type assignments. |
|
Parameter |
name | Name of attribute (case-insensitive) |
| value | Value of attribute (appropriately typed) |
|
Return Values/Exceptions |
cx_bsp_inv_attr_name |
Exception: Attribute does not exist |
Cross References |
See also: get_attribute() |
|
Signature |
method set_lifetime
importing
lifetime type i
.
|
|
Description |
This method sets the current settings of the lifetime of this BSP page (see lifetime_ constants of the IF_BSP_PAGE). This method has no effect on stateless applications. |
|
Parameter |
lifetime | New lifetime of the BSP (see lifetime_ constants of the IF_BSP_PAGE): lifetime_page | lifetime_request | lifetime_session |
Return Values/Exceptions |
- |
- |
Cross References |
See also: get_lifetime, lifetime_page, lifetime_request, lifetime_session |
|
Signature |
method to_string
importing
value type any
format type i optional
outputlength type i optional
num_decimals type i optional
reference_value type c
returning
string type string
.
|
|
Description |
This method formats as a string the value of a scalar ABAP variable with any type. There are several optional parameters available to let you control the formatting. The string generated can be easily integrated in the output in a BSP using the output directive <%= .. %>. |
|
Parameter |
value | Value to be formatted |
| format | Output format (see if_bsp_page~co_format_.. constants) |
|
| outputlength | Maximum output length (in characters) |
|
| num_decimals | Number of decimal places |
|
| reference_value | Reference value (for example, the currency) |
|
Return Values/Exceptions |
output |
Formatted output string |
Cross References |
See also: write() |
|
Signature |
method write
importing
value type any
format type i optional
outputlength type i optional
num_decimals type i optional
reference_value type c
.
|
|
Description |
This method outputs as a string the value of a scalar ABAP variable with any type. Output is at the current "write position" in the BSP. There are several optional parameters available to let you control the formatting. This method can be used for output in a BSP for example, in script directives <% .. %>. |
|
Parameter |
value |
Value to be formatted |
| format | Output format (see if_bsp_page~co_format_.. constants) |
|
| outputlength | Maximum output length (in characters) |
|
| num_decimals | Number of decimal places |
|
| reference_value | Reference value (for example, the currency) |
|
Return Values/Exceptions |
- |
- |
Cross References |
See also: to_string |
|
Signature |
method otr_trim
importing alias
returning
text
.
|
|
Description |
This method returns the language-dependent text for an OTR alias (short text). |
|
Parameter |
alias | Name of the defined OTR alias |
Return Values/Exceptions |
text | Text in current language |
Cross References |
See also: Internationalization and Translation |
|