
Setting Stylesheets for HTMLB and XHTMLB
Use
So that BSP applications look uniform, within BSP extensions
HTMLB and XHTMLB you can use stylesheets, JavaScript files and pictures that are stored in the MIME repository. These stylesheets, JavaScript files and pictures are usually located on the same SAP Web Application Server. The default path in the MIME repository is: /sap/public/bsp/sap/public/bc/(x)htmlb. The *.css and *.js files are stored below directories htmlb and xhtmlb. The *.gif files are located in an additional sub-directory.In specific cases you may want to change the appearance of the
HTMLB or XHTMLB libraries. This may be necessary, for example, if a customer’s corporate identity should be depicted exactly. In this case we recommend that you copy and modify the files from the MIME repository for the HTMLB and XHTMLB libraries.For this reason, the BSP runtime and HTMLB manager contain an infrastructure for handling paths to other locations, from where you may want to insert stylesheets, JavaScript files or pictures.

Alternatively, you can use the theme concept of the MIME repository to change specific files to a different theme.
You can find additional information in
Layout Adjustments to BSP Applications.
Prerequisites
You are using a system from SAP Web AS 6.20 and have implemented at least Support Package 7.
Functions
A new directory such as
\myRoot is created. This directory has the subdirectories \HTMLB and \XHTMLB and their corresponding files.
You only need to copy the
The sample directory structure now looks as follows:
To use the new directories for your BSP extensions and, therefore, in your BSP applications, use the URL parameter
sap-themeRoot.
When you specify the external path, be aware of "URL escaping". Usually the colon (
Here are a few examples with "URL escaping" (
%2F and %3A):
Example of
Example of
/myRoot on a different host:In case specific BSP applications run as public applications and do not require authentication steps, you could proceed as follows: If the copied stylesheets are stored on the SAP Web AS again, you can set up an
External Alias (see also
Creating an ICF Service) and then access the stylesheets using this alias.
In future, several themes will be delivered with
HTMLB/XHTMLB. These additional themes are stored in subdirectories in the MIME repository.
Note that the

In this example we are assuming that the theme "mono" will be delivered in future. The structure in the MIME repository then looks as follows:
/sap/public/bsp/sap/public/bc/htmlb/controls_*.css
/sap/public/bsp/sap/public/bc/htmlb/mono/controls_*.css <-- other theme
/sap/public/bsp/sap/public/bc/htmlb/design2002/controls_*.css <-- new design
/sap/public/bsp/sap/public/bc/htmlb/design2002/mono/controls_*.css <-- other theme
/sap/public/bsp/sap/public/bc/xhtmlb/controls_*.css
/sap/public/bsp/sap/public/bc/xhtmlb/mono/controls_*.css <-- other theme
Note the following points:
The same
sap-themeRoot can be used to access the alternative themes specified in the example above. Use the sap-themeRoot=name to access the various themes that are delivered for the HTMLB/XHTMLB libraries.
http://host.domain.ext:port/sap/bc/bsp/sap/sbspext_htmlb/button.bsp?sap-themeRoot=mono
In all of the above examples, the new
sap-themeRoot is coded in the URL as a URI parameter (URL mangling is not executed until the SAP Web AS System is accessed for the first time).There are, however, cases where it would be practical to set the
sap-themeRoot directly in the program. The BSP element <htmlb:content> was enhanced with the themeRoot attribute that has exactly the semantics explained above. Since however URL mangling is not carried out when the BSP page is processed, this means that this attribute is only used on the specific page on which is was also set. We recommend that if this attribute should be used, you should set it for all pages.
<htmlb:content design="design2002" themeRoot="mono">