InputField

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
-noLabel Input field without label. Both (row1,col1) and “field text” are omitted in this case.
-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=

shname=

Specification of a field name that refers to a field in the R/3 repository, e.g.  TechName=“BSEG-GSBER”. When the user presses F4 or clicks on the matchcode icon, GuiXT processes the standard R/3 matchcode for this field.
Alternatively, the name of a search-help from R/3 can be given directly by means of
SearchHelp=“…”.

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

This function requires the installation of the ABAP program ZGUIXTF4
(available on the download page).

shselname1=
shselvalue1=

shselname2=
shselvalue2=

shselname3=
shselvalue3=

You can specify up to 9 selection criteria for the matchcode display. The names that you specify with  shname, shname2, shname3,… must be exactly the same as in the definition of the search help (transaction SE11). The values shselvalue1 shselvalue2shselvalue3,…  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  [Year] is set as selection for the year.

InputField   ….    searchhelp=“COCAN”    shselname1=“GJAHR”   shselvalue1=“[varname]“

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

Please note: For this function you need the ABAP program ZGUIXTF4 in version 2002 Q3 8 or upwards.

R/3 Rel. 4.0 only Please note: For R/3 Rel. 4.0 a special handling is needed, since the SAP matchcode function did not yet support the parameterization that GuiXT uses here.
  • In the data dictionary SE11, copy the search help where you need additional value selection, using your own name. For example, copy “BETRA” into “ZZBETRA”.
  • If you need constant values as additional selection, enter them as default value, e.g. ’0001′ (including the ‘   ‘)
  • If you need variable values, use a parameter id, e.g. enter BUK. Use a valid parameter id according to table TPARA.
  • Do not forget to activate the search help before testing
  • In the script, use the notation shselname1=“$xxx”   shselvalue1=“…”  where xxx is the parameter id. For example: shselname1=“$BUK”

You need ZGUIXTF4 version 2003 Q4 1 and upwards. 

shname1=
shdest1=

shname2=
shdest2=

shname2=
shdest2=

You can specify up to 9 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.

Please note: For this function you need the ABAP program ZGUIXTF4 in version 2002 Q3 6 or upwards.

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 (see “Special Topics” for details).

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 R/3 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

InputField