URL Access to Smart Forms Objects

Use

Smart Forms uses the services of the Internet Communication Framework (ICF) when creating a Web form. You can use such a service to access Smart Forms objects - for example, Smart Styles, graphics, and texts - even independently of a complete Web form. To reference an object, simply use a URL. In this way, you can include a CSS style for a Smart Style or logos on your own Web pages, for example.

Integration

When you access a Smart Forms object using a URL, Smart Forms performs the following steps:

  1. The object is read from the SAP system.
  2. Smart Forms converts the object into a target format for display in the Web. Depending on the object, there may be more than one target format.
  3. The converted target format is written in a cache in the SAP system. When accessed again (even by another user), the object does not need to be read and converted.
  4. The object is usually transferred for display in a Web browser.

Features

To access objects, use a URL consisting of the address of your SAP Web Application Server (abbreviated to <WAS>), an appropriate directory path, and the object name. The target format is contained in the object name as a suffix.

http://<WAS>/sap/bc/smart_forms/<object type>/<object name>.<format suffix>

You can also append the BSP runtime to the URL parameters. In the case of text modules, you can use the parameter sap-language to control the language in which the text module is to be read from the SAP system. The parameter expects the language as a ISO language identifier (see also: System-Specific URL Parameters).

To access a text module with the name myMod, in language German, and in HTML format, you can use the following link:

http://<WAS>/sap/bc/smart_forms/sftext/myMod.htm?sap-language=de

The prefix "http://<WAS>/sap/bc/smartforms" is not included in the following overview because it is the same in each case:

URL Access to Smart Forms Objects

Object

Output format

URL structure (without prefix, see above)

Name space (with XML format)

Form description

XML

/sfform/<form name>.xml

urn:sap-com:SmartForms:2000:internal-structure

Smart Style

CSS

/sfstyle/<name of Smart Style>.css

BDS graphic

BMP

/gr/graphics/bmap/<type>/<name of graphic>.bmp

<type> can be either

  • BMON for black/white graphics, or
  • BCOL for color graphics

Text module

HTML

/sftext/<name of text module>.htm

Text module

XML

/sftext/<name of text module>.xml

urn:sap-com:SmartForms:2000:xsf

SAPscript text

HTML

/stdtext/<text object>/<text ID>/<language>/<text name>.htm

SAPscript text

XML

/stdtext/<text object>/<text ID>/<language>/<text name>.xml

urn:sap-com:SmartForms:2000:xsf

Example

You want to use the same fonts that you use on a form (when printing or using a Web form) on a different BSP page. Let us assume that your Smart Style has the name mystyle. You can download the relevant CSS style using the following URL:

http://<address of SAP Web AS>/sap/bc/smart_forms/sfstyle/mystyle.css

A paragraph format AS from the Smart Style could appear as follows in CSS style:

.MYSTYLE DIV#AS.par {
font-family :     "Courier New" ;
font-size :       12pt ;
font-weight :     bold ;
line-height :     1em ;
text-decoration : underline ;
text-align :      left ;
}

If you now want to include the generated CSS in an HTML page, simply link to this style sheet in the header and use the tag <div> with the relevant attributes to access the formats:

In this example, the CSS style is used for the layout of a BSP page. Therefore, the prefix http://<WAS> is missing.

<html>
<head>
<link rel="STYLESHEET"
      href="./sap/bc/smart_forms/sfstyle/mystyle.css" />

</head>
<body>
  <div "MYSTYLE">
  <div "par" ID="AS">

Your formatted text:

  </div>
  </div>

</body>

HTML