
Integration Into BSP Applications
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
SAP Web Application Server.
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.

To implement BSP applications, use the
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:

Process

You can encapsulate the last two steps in a method or in another function module.
* 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 ).

In the BSP application
Result
The Web Application Server sends the XSF output to the browser.