Referencing R/3 Screen Fields 

The main task of HTMLBusiness is to tell the Internet Transaction Server (ITS) how to transfer data between R/3 screens and the HTML templates.

At runtime, there are two types of R/3 field known to the ITS:

Only screen fields are visible to the ITS. Fields known to the module pool but not present in a screen are not visible.

These are fields transferred by the ABAP program using the ITS macros FIELD_SET or FIELD_TRANSPORT.

Referencing Fields

Field replacement is the simplest form of HTMLBusiness statement. With the exception of reserved keywords, every HTML Business expression is treated as the name of an R/3 field.

To display R/3 screen field data in your HTML page, simply enclose the R/3 field name in <server>...</server> tags or back quotes.

There is normally a 1:1 relationship between screen fields and HTML fields. This applies both when reading from and writing to the screen. Large text areas are an exception to this rule.

You can also use field contents in simple expressions.

Field Identifier Syntax

The following table shows the syntax for referencing R/3 screen fields in HTMLBusiness. The attributes provide additional information about the field.

Name

Syntax

Field

{ ^ } identifier [ [ expression ] ] [. attribute ]

Attribute

label |

visSize |

maxSize |

dim |

disabled |

name |

value

 

In HTMLBusiness, field identifiers should conform to the same conventions as in other programming languages such as C or JavaScript.

The conventions are summarized in the following table:

Field Identifier Component

Possible Characters

Values

First character

A letter

a…z, A…Z

An underscore

_

A tilde

~

Subequent characters

Letters

a…z, A…Z

An underscore

_

A tilde

~

A digit

0…9

A hyphen

-

 

The following are valid field identifiers:

nCustomers
_foo_bar
~frame
date1
ordered_items
vbcom-kunde

In the following cases, you must enclose the entire field identifier in single quotation marks:

'*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:

`vbcom - kunde`

Limiting the Number of Characters Transferred

You can limit the number of characters per field that are transferred from the HTML page to the screen. To do this, enter a colon after the field name and then specify the number of characters desired. 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.