BSP Tips and Tricks


How to use form fields in the event handler


How to use form fields in the event handler

This examples shows how to read the value of a form field, and use it in an event handler.

The user keys in the field zzkunnavn in the form nand presses then Save button.


<%@page language="abap"%>
<%@extension name="htmlb" prefix="htmlb"%>


<title>Use form field</title>

<h1>Use form field</h1>

  <form method = "post" name="x">
    <input type="text" size="50"  maxlength="50" name="zzkunnavn">

    <input type=submit name="onInputProcessing(save)" value="Save">

Page attributes
The field zzkunnavn must be defined in the Page attributes of the screen
Event handler OnInputProcessing
CASE event_id.
  data: l_kunnavn type string.
  WHEN 'save'.

*   Sets value of parameters, i.e. gets value from screen    
    navigation->set_parameter( name = 'zzkunnavn').
*   Gets value of parameter, so can be moved into abap field
*   Note: zzkunnavn declared in page attributes 
    l_kunnavn = navigation->get_parameter( name = 'zzkunnavn').






Converted from CHM to HTML with chm2web Standard 2.7 (unicode)