
SAP GUI for HTML Architecture
SAP GUI for HTML Server
The SAP GUI for HTML is driven by the Internet Transaction Server (ITS). The ITS interfaces between a ‘stateless’ Web server (HTTP protocol), which communicates with Web browsers via single request/response cycles, and a ‘stateful’ R/3 System (SAP GUI protocol), where running business transactions depends on internal status.
The following graphic shows one complete SAP GUI for HTML request/response cycle:

When the user starts a SAP GUI for HTML session from a Web browser, the request/response cycle comprises the following steps:
A style is a configurable set of rules that define how each user interface element found on an R/3 transaction screen is mapped to HTML.
In order to maintain the user’s context in R/3, the AGate maintains the connection to the R/3 System during the entire SAP GUI for HTML session, but the link between the Web browser and the Web server is closed after each request/response cycle.
For every subsequent request after the session has been established, the Web browser uses cookies to send a session identifier with the HTTP request that uniquely identifies the connection to R/3.
In each subsequent dialog step in the Web browser, the user changes a set of screen fields. The Web browser sends these fields to the Web server and WGate, which passes them to AGate. Thanks to the unique session identifier sent in the request data, AGate finds the connection to the R/3 System and sends the changed screen fields to the R/3 System along with an OK code. The R/3 System returns a changed SAP screen that is converted to HTML either by using the standard styles or a customer’s own HTML template.
HTML Generation

Communication with the R/3 System is handled by the DIAG protocol interpreter, which provides a corresponding C++ object for every dialog object on the transaction screen. These C++ objects are organized in an object tree. Each C++ class provides member functions to access – and change - the specific attributes of the corresponding dialog object.
The SAP GUI for HTML server traverses the object tree and retrieves all dialog object attributes required for the HTML presentation. Object attributes are made available to HTML templates and standard styles in the form
<object>.<attribute>.
The SAP GUI for HTML controller (screen layout manager) traverses the dialog object tree created by the DIAG protocol interpreter. During this process, the controller applies HTML styles to every object to convert the R/3 screen to an HTML page. These styles are implemented by HTMLBusiness functions for each screen element.
The controller performs the following tasks:
HTML Styles
To merge dialog object attributes into otherwise static HTML pages, the SAP GUI for HTML server provides the HTMLBusiness interpreter, which evaluates the HTMLBusiness functions.
HTMLBusiness functions can have any number of parameters.
For example, the function
tablecontrol has several parameters to configure a table control.Here is the code for the HTML style
tablecontrol:function tablecontrol( ~tcname, X,Y,width,height,with_position=1 )
write("<!-- TableControl " ,~tcname,"-->\n") ;
if ( ^~tcname.columnCount == 0 )
return("") ;
end ;
if ( with_position==1 )
<!--divbegin(x,y,width,height) ; -->
write("<div class=\"all\" style=\"overflow:
auto;width:",~font_size*width,";") ;
abs_position(X,Y) ;
abs_size(width,height) ;
write("\">") ;
else
write("<div class=\"all\" style=\"overflow:
visible;width:",~font_size*width,";") ;
write("\">") ;
end ;
tablecontrol_main(~tcname);
divend() ;
end ;
Every
write statement sends HTML code to the Web browser.