Skip to Content
Author's profile photo Karthika S

Webdynpro Java supports SAP Blue Crystal Theme with sap-theme parameter

This blog describes how Web Dynpro Java framework supports new theming infrastructure and provide the possibility of defining sap_bluecrystal themes for all Web Dynpro java applications to have Fiori-like appearance. sap_bluecrystal theme will work only when the applications are rendered in Standard Mode and with sap-theme parameter.

This feature is available from NW730 SP16, NW731 SP 18, NW740 SP13 and NW750 SP4 onward.

The following document describes in detail how to define sap-theme parameter and to configure sap_bluecrystal theme for Web Dynpro java applications.

Prerequisite:

One must have knowledge about Setting Theme for Webdynpro Java application.

Refer Links:

https://help.sap.com/saphelp_nw73/helpdata/en/4a/391ad0cb1b0457e10000000a421937/frameset.htm

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/3ea0d790-0201-0010-80b8-b680496a3838?overridelayout=true

Running as a Standalone Application

If the Web Dynpro application runs as a standalone application (i.e. not inside the SAP Portal), or if the Web Dynpro runtime is configured to use the Web Dynpro theme in every case, there are two options to define the theme used by a Web Dynpro application.

You can define the default theme (i.e. the theme used by all applications running on this system) or you can define an application-specific theme.

Defining the Default Theme


Usually to define a default Web Dynpro theme, the sap.theme.default property was set in the following format: http://<host>:<port>/<path to the theme>/<theme name>.


For example: http://localhost:50000/irj/portalapps/com.sap.portal.themes.lafservice /themes/portal/sap_chrome.


Please refer Configuring the Web Dynpro Runtime Environment that describes how to configure Web Dynpro Java runtime Properties.

To set sap_bluecrystal or any theme from new theme infrastructure , as the default Web Dynpro theme, following properties has to be set in NWA.

  1. themeParameter = sap-theme
  2. themeID = provide the theme to be used. Eg: sap_bluecrystal
  3. themeLocation = Specify the  location of a theme if the theme is not in the default location for the technology.

The following screen shot shows the new Web Dynpro java properties added in NWA for configuring sap_bluecrystal theme as Web Dynpro java default theme.

BlogImage1.gif

Note

  1. If you want to use the theme that is set for the property sap.theme.default as a Web Dynpro defined theme, then you have to set the parameter themeParameter = sap-cssurl for NW versions NW730 SP16, NW731 SP 18, NW740 SP13, NW750 SP4  and above.  sap_bluecrystal theme will not work in this case.
  2. For backward compatibility Web Dynpro java supports sap-cssurl parameter. But, to use sap_bluecrystal, sap-theme parameter has to be configured. The sap-theme parameter take higher precedence over sap-cssurl.

Defining an Application-Specific Theme


Earlier to specify application specific theme, URL parameter sap-cssurl was used to define the theme. This theme was overriding any default settings.

To specify sap_bluecrystal theme as application specific theme, sap-theme parameter has to be used as the URL parameter.

Example:

http://<host>:<port>/nwa?sap-theme= sap_bluecrystal

http://<host>:<port>/nwa?sap-theme= sap_bluecrystal@http://host:port/com.sap.ui.lightspeed/themes_v2

URL-Parameter:

sap-theme=<theme-id>

sap-theme=<theme-uri>

Syntax

The validation is not case sensitive!

<theme-id> = [A-Za-z_][A-Za-z0-9_]*

<theme-uri> = <theme-id>(@<theme-root>)?(\?.*)?

Explanation

<theme-id>

Theme Id is the theme to be used by the application. Must start with A-Z, a-z or “_”. For subsequent characters also digits (0-9) are allowed.

Eg: sap_bluecrystal, sap_corbu, sap_tradeshow_plus

<theme-uri>

<theme-root>

Location of a theme must be specified if the theme is not in the default location for the technology (Optional)

Theme-uri can be

Absolute URLs start with “http://” or “https://

Relative URLs for themes located on the local server start with “/”

Absolute and relative URLs can end with or without a trailing “/”

@ Separator between <theme-id> and <theme-root>(theme location)

| RESERVED (should not be used as part of the themeroot URL)

> RESERVED (should not be used as part of the themeroot URL)

? Append additional parameters which are for technology specific evaluation (not used yet)

The following screen shot shows nwa application rendered with sap_bluecrystal theme.

BligImage2.gif

Running Inside the SAP Enterprise Portal

As you already know , when Web Dynpro java applications are running inside the SAP Enterprise Portal, the portal defined theme is automatically used by the Web Dynpro java applications. Also, any user or role-based personalization of the theme is automatically used by the Web Dynpro applications.

If sap_bluecrystal theme is defined in the Portal then when the Portal is in LESS mode(the new theming structure) and the browser is in Standard Mode, Web Dynpro java applications running in  Portal will be rendered with sap_bluecrystal theme.  SAP Enterprise Portal ensures that when Portal is in LESS mode, sap-theme parameter is passed to Web Dynpro java framework with the appropriate value.

For Web Dynpro application running in portal if Web Dynpro theme has to be used instead of the portal theme, sap.useWebDynproStyleSheet property has to be set to true .

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Rolf Paulsen
      Rolf Paulsen

      Hi Karthika,

      Thank you for sharing this, helped us a lot. Far better than SAP help or information spread over several SAP notes.

      Regards
      Rolf

      Author's profile photo Julio Alberto Martinez Real
      Julio Alberto Martinez Real

      is there any plan for sap belize theme??

      Author's profile photo Archana Prasad
      Archana Prasad

      This document is detailed. And today i came to know that  even when the theme location or if any value is specified wrongly, the application does not fail. Instead fall back mechanism is already implemented to render WD application in default theme. Thats awesome and taken care well.

      Author's profile photo Hamdorf Tobias
      Hamdorf Tobias

      Hi Karthika,
      can you describe how to set default theme param for custom themes? I had this param working with the SAP Themes but the one i created does never work? How does the URL look for custom themes?

      By the way we are one 7.5 SP2

      Best regards, Tobias