SAP Program RSMODPRF - Field Exits for Data Elements

Description

Maintenance transaction for creating and activating field exits
As part of the extension concept, SAP allows you to install a fieldexit for each screen field. Similar to the conversion exit, the systembranches at the field exit at DCI (DATA COMMUNICATIONS INPUT) to afunction module, if the field is an input field and a function code wastriggered. The function module must adhere to the following namingconvention:

  • Prefix: FIELD_EXIT_

  • Infix:

  • Suffix: _0 to _9 (optional), _A to _Z

  • The interface is automatically generated during the creation of thefunction module, and has 2 parameters:
    • Import parameter: INPUT

    • Export parameter: OUTPUT

    • After a function code has been triggered the contents of the field aremade available to the FB via the "INPUT" import parameter. You can editthis and, when changed, make it available to the ABAP/4 processor in"OUTPUT". The input field contents are usually passed on: you cansimply write OUTPUT = INPUT.
      If, e.g., you have activated the field exit for the data element'PROGRAM', then the fields of all the screens, which refer to the dataelement 'PROGRAM', branch to the function module FIELD_EXIT_PROGRAM.This includes the field 'Program' of the initial screen SAPMS38M0100 intransaction SE38, for example.
      If you do not want the function module to be accessed from all screens,assign particular screens to the data element PROGRAM. By allocating anexit number, it is also possible to branch to other function moduleswith the corresponding suffix _0 ... _Z.
      Example: You have assigned screen SAPMS38M0100 and exit number 5 todata element 'PROGRAM'. The corresponding field on SAPMS38M0100branches to FIELD_EXIT_PROGRAMM_5.
      As soon as you activate an exit, the corresponding screens areinvalidated.
      Note: Field exits are only taken into account during screengeneration if the parameter abap/fieldexit = 'YES' is set in thesystem profile.

      Precondition
      Set the profile parameter abap/fieldexit = 'YES' before system start.

      Limitations
      The following ABAP statements are not allowed in the function modulesof field exits:
      BREAK-POINT,
      CALL SCREEN, CALL DIALOG, CALL TRANSACTION, SUBMIT,
      COMMIT WORK, ROLLBACK WORK,
      COMMUNICATION RECEIVE,
      EXIT FROM STEP-LOOP,
      MESSAGE I, MESSAGE W.
      Note:

      • Field exits cannot be edited with the debugger.

      • You should not use any external Performs in field exits. The ABAP
      • processor shares the table work areas of externally called programswith those of the first caller. This could lead to errors at fieldexits that can hardly be analyzed, as field exits are sometimes slippedinto the flow of the program at unforeseen events.

        Questions and answers on field exits

        1. A field exit was created with the CMOD and activated, but it doesnot get executed when the screen is called.

        • Since the field exit is not executed until DCI, some action must occur
        • in the screen (e.g. press Return, saving....).
          • Set the abap/fieldexit profile parameter to YES and start the system
          • again.
            • After the FIELD_EXIT... function module has been activated and the
            • field exit has been activated, the transaction in whose screen thefield exit is to be executed must be terminated. The screen is notgenerated until it is called.
              • Do not work on different application servers, otherwise there may be a
              • delay before the field exit becomes active.
                • The profile parameter must be set either on all application servers or
                • on none.
                  • If the field exit is to be active in certain screens only, then you
                  • should check whether you have selected the correct program and thecorrect screen number (Careful with SUBSCREENS !).
                    • Use SE51, field list, to ensure that the screen field really does have
                    • a DDIC reference! Do not rely on the F1 information for the field!

                      2. How does setting abap/fieldexit affect the performance?

                      • If a screen is generated and the profile parameter is set, then the
                      • system checks in 2 tables (TDDIR, TDDIRS) to see whether a field exithas to be generated for the field. In practice the screen load after aPut is not generated until the screen is called. The user will notexperience a noticeable delay, since screen generation is extremelyfast.

                        3. Can the contents of other screen fields be read in a field exit?

                        • In principle all fields can be copied to global variables in the TOP or
                        • the function group. However, since the order in which the field exitsare called is not guaranteed, this possibility should not be used.

                          4. How does the field exit work in step-loop fields?

                          • After data input to DCI the field exit will be called as many times as
                          • fields are visible on the step-loop. The SY-STEPL system variable isincremented each time. If a new value is assigned to be field, then itwill be visible in the module between LOOP. ENDLOOP. This module willalso be called as many times as there are visible step-loop lines.

                            5. Can field exits be debugged?

                            • No. Field exits have to be tested in isolation in the development
                            • environment. To analyze problems that occur only in the screenenvironment, the relevant variables can be written to the file systemusing TRANSFER... and can be analyzed there.

                              6. What should one do if the field contents are not getting transportedto ABAP/4?

                              • Check whether you have assigned a value to the OUTPUT field.
                              • 7. When does the field exit get called in the case that there is aconversion exit attached to the data element?

                                • The field exit will be called after the conversion exit. This means
                                • that the INPUT field contains the data in the same form as that inwhich the ABAP/4 program also gets them.

1552775Regenerating all field texts
144261Error in the field transport on screens
336145MM postings: 10 Days Validation