Вы находитесь на странице: 1из 6

FIELD EXITS MANUAL

Se tratan en la transaccin CMOD.


Main Menu
Herramientas
Workbench ABAP/4
Utilidades
Ampliaciones
Gestin proyectos
Ampliaciones glob.
Exits campo
Desde aqu tienes que ir a la opcin crear la field exit. Cuando lo
haces lo que te pide es que crees una funcin que tiene la
particularidad de que slo tiene un parmetro de entrada INPUT y
uno de salida OUTPUT.
A priori no puedes conocer ningn dato ms, aunque siempre
puedes utilizar otras field exits para guardar el contenido de otros
campos en variables globales al grupo de funcin, o utilizar la
funcin DYNP_VALUES_READ para leer valores de otros
campos de la pantalla.
FUNCTION FIELD_EXIT_BPREI_1.
*"---------------------------------------------------------------------*"*'Interfase local
*"
IMPORTING
*"
VALUE(INPUT)
*"
EXPORTING
*"
VALUE(OUTPUT)
*"----------------------------------------------------------------------

Cuando creas la primera field exit, sta es a nivel global, es decir actuara sobre cualquier campo que est
definido con el elemento de datos sobre el que has creado la field exit.

Si lo que se pretende es que la field exit slo actue a nivel de determinados dynpro, se ha de seleccionar la
field exit, y seleccionar Asignar prog/dynpro, entonces aparecer una ventana en la que te pedir un n de
funcin y el programa / dynpro sobre el que quieres que actue la field exit. Si se declara alguna field exit
a nivel de dynpro, no funcionar la field exit a nivel global.

Cuando ya se ha haya definido la field exit, se debe activar para que funcione.

R/3 note no.


29377
05.11.1999
Page 1
________________________________________________________________________
Number
Version
Status
Set by

0029377
0015 from 28.10.1999
Released for customer
SAP AG on 28.10.1999

Language
Short text

EN
Questions and answers: field exits (CMOD)

Administrator
SAP AG
Component
BC-DWB-CEX Customer Extensions
________________________________________________________________________
Long text
Symptom
Problems with, and questions concerning field exits
Additional key words
SMOD/CMOD, field exits
Cause and preconditions
..
Solution
1. Field exit was created with CMOD, but is not processed when calling
the screen.
o

Since the field exit is not processed until PAI, an action must be
triggered on the screen (Return, Save, ...).

Set profile parameter abap/fieldexit to YES and restart the


system.

After activating the function module FIELD_EXIT... and the field


exit, leave the transaction on whose screen the field exit is to
be executed. The screen is not generated until the transaction is
started.

Do not work on different application servers since there may be


some delay before the field exit is activated.

The profile parameter must be set on all or none of the


application servers.

If the field exit is to only be active on specific screens, check


whether you chose the correct program and the correct screen
number (take care with subscreens).

Using SE51 -> Field list, check that the screen field does have a
reference to a data element. In the name of the field exit use the
name of the data element and not the field name.

After transport, field exits are marked as active but will not be
processed. Tip: First try deactivating the field exit once more
and then afterwards, activate it again.
Page 2

2. How is performance affected by setting abap/fieldexit?


o

If a screen is generated and the profile parameter is set, a check


is run on 2 tables (TDDIR, TDDIRS) to see whether a field exit
must be generated for the respective field. In practice, the
screen load is not generated until the screen is selected after an

update. The user should not notice any difference because screen
generation is very fast.
3. Can you read the contents of other screen fields in the field exit?
o

In principle, every field exit can store its value in the global
variables of the function group (TOP) and hence make them
available to other field exits. Note here that field exits are
always called and not only if an entry is made in the field or if
the field is empty. In addition, it is not possible to make any
assumptions about the order in which the field exits will be
called in the future.

4. How does the field exit behave on step loop fields ?


o

After the user has entered data, the field exit is called in PAI
as often as there are visible fields in the step loop. The system
variable SY-STEPL is incremented each time. If a new value is
assigned to the field, it is displayed in the module between LOOP
and ENDLOOP. This module is also called once for each visible step
loop line.

5. Can field exits be debugged ?


o

No. Field exits must be tested separately in the ABAP/4


Development Workbench. For errors which only occur in the screen
environment, it is helpful to write interesting variable to the
file system using TRANSFER... . These can then be analysed there.

6. What can you do if the field contents are no longer transported to to


ABAP/4.
o

Check whether a value is assigned to the field OUTPUT.

7. When is the field exit called if a conversion exit is attached to the


data element ?
o

The field exit is called after the conversion exit. This means
that the INPUT field receives the data in the same format as the
ABAP/4 program also receives it.

8. Although a global field exit is inactive, a function module is called


which does not exist (for example FIELD_EXIT_PROGRAMM_@)
o

This is an error in the kernel which no longer occurs as of 3.0C.


As a temporary measure, it is useful to assign a program and a
screen which do not exist to the field exit and then activate the
field exit.

9. Field exit is not visible in CMOD, although created.


Page 3
o

If you want to create a field exit for a data element, a function


module is proposed with the name FIELD_EXIT_<data_element>. This
function module must exist for the field exit to work. If you do
not create this function module, but do create one with a suffix,
the data element is not displayed in CMOD.

10.Field exit is not executed although it is active.


o

Fields which do not have the 'Input field' attribute usually do


not trigger a field exit. The field exit is designed to allow an
extended input check. It is therefore only called for input fields
- even if they are not ready for input at runtime of the
application by LOOP AT SCREEN.
This rule does not apply, however, if the field is located within
a steploop. Here the field will be always activated, even if it is

invisible.
o

Field exits can only be executed for fields that are directly
related tothe dictionary. If the relation is indirect, i.e. via an
ABAP declaration ( <fieldname> LIKE <dictionary element>), no
field exit can be executed.

11.Field exits on check buttons do not work


o

Field exits are only intended for input fields. As check buttons
count as graphical elements, you cannot install field exits on
them.

12.Field exits do not work on selection screens


Source code corrections
________________________________________________________________________
Valid releases
R/3 standard

40A - 40B
300 - 31I
22A - 22J

________________________________________________________________________
Reference to related notes
Number
Short text
____________________________________________________________
0144261
Error in the field transport on screens
0158983
8 Days Validation
________________________________________________________________________

Вам также может понравиться