Value help and matchcode for your own input fields

For new input fields, standard R/3 value help (F4) is not automatically available. 

There are 3 ways to overcome this hurdle:

 

Using radiobuttons instead of an input field 

This makes sense if there is a fairly small fixed set of possible input values. 

Implementation: Instead of your input field definition…

InputField (10,1) “Currency” (10,12) Size=“3″ Name=“MyCurrency” 


 Sap Guixt matchcode1 Value help and matchcode for your own input fields

… you use a set of radiobuttons for the same variable:

Offset (10,1)
Box (0,0) (5,40) “Currency”
Radiobutton (1,1) “USD American Dollar”    Name=“MyCurrency” Value=“USD”
Radiobutton (2,1) “EUR European currency”  Name=“MyCurrency” Value=“EUR”
Radiobutton (3,1) “GBP British Pound”      Name=“MyCurrency” Value=“GBP”
Radiobutton (4,1) “MXN Mexican Peso”       Name=“MyCurrency” Value=“MXN”

 
 Sap Guixt matchcode2 Value help and matchcode for your own input fields

You can also set a default value by assigning a value to the variable V[MyCurrency]:

Offset (10,1)
Box (0,0) (5,40) “Currency”

// Set default “USD” if V[MyCurrrency] is still empty
if not V[MyCurrency]
  Set V[MyCurrency] “USD”
endif

Radiobutton (1,1) “USD American Dollar”    Name=“MyCurrency” Value=“USD”
Radiobutton (2,1) “EUR European currency”  Name=“MyCurrency” Value=“EUR”
Radiobutton (3,1) “GBP British Pound”      Name=“MyCurrency” Value=“GBP”
Radiobutton (4,1) “MXN Mexican Peso”       Name=“MyCurrency” Value=“MXN”

Or you can combine the radiobuttons with an input field:

Offset (10,1)
Box (0,0) (6,40) “Currency”

// Set default “USD” if V[MyCurrrency] is still empty
if not V[MyCurrency]
  Set V[MyCurrency] “USD”
endif

Radiobutton (1,1) “USD American Dollar”    Name=“MyCurrency” Value=“USD”
Radiobutton (2,1) “EUR European currency”  Name=“MyCurrency” Value=“EUR”
Radiobutton (3,1) “GBP British Pound”      Name=“MyCurrency” Value=“GBP”
Radiobutton (4,1) “MXN Mexican Peso”       Name=“MyCurrency” Value=“MXN”
Radiobutton (5,1) “other currency:”        Name=“MyCurrency” Value=“XXX”

Inputfield (5,20) Size=“3″ “-NoLabel Name=“OtherCurrency”  

Sap Guixt matchcode3 Value help and matchcode for your own input fields

In the corresponding InputScript you then need an if-statement for  the “other currency”  case:

// “Other currency” specified?
if V[MyCurrency=XXX]
  Set V[ThisCurrency] “&V[OtherCurrency]“
else
  Set V[ThisCurrency] “&V[MyCurrency]“
endif

 

 

Defining local value help for a new input field

In this case you work with the normal InputField statement:

InputField (10,1) “Currency” (10,12) Size=“3″ Name=“MyCurrency” 

In addition, you assign a domain name to your field in the file  domText.E.txt: 

Currency: WAERS

Or, if you don’t want to work with a standard domain name, use domTextScreen.E.txt:

SAPMC29C.0584.Currency: MYCURR

Here SAPMC29C is the program name, 0584 the screen number, Currency the label of your input field, and MYCURR a domain name that you have invented for your field.

You then create  the local value help file

dom.E.WAERS.txt

or

dom.E.MYCURR.txt

which could look something like the following example:

Clicking on the right mouse button the user then gets the currencies entered in the past, together with texts,  and followed by a list of all possible currencies. 

Sap Guixt matchcode4 Value help and matchcode for your own input fields

The local value help is fast, it displays the  history together with texts, and it shows the full list of possible values. 

For details (e.g. generating the local help files from R/3) please see the documentation of InputAssistant.

 

Defining a link to standard R/3 matchcode

In the case of customers, orders, materials,… neither the radiobuttons nor the local value help can be used, since the input field refers to a relatively large and dynamic set of values. 

If you  link your field to the R/3 repository by specifying the technical name of a suitable R/3 data dictionary field, then GuiXT processes the corresponding matchcode automatically:  

InputField (10,1) “Currency” (10,12) Size=“3″ Name=“MyCurrency” Techname=“BKPF-WAERS”


 Sap Guixt matchcode5 Value help and matchcode for your own input fields

Sap Guixt matchcode6 Value help and matchcode for your own input fields

This works only if you have installed the following R/3 objects in your system:

  • ABAP program ZGUIXTF4  (copied in the installation directory when installing GuiXT)
  • Transaction code ZXF4

To create transaction code ZXF4, proceed as follows:

Start transaction SE93, enter the new transaction name ZXF4 and press the Create button:

Sap Guixt matchcode7 Value help and matchcode for your own input fields

 

Define it as parameter transaction:

Sap Guixt matchcode8 Value help and matchcode for your own input fields

 

The new transaction is a parameter transaction that invokes  ZGUIXTF4. You have to fill in the transaction code SA39 (internal transaction), mark the “Skip initial screen” checkbox, and enter the screen field name RS38M-PROGRAMM with value ZGUIXTF4:

Sap Guixt matchcode9 Value help and matchcode for your own input fields

 

Finally, press the SAVE button and assign a suitable development class, or, if no transport to other R/3 systems is planned, declare it as a local object.

 

Value help and matchcode for your own input fields