The main task of HTMLBusiness is to tell the Internet Transaction Server (ITS) how to transfer data between SAP system screens and the HTML templates.
At runtime, there are two types of SAP system field known to the ITS:
Fields passed from an SAP system screen
Only screen fields are visible to the ITS. Fields known only to the module pool are not visible.
Fields passed via the RFC channel
These are fields transferred by the ABAP program using the ITS macros FIELD_SET or FIELD_TRANSPORT.
Referencing Screen Fields
Field replacement is the simplest form of HTMLBusiness statement. This controls how screen values are copied to the HTML page and how values from the Web browser are integrated into entry fields on the SAP system screen.
There is normally a 1:1 relationship between screen fields and HTML fields, whether you are reading from or writing to the screen. However, large text areas are an exception to this rule.
With the exception of reserved keywords, every HTMLBusiness expression is treated as a screen field name:
If the ITS finds a match for a field name, it copies the SAP system field contents to the HTML page
If the ITS finds no match for a field name, it replaces the variable with an empty string
To display SAP system screen field data in your HTML page, you simply enclose the SAP system field name in <server>...</server> tags or back quotes.
Field Identifier Syntax
The following table shows the syntax for referencing SAP system screen fields in HTMLBusiness. The attributes provide additional information about the field.
Name |
Syntax |
Field |
{ ^ } identifier [ [ expression ] ] [. attribute ] |
Attribute |
dim | |
disabled | |
|
exists | |
|
label | |
|
maxSize | |
|
name | |
|
type | |
|
value | |
|
visSize |
In HTMLBusiness, field identifiers should conform to the same conventions as in other programming languages such as C or JavaScript.
These conventions are summarized in the following table:
Field Identifier Component |
Possible Characters |
Values |
First character |
Letters |
A ...z, A...Z |
Underscore |
_ |
|
Tilde |
~ |
|
Subequent characters |
Letters |
A ...z, A...Z |
Underscore |
_ |
|
Tilde |
~ |
|
Digits |
0...9 |
|
Hyphen |
- |
The following are valid field identifiers:
nCustomers
_foo_bar
~frame
date1
ordered_items
vbcom-kunde
You must enclose the entire field identifier in single quotation marks:
If you use other characters.
If you use the same name as a keyword.
'*vbcom-kunde'
'$@#identifier()***'
'from'
Identifiers such as vbcom-kunde do not need single quotes, because the hyphen is legal. Simply write `vbcom-kunde` instead of `'vbcom-kunde'`.
However, if you want to use arithmetic expressions that contain minus signs, there must be at least one space before and after the minus sign:
Limiting the Number of Characters
You can limit the number of characters per field that are transferred from the HTML page to the screen by entering a colon after the field name and then specifying the number of characters. You must specify the length between the field name and the index.
If you limit the number of characters in this way, extra characters are lost. This does not apply when the field is an array and you have not specified an explicit index with []. In this case, characters beyond your specified limit are included in a new line of the step loop. This is necessary when processing large text areas.
Field Attributes
There are several attributes you can use to find out properties of SAP system fields. For further information, see Getting SAP System Field Attributes.