Liquid UI - WS Reference Library

inputfield()


Purpose

With inputfield(), you can create and modify inputfields (also called editfields) in SAP.

The inputfield() command is one of the most useful commands in Liquid UI and is used on most screens. Editable fields on SAP screens are created and modified using the inputfield() command.


Syntax

inputfield([startrow,startcol],"Label name",[endrow,endcol],{"name":"value","size":value,"option":value…});


Properties

  • startrow, startcol, endrow, endcol - row and column coordinates
  • Label name - name of the field without icon
  • @0Y@Label name - name of the field with icon
  • @4V\\Qlabel Tip@Label name - name of the field with tool tip and icon


Available Options

You can use the following options with the inputfield:

"alignright":".."

"alignright":true - Aligns value to the right hand edge of the inputfield.

"date":".."

"date":true - Displays calendar for an inputfield.

"default":".."

"default":"string" or "default":value - Enables user to add default text to the inputfield.

"invisible":".."

"invisible":true - Hides the inputfield value with asterisks.

"maxlength":".."

"maxlength":value - Defines the maximum input length for an inputfield.

"name":".."

"name":"field_variable_name" - Defines the variable name by which the field can be referenced.

"nolabel":".."

"nolabel":true - Removes the field's onscreen label.

"numerical":".."

"numerical":true - Restricts input type to numbers.

"readonly":".."

"readonly":true - Disables data entry into the inputfield.

"required":".."

"required":true - Makes the field entry mandatory.

"searchhelp":".."

"searchhelp":"value" - Provides list of available entries for an inputfield.

"techname":".."

"techname":"value" - Replicates searchhelp functionality.

"uppercase":".."

"uppercase":true - Enables any input in an inputfield to be appear in uppercase.

"rf_autotab":".."

"rf_autotab":value - Value specifies delay time in seconds depending on value.

"rf_barcode":".."

"rf_barcode":true - Supports barcode scan reading for an inputfield.

"rf_pattern":".."

"rf_pattern":"string" - Validates the pattern with the specified string.

"rf_validate":".."

"rf_validate":"string" - Validates the string together with the pattern matching.

"rf_page_autosend":".."

"rf_page_autosend":"tcode" - Auto submits the transaction code after the time limit you set in the script.

"Tool tips and icons":".."

Adds tips and icons to an inputfield

"variables":".."

Global variables and screen variables can be used with inputfields.


Options Detail

alignright

  1. The alignright option for inputfields is used to align the value entered in a field to the right-hand edge of that field.

  2. inputfield([1,0],"Quantity",[1,10]{"name":"z_mb1b_qty","size":5,"alignright":true});
  3. The cursor in the inputfield is right aligned.

date

  1. This option is used to call a calendar with the F4 key instead of searchhelp.

  2. inputfield({'field':'G[Processing]','offset':[1,1]},"Date paperwork rec'd",{'field':'G[Processing]','offset':[1,22]},{"name":"z_strdt","SIZE":10,"date":true});
    
  3. The date option enables the calendar when you click search option on the inputfield.
    Note: The offset parameter is used for relative positioning.

default

  1. The default option for inputfields adds user-specified default text.

  2. inputfield([1,0],"Quantity",[1,10],{"name":"z_mb1b_qty","size":6,"default":1});
    
  3. As per the code, the inputfield quantity is set to 1 by default. The user can edit the field as per their requirement.

invisible

  1. The invisible option for inputfields hides the field's output.

  2. inputfield( [1,0],"CVV",[1,15],{"name":"CVV","size":3,"invisible":true});
    
  3. The data you entered in the inputfield will be hidden, as we have set invisible to true for Material Desc in the code.

maxlength

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

  2. inputfield([1,0],"Material Desc.",[1,15],{"name":"Z_ZMBE_MATDESC","size":32,"maxlength":"40"});
    
  3. The Material Desc field would allow up to 40 characters long as per the code.

name

  1. The name option for inputfields defines the variable name for the inputfield.

  2. inputfield([1,0],"Serial #",[1,10],{"name":"z_serial","size":30});
    inputfield([2,0],"Phone #",[2,10],{"name":"z_phone","size":12});
    
  3. Name option for inputfield assigns a name to the variable. The data read in the inputfield is stored in that particular variable name.

nolabel

  1. The nolabel option for inputfields deletes the onscreen label.

  2. inputfield([1,0],{"name":"z_row_idx","size":2,"nolabel":true});
    inputfield([1,4],{"name":"z_ib03_itemcat","size":12,"nolabel":true});
    
  3. In the above code there are 2 inputfields without any label and have set in readonly mode. The user can select this option when they want to place an additional inputfield beside one another or when they don't require a label name on the screen.

numerical

  1. The numerical option for inputfields restricts input to numbers.

  2. inputfield([1,0],"Breakdown dur.",[1,15],{"size":10,"name":"z_iw42_breakdowndur","numerical":true});
  3. The numerical option will allow inputfield with numerical data and symbols which doesn't require SHIFT button to enter on the keyboard. It disables the entry of alphabetical characters.

readonly

  1. The invisible option for inputfields disables data entry.

  2. inputfield([1,0],"Material",[1,14],{"name":"g_serviceMaterial","size":25,"readonly":true});
    inputfield([2,0],"Serial Number",[2,14],{"name":"g_serialnumber","size":25,"readonly":true});
    
  3. In the above code we have set inputfield as "readonly: true", which means that inputfield will not take any values whenever the user attempts to enter the data.

required

  1. The required option for inputfields makes entry non-optional.

  2. inputfield([1,0],"Plant",[1,20],{"name":"z_mm01_plant","size":4,"required":true});
    inputfield([2,0],"Stor.Location",[2,20],{"name":"z_mm01_storloc","size":4,"required":true});
    
  3. Required option makes the inputfield as mandatory field to enter the data.

searchhelp

  1. The searchhelp option for inputfields provides a list of available entry values for a given inputfield.

  2. inputfield([0,5],"Sales Order",[0,20],{"name":"g_sls_ord_assign","size":10,"searchhelp":"VMVAA"});
    
  3. Now when you click on searchhelp, a list would pop-up with all the available entries for the inputfield.

techname

  1. The techname option for inputfields replicates searchhelp functionality and is used when searchhelp is not available.

  2. inputfield([1,49],"Work Completed date",[1,77],{"name":"z_comp_dt","size":10,"techname":"QMEL-QMDAB"});
    
  3. The techname option in the above code acts as a searchhelp.

uppercase

  1. The uppercase option for inputfields makes the values appear in upper case.

  2. inputfield([1,1],"Full Name",[1,15],{"name":"gx_name","size":40,"required":true,"uppercase":true});
    inputfield([2,1],"Street",[2,15],{"name":"gx_street","size":40,"required":true,"uppercase":true});
    
  3. The uppercase option will convert inputfield entries from lowercase to uppercase.

In addition to the above options, there is also other functionality that can be associated with inputfields using GuiXT WS. The capabilities are:

Note: Smart attributes works only on mobile devices.

Smart Attributes

The smart attributes option for inputfields adds functionality to the inputfield.

rf_autotab

  1. The auto-tab specifies a given number of second before the process will proceed to the next field.

  2. inputfield([1,0],"Default Plant:",[1,15],{"name":"g_default_plant","size":4,"rf_autotab":2});
  3. As per the code, the text inputfield is defined with autotab functionality, where the field would automatically switches to next tab after 2 seconds.

rf_barcode

  1. The rf_barcode option is used on any inputfield to have the choice of using a barcode scan instead of typing in a value.

  2. inputfield([1,0],"Notification",[1,25],{"size":12,"rf_barcode":true});
    
  3. As per the code, the text inputfield is defined with barcode functionality, where the inputfield would have scanner button to scan the barcode.

rf_pattern

The rf_pattern option is used for pattern matching specifies that the values entered in the field must match a pre-defined pattern.

rf_validate

  1. The rf_validate purpose is for validation and is used together with pattern matching. If validation is used then the value entered into the field must match the pattern in order for the validation to succeed and for the process to continue.

  2. inputfield([1,0],"Material",[1,10],{"name":"z_mb1b_material","size":18,"rf_validate":"/16","rf_autotab":4});
    

rf_page_autosend

The rf_page_autosend is specially used for autosubmit. This smart attribute contains a SAP transaction code to execute.

Additional Methods

Tool tips and icons

  1. Adds tool tips and icons to an inputfield.

  2. inputfield([1,0],"@4V\\QEnter Service Material@:Material",[1,14],{"name":"g_serviceMaterial","size":25});
  3. As per the code, the material field is displayed with an icon and when a user places the cursor on icon or material, it suggests a tip as "Enter Service Material" into the corresponding field.

Variables

There are two types of variables that can be used with inputfields - global variables and screen variables. As their names imply, screen variables are specific only to a single screen, while global variables can be used throughout a SAP script.


Example

The following inputfield() example demonstrates create material with a price constraint for a given period of time.


Script

inputfield([19,28],"Condition Type",[19,43],{"name":"z_vk11_conditiontype","size":20});
inputfield([22,29],"Valid to",[22,43],{"name":"z_vk11_validto","size":20});
inputfield([21,29],"Valid from",[21,43],{"name":"z_vk11_validfm","size":20});
inputfield([20,29],"Rate",[20,43],{"name":"z_vk11_rate","size":20}); 

Script Details


Tips and Tricks

  • rf_barcode

    rf_barcode option is used on any inputfield to have the choice of using a barcode scan instead of typing in a value.

    Learn more about rf_barcode option and how the barcode scan works on SAP GUI.

  • F4 searchhelp on Liquid UI fields

    On a Liquid UI inputfield we can use the standard SAP F4 searchhelp display using the options of 'searchhelp' or 'techname'.

    Learn more about F4 searchhelp on Liquid UI fields using inputfield.

  • Numerical and Date Options

    The "numerical" option restricts the user from entering any letters into the field. The "date" option makes the F4 key bring up a calendar for the search help.

    Learn about the two very useful options of inputfield: Numerical and Date options.

  • SearchHelp

    Below example explains about how to display search help for liquid UI field and additional search help options.

    Learn more about Searchhelp with inputfield.