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