maxlength

The maxlength option for inputfields defines the maximum input for an inputfield.

The maxlength option defines how many characters can be entered in an inputfield. The command is also useful when you want to make an inputfield scrollable. The syntax is as follows:

{"maxlength":value}

You can enter as many characters as are defined in the mazxlength option.

Note: The size option will over-ride maxlength if both are used together.

Examples

To demonstrate the maxlength option, please do the following:

  1. Open the Easy Access script file (SAPLSMTR_NAVIGATION.E0100.sjs) and enter the following code. Create the script file if it does not already exist.

    inputfield([4,5], "Inputfield Test", [4,20], {"name":"inpfld_1", "size":26});
  2. Save the changes and refresh the SAP screen.

  3. Enter the text abcdefghijklmnopqrstuvwxyz into the new inputfield.
  4. The screen now appears as follows:



  5. To demonstrate the maxlength option, re-open the script file and define the maxlength as 20 by changing the code as follows:

    inputfield([4,5], "Inputfield Test", [4,20], {"name":"inpfld_1", "maxlength":20});
  6. The screen now appears as in the below example:



  7. You can view all the characters by scrolling from one end of the field to the other although not all characters will be visible simultaneously.