Purpose
Adding your own input data checks in a generated single screen transaction

Solution

  • Create your own "include" script, e.g. "m_va02_check_input.txt".

    With a prefix that is alphabetically placed before the prefix specified in the UI Log project, your own scripts are displayed first in WIndows explorer
  • Include the desired checks in your script. If an error is detected, leave the script with
      Return "E: ...my message text... " -statusline "
  • Put the cursor to the erroneous InputField with
      SetCursor V[....]
    where V[...] is variable assigned to the InputField

    For DropDownLists GuiXT currently does not offer a possibility of putting the focus on the dropdown element
     
  • Add your script to the generated "save.txt" input script with an "include" statement, preferably immediately after the already generated checks

Example
In the generated VA01 transaction (previous example), we check whether a suitable reason is specified in the case of a material return.

Our include script "m_va02_check_input.txt":

// for order type RE= Return, check order reason = 101, 102 or 103
if
V[ui_va01.auart=RE] _
  and not ( V[ui_va01.augru=101] or V[ui_va01.augru=102] or V[ui_va01.augru=103] )

    Return "E: Please specify a suitable reason for the return (codes 101-103)" _
       
-statusline
end
if

In the generated script "ui_va01_save.txt", search the end of the generated checks, e.g for required field input, and add your own checks with "include":

  ...
 
// PO number
 if not V[ui_va01.bstkd]
   SetCursor V[ui_va01.bstkd]
   Message id="00" number="055" type="E" -statusline
   return
 endif

  // additional own input checks
  include "m_va01_check_input.txt"

endif

// ignore all info popups
ProcessingOption ignoreInfoPopup="On"
....

 

Components
InputAssistant