Purpose With InputField you can create additional input fields. The value entered into a new input field can be used in an InputScript.
Example InputField (10,1) "Reference number" (10,20) size="10" name="Refnr"

This defines an input field with up to 10 characters. The field label is displayed at (10,1), the field itself at position (10,20). The internal field name is Refnr, i.e. in the InputScript its value is written in the symbolic form &[Refnr]

Format InputField (row1,col1) "field text" (row2,col2) size="..." name="..."
Options
-numerical Numerical input only
-upperCase Uppercase input only
-date Date input only
-noLabel Input field without label. Both (row1,col1) and "field text" are omitted in this case.
-dynamicLabel In conjunction with techName=: The specified text is replaced with the field text stored in the SAP Repository. Depending on the space that is available the short, middle or long label text is used. A valid RFC user name and password are necessary for this function (GuiXT profile).
-invisible Invisible input (password)
-required The field is displayed like a standard required (i.e. compulsory) input field. In the InputScript you can check that the user has entered a value. The checking is not done automatically.
-intensified The field value is displayed with a different colour (standard: red)
-alignRight The field value is aligned right
-leadingSpace Leading space characters are kept
-readOnly No input possibility
default= Specification of a default value
maxLength= Maximum input length. With this, a greater length than in size= can be specified; the field will then automatically become a scrollbar.
techName=

searchHelp=

Specification of a field name that refers to a field in the SAP repository, e.g.  techName="BSEG-GSBER". When the user presses F4 or clicks on the matchcode icon, GuiXT processes the standard SAP matchcode for this field. With F1 the user can display the standard field help.
Alternatively, the name of a search-help from SAP can be given directly by means of
searchHelp="...".

This function requires the installation of the ABAP program ZGUIXTF4.
-noSearchHelp

shName=

If you specify techName= for the F1 field help, but do not want to assign an F4 search help, you can use the option -noSearchHelp.

If more than one field is exported by the matchcode module, GuiXT takes the first one. You can also specify the name of the desired field  with the shName= option.

searchHelpModal= If you specify  searchHelpModal="X", the search help is displayed as a modal popup window, independent of the user's F4 settings.
shSelName1=
shSelValue1=

shSelName2=
shSelValue2=
...
...

shSelName12=
shSelValue12=

You can specify up to 12 selection criteria for the matchcode display. The names that you specify with  shName1, shName2, shName3,... must be exactly the same as in the definition of the search help (transaction SE11). The values shSelValue1shSelValue2,  shSelValue3,...  can either be constants or other entry fields  [...] . Examples:

InputField   ....    searchHelp="COCAN"    shSelName1="GJAHR"   shSelValue1="2002"

Only cost centers for the year 2002 are displayed.

InputField   ....    searchHelp="COCAN"    shSelName1="GJAHR"   shSelValue1="[Year]"

The content of the entry field  F[Year] is set as selection for the year.

InputField   ....    searchHelp="COCAN"    shSelName1="GJAHR"   shSelValue1="[varName]"

The content of variable  V[varName] is set as selection for the year.

 

shName1=
shDest1=

shName2=
shDest2=
...
...

shName12=
shDest12=

You can specify up to 12 additional fields; they are filled  when the user selects a matchcode entry. The names that you specify with  shName1, shName2, shName3,... must be exactly the same as in the definition of the search help (transaction SE11). The target fields  shDest1, shDest2, shDest3,... can either be entry fields [fieldname] or variables V[varname]. Examples:

InputField   ....    searchHelp="COCAN"    shName1="LSTAR"   shDest1=[Activity type]

When the user selects a cost center, the cost center key is put into the InputField. In addition, the activity type contained in the selected matchcode line is put into the entry field  Activity type.

InputField   ....    searchHelp="COCAN"    shName1="LSTAR"   shDest1=[Activity type]  shName2="KTEXT_KOSTL" shDest2=V[CC_text]

The variable V[CC_text] is filled with the cost center text, to be used in further processing.

 

searchHelpProcess=
You can specify an InputScript that is processed after the user has selected a value in the search help display.

Some typical applications:

  • Display a text in addition to  the selected value
    Specify 
    searchHelpProcess="return.txt", where the InputScript return.txt consists of the statement "Return" only.   This forces the screen to be displayed again, and the variables set by the matchcode (like  V[CC_text] in the section above) are shown to the user.
  • Display further data that depends on the selected value
    The specified InputScript reads additional data (e.g. with a Call statement) and then uses "Return" to display the screen again. The newly read data can be displayed in the GuiXT script.
Programmed matchcode help You can also program a special matchcode function in ABAP and assign it to the InputField. Notation:
 
searchHelp="exit.progname.formname"
Here progname is the ABAP program name and formname is the subroutine name  The form routine has a standardized interface (see below). It returns the selected value. The special options shSelName1=, shSelValue1=, ..., shName1=, shDest1= can be handled as well.

Example 1

InputField (18,1) "Bk" (18,20) name="buk" size="4" searchHelp="exit.zguixtmc1.mcbuk"

ABAP program:

Program ZGUIXTMC1.

* Value table
data: begin of t1 occurs 100,
  bukrs like t001-bukrs,
  butxt like t001-butxt,
  land1 like t001-land1,
  ort01 like t001-ort01,
end of t1.

* Returned value
data: begin of r1 occurs 1.
  include structure DDSHRETVAL.
data: end of r1.

Form mcbuk
   tables
       sel    "table with
 shSelName1=, shSelvalue1=,
       dest   "table with
 shName1=, shdest1
     using invalue
       changing selvalue.

* Select data
  Select bukrs butxt land1 ort01 from t001
  into corresponding fields of table t1.

* SAP standard function to display table as matchcode selection
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
  EXPORTING
    RETFIELD = 'BUKRS'
    WINDOW_TITLE = 'Please select a company code'
    VALUE_ORG = 'S'
  TABLES
    VALUE_TAB = T1
    RETURN_TAB = R1
  EXCEPTIONS
    OTHERS = 1.

* Return selected value
if sy-subrc = 0.
  selvalue = r1-fieldval.
endif.

endform.

Example 2: Local file name

InputField (6,1) "Filename" (6,20) name="filename" size="50" searchHelp="exit.zguixtmc1.mcfile"

ABAP-Program:

Program ZGUIXTMC1.

Data: tmp_filename(80).

Form mcfile
  tables
    sel "table with shSelName1=, shSelvalue1=,
    dest "table with shName1=, shdest1
  using invalue
  changing selvalue.

Call Function 'WS_FILENAME_GET'
  Exporting
    DEF_FILENAME = invalue
    DEF_PATH = 'C:\GuiXT'
    MASK = ',*.*,*.*.'
    MODE = 'O'
    TITLE = 'Please select a file '
  Importing
    FILENAME = TMP_FILENAME
  Exceptions
    others = 1.


* Return selected value
If sy-subrc = 0.
  selvalue = tmp_filename.
Endif.

Endform.

 

Tips
& Tricks
  • You can also specify a quickinfo for the new field, observing the SAP standard convention for a text with a quickinfo. Example:

"@0L\QPlease use the external document number as reference number@Reference number"

  • The InputAssistant displays the history for your new input fields as well
  • The technical field name required for the matchcode functionality can be found in standard SAP help F1, "Technical information".
  • The following special search help modules can also be specified in searchHelp="...":
    • ... searchhelp="GuiXT.ORGEH"  Hierarchical view of organization
    • ... searchHelp="GuiXT.ZTERM"  Payment terms
    • ... searchHelp="GuiXT.ZTERM.D"  Payment terms, debitors only
    • ... searchHelp="GuiXT.ZTERM.K"  Payment terms, creditors only
    • ... searchHelp="GuiXT.DATE"  Calendar
    • ... searchHelp="GuiXT.TIME"  Time
Components GuiXT + InputAssistant