Entering content frameBackground documentation Integration Into BSP Applications Locate the document in its SAP Library structure

Background

As of SAP Release 6.10, the architecture of the R/3 System has encountered basic changes. The R/3 application server in this architecture can act as web server and as web client. This new architecture is called Structure link SAP Web Application Server.

Structure link BSP applications (BSP: Business Server Pages) are based on this new architecture. They allow you to develop Internet applications with scripting on the server side in ABAP or JavaScript. Since BSP applications run directly on the Web Application Server, the developer can access all the resources of the R/3 application server (such as database accesses, function module calls).

Access to these resources is driven by events. To allow activities such as data selection, initialization, or input processing before or after displaying a web page, a BSP application provides several standard events.

Note

To implement BSP applications, use the Structure link Web Application Builder.

Displaying a Web Form in the Web Application Server

With the formatted XSF output you can use the Web Application Server to send forms to the client via an HTTP response, that is, display them in the web browser:

This graphic is explained in the accompanying text

Process

  1. The BSP page is called by the user or by a preceding BSP page. The Web Application Server forwards the HTTP request to the BSP runtime environment.
  2. The BSP runtime environment triggers the Initialization event. In the relevant event handler OnInitialization you can now select data for your form - usually based on the entries the user made on the previous BSP page.
  3. To generate HTML (with embedded CSS) specify the parameters of the Smart Forms function module and call it (see: Output in HTML Format).
  4. The function module returns HTML as table in format RAW.
  5. Note

    You can encapsulate the last two steps in a method or in another function module.

  6. To display the form in the browser, use the SET_DATA method to fill the response object provided by the BSP runtime environment. This method expects the data as XSTRING . Convert the XSF output appropriately and pass the string to the response object:

* Variables for formatted XSF and conversion

data: ls_xmloutput type ssfxmlout,
      lt_html_raw  type tsfixml.

data: l_xstring      type xstring, "needed for HTTP response
      l_xlength      type i,
      l_html_xstring type xstring.

* ls_xmloutput has been returned by Smart Form

ls_xmloutput = ls_output_data-xmloutput.
lt_html_raw  = ls_xmloutput-trfresult-content[].

* Convert RAW to XSTRING

loop at lt_html_raw into l_xstring.
   concatenate l_html_xstring l_xstring into l_html_xstring
                                                  in byte mode.
endloop.

* Set header of response

response->set_header_field( name  = 'content-type'
                           value = ls_xmloutput-trfresult-type ).

* Fill response object

l_xlength = xstrlen( l_html_xstring ).

response->set_data( data   = l_html_xstring
                     length = l_xlength ).

Note

In the BSP application SF_WEBFORM_01 you can display three different forms that have not been specially adapted to web use.

Result

The Web Application Server sends the XSF output to the browser.

 

 

 

 

Leaving content frame