Copyright 2020 - BV TallVision IT

The field statement is a flow-logic statement which controls what happens with a field. Here's the overall suite of options....

Additions to the FIELD statement

A field check can be done in several ways. Not necessarily by using modules with routines. An overview:


  1. FIELD fieldname SELECT * FROM tabelname WHERE tablekeyfield = inputfield AND ..., to automatically check the fieldvalue with the contents of a check table. Also: ... INTO fieldname. And: WHENEVER FOUND / NOT FOUND SEND ERRORMESSAGE / WARNING WITH fieldname ....
  2. FIELD VALUES ('value1', 'value2', NOT 'value3', BETWEEN 'value4' AND 'value5'). to check a field value with a number of fixed values (only for screentypes CHAR or NUMC).
  3. Combining the above: FIELD : VALUES ..., SELECT ..., MODULE ...

F1: Handling a user request for help

Via the process logic command PROCESS ON HELP-REQUEST can be indicated, up to field level, which ABAP module has to be executed for the user's HELP-REQUEST. The following function building block can be used for this: HELP_DOCU_SHOW_FOR_FIELD, with amongst others name of the data dictionary field and table where to find the help information, as parameters.

Overview of additional FIELD options

  1. ... ON INPUT. Called whenever the field value differs from the initial value.
  2. ... ON CHAIN-INPUT. Called whenever the field values in the chain differ from the initial value
  3. ... ON REQUEST. Called whenever the field value was changed.
  4. ... ON CHAIN-REQUEST. Called whenever one of the field values in the chain was changed
  5. ... ON *-INPUT. Called when end user enters a "*" andthe screen attribute for *-entry was set (for the field)
  6. ... AT EXIT-COMMAND. Processing user input when a command (or menu option) with function type "E" (in the menu painter) is initiated. Can also be done without FIELD: MODULE
  7. ... AT CURSOR-SELECTION. Processing is only possible when the user positions on the field and presses F2 or gives a double clicks. The function key F2 has to be activated in the menu painter.
  8. ... WITH 'xxxxx'. Only valid with PROCESS BEFORE OUTPUT. The field name has to be in the data dictionary.

Using conversion routines in screen fields

Before any process after input is executed, a conversion routine could pick up some work for you. Conversion routines are usually held on domains, it executes a routine that can alter the contents of your (input) field. The best example would be ALPHA, a routine that could be used by the material master for converting the material number (the material master is in fact using MATN1for that. When a number is entered, leading zeros are added, when a non numeric character is part of the code, no changes are done.

If your screen field should handle the same way, simply input the ALPHAconversion routine in your screen field attributes. The system will execute the conversion before the PAI is executed.

A list of possible conversion routines would bring you to a little more understanding of how these routines operate. For every conversion routine, two function modules are available. You could use these modules without using the actual conversion routine setup, by calling them directly. The function modules for conversion routines are split up in output (internal to external) and input (external to internal). The function module names always begin with CONVERSION_EXIT_, followed by the conversion routine name, followed by either _INPUT or _OUTPUT.

These conversion routines might be handy:

  • ALPHA Adds leading zero's if the character field only contains numbers. Also have a look at function module NUMERIC_CHECKas possible solution for this one
  • POSID and POSNRConversion of position numbers (as often applied by SAP)
  • KONPRPM specific: the WBS number
  • NUMCVNumerics
  • INVDTInverted dates
  • INVGJInverted fiscal year
  • There's more !