
Example: Specific Form Elements in HTML Templates (SAP Design)
To execute the output of error messages, you call the JavaScript function SAPBodyOnload() in the body tag:
<body onload="SAPBodyOnload()">
After the two statements necessary for the definition of the form:
<form id="myForm" name="myForm" action="`wgateURL()`" method="post">
`include(~service="sr_library", ~theme="99", ~language="", ~name="ISR_Template_Library_Plain_Html.html")`
there is the part of the HTML template that is specific to the scenario.
You can use the following functions to define the form elements for the request.
The functions are defined in the sr_library Internet Service.

To study the functions, load the form elements in the SAP@Web-Studio, or display the SR_LIBRARY internet service in the Web Application Builder. You find the functions using the syntax check.
For more information, see the SAP Library under Basis ®
SAP Internet Applications ®
SAP@Web Studio or Basis ®
BC-ABAP Workbench ®
Integration of Internet Services ®
Web Application Builder.
Form Elements
getLabel(name)
getSize(name, maxwidth)
getName(name, index)
Disabled(name)
Readonly(name)
Selected(name, value)
<option value="red" `Selected("COLOR","red")` > you like the red color?
<option value="green" `Selected("COLOR","green")`> or the green color?
<option value="blue" `Selected("COLOR","blue")`> or the blue color?
</select>
SetOptions(name, options, labels)
COLOR_Option[2] = "green";
COLOR_Option[3] = "blue";
COLOR_Label[1] = "you like the red color?";
COLOR_Label[2] = "or the green color?";
COLOR_Label[3] = "or the blue color?";`
<select id="COLOR" name="COLOR" size="1" `disabled("COLOR")`>
`SetOptions("COLOR","COLOR_OPTION","COLOR_LABEL")`
</select>
Result:
If you chose the "or the green color?" entry, the value "green" is assigned to the characteristic "COLOR". If you call up the sent form in display mode, the "or the green color?" entry is displayed automatically.
Checked(name, index, value)
<input name="COLOR" value="green" type="radio" `checked("COLOR",1,"green")` `disabled("COLOR")`>or the green color?<br>
<input name="COLOR" value="blue" type="radio" `checked("COLOR",1,"blue")` `disabled("COLOR")`>or the blue color?<br>
Result:
If you chose the "or the green color?" entry, the value "green" is assigned to the characteristic "COLOR". If you call up the sent form in display mode, the "or the green color?" entry is selected automatically.
CheckboxProlog(name, index)
<input name="COLOR[1]" value="red" type="checkbox" `Checked("COLOR",1,"red")` `disabled("COLOR")`>you like the red color? <br>
`CheckboxProlog("COLOR[2]")`
<input name="COLOR[2]" value="green" type="checkbox" `Checked("COLOR",2,"green")` `disabled("COLOR")`>and the green color? <br>
`CheckboxProlog("COLOR[3]")`
<input name="COLOR[3]" value="blue" type="checkbox" `Checked("COLOR",3,"blue")` `disabled("COLOR")`>and the blue color? <br>
getTextAreaName(name, width)

Normally you use both ISR_NEW_TEXT, for the entry of new comments, and ISR_TEXT, for the display of existing comments (see examples 1 + 2 below). The comments are logged chronologically in the long text for the message.
Example 1: Output field for ISR long text
`if ( ISR_MODE != "CREATE" );`
<textarea wrap="physical" rows="5" cols="75" name="`GetTextAreaName("ISR_TEXT",75)`" `readonly("ISR_TEXT")`>
`GetTextAreaContent("ISR_TEXT")`
</textarea>
`end`
Example 2: Input field for ISR long text
`if ( ISR_MODE != "DISPLAY" );`
<textarea wrap="physical" rows="5" cols="75" name="`GetTextAreaName("ISR_NEW_TEXT",75)`" `readonly("ISR_NEW_TEXT")`>
`GetTextAreaContent("ISR_NEW_TEXT")`
</textarea>
`end`