5
28.12.2010 Page 1 of 5 SAP Note 29377 - FAQs: Field exits (CMOD) Note Language: English Version: 41 Validity: Valid Since 29.07.2008 Summary Symptom Problems and questions concerning field exits Other terms FAQ, Q+A, SMOD/CMOD, field exits Reason and Prerequisites Note Field exits are frozen at the 4.6C maintenance level and are not further developed. This means that the existing function remains with all restrictions (see also the last item below). You can continue to use existing exits and call them during runtime. Existing exits can be maintained using program RSMODPRF (run the program using transaction SE38). Activation of the field exits and assignment of the dynpros can also be carried out using the program RSMODPRF. For this purpose, the program must be started without parameters (input fields remain empty). After you executed the report RSMODPRF on one instance, you must use the OK code /$NAM to refresh the nametab buffers on the other instances. The report RSMODPRF does NOT trigger the buffer synchronisation. If required, you can use the program RSMODPRF to create new field exits (see program documentation). Solution 1. The field exit was created with CMOD, but is not processed when the screen is called. o Field exits can be defined only for data elements whose name is shorter than 19 characters. The name of the data element plus the prefix "FIELD_EXIT_" must not exceed the maximum length of a function module name (30). o Since the field exit is not processed until PAI, an action must be triggered on the screen (choose enter, save, and so on). o Set the profile parameter abap/fieldexit = YES and restart the system. o After activating the function module FIELD_EXIT... and the field exit, leave the transaction on whose screen you want to execute the field exit. The relevant screen is only generated when the transaction is called.

Field Exit Sapnote 0000029377

Embed Size (px)

Citation preview

28.12.2010 Page 1 of 5

SAP Note 29377 - FAQs: Field exits (CMOD)

Note Language: English Version: 41 Validity: Valid Since 29.07.2008

Summary

SymptomProblems and questions concerning field exits

Other termsFAQ, Q+A, SMOD/CMOD, field exits

Reason and Prerequisites

NoteField exits are frozen at the 4.6C maintenance level and are notfurther developed.

This means that the existing function remains with all restrictions (seealso the last item below).You can continue to use existing exits and call them during runtime.Existing exits can be maintained using program RSMODPRF (run the programusing transaction SE38). Activation of the field exits and assignment ofthe dynpros can also be carried out using the program RSMODPRF. For thispurpose, the program must be started without parameters (input fieldsremain empty).

After you executed the report RSMODPRF on one instance, you must use the OKcode /$NAM to refresh the nametab buffers on the other instances. Thereport RSMODPRF does NOT trigger the buffer synchronisation.

If required, you can use the program RSMODPRF to create new field exits(see program documentation).

Solution

1. The field exit was created with CMOD, but is not processed when thescreen is called.

o Field exits can be defined only for data elements whose name isshorter than 19 characters. The name of the data element plus theprefix "FIELD_EXIT_" must not exceed the maximum length of afunction module name (30).

o Since the field exit is not processed until PAI, an action must betriggered on the screen (choose enter, save, and so on).

o Set the profile parameter abap/fieldexit = YES and restart thesystem.

o After activating the function module FIELD_EXIT... and the fieldexit, leave the transaction on whose screen you want to execute thefield exit. The relevant screen is only generated when thetransaction is called.

28.12.2010 Page 2 of 5

SAP Note 29377 - FAQs: Field exits (CMOD)

o Do not work on different application servers since there may besome delay before the field exit is activated.

o The profile parameter must be set on all or no application servers.

o If the field exit is to only be active on specific screens, checkwhether you chose the correct program and the correct screen number(take care with subscreens).

o Use transaction SE51 to generate the screen on which the exitshould be active. It is possible that it was not correctlygenerated. If you want to be sure that all screens that use thedata element are regenerated, you can copy the report rsmodfdg fromthe correction instructions and start it with transaction SE38. Thereport uses the affected data element as the input parameter andregenerates all screens that use the data element.

o Use transaction SE51 and choose 'Field list' to check that thescreen field actually has a reference to a data element. In thename of the field exit, use the name of the data element and notthe field name.

o After the transport, field exits are marked as active but are notprocessed. Tip: First try to deactivate the field exit once moreand then activate it again.

2. How is performance affected by setting abap/field exit?

o If a screen is generated and the profile parameter is set, a checkis run on two tables (TDDIR, TDDIRS) to see whether a field exitmust be generated for the respective field. The screen load is, inpractice, only generated after an update when the screen isselected. The user should not notice any difference in the speed,as the 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 globalvariables of the function group (TOP) and make them available toother field exits. Note that field exits are always called, notonly if an entry is made in the field or if the field is empty. Inaddition, it is not possible to make any assumptions about theorder 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 asoften as there are visible fields in the step loop. The systemvariable SY-STEPL is incremented in this case. If a new value isassigned to the field, it is displayed in the module between LOOP.and ENDLOOP. This module is also called once for each visible steploop line.

5. Can field exits be debugged ?

o No. Field exits must be tested separately in the developmentenvironment. With errors that occur in the screen environment only,

28.12.2010 Page 3 of 5

SAP Note 29377 - FAQs: Field exits (CMOD)

it is useful to write relevant variables to the file system usingTRANSFER..., and then evaluate them there.

6. What should be done if the field contents are no longer transported toABAP/4?

o Check whether you assign a value to the field OUTPUT.

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

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

8. Although a global field exit is inactive, a function module is calledthat does not exist (for example, FIELD_EXIT_PROGRAMM_@). This canlead to an ABAP dump error when function module FIELD_EXIT_<dataelement name> is called.

o This is an error in the kernel that no longer occurs as of Release3.0C. As a temporary measure, you can assign a program and a screenthat do not exist to the field exit, and then activate the fieldexit.

o Due to performance reasons, the active/inactive indicator is storedin the screenload. This can cause inconsistencies between sourceand load. Generate the affected screen with transaction SE51. Ifyou want to be sure that all screens that use the data element areregenerated, you can transfer the report rsmodfdg from thecorrection instructions and start it with SE38. The report uses theaffected data element as the input parameter and regenerates allscreens that use the data element.

9. The field exit is not visible in CMOD, although it was created.

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

10. The field exit is not executed although it is active.

o Fields that do not have the 'Input field' attribute usually do nottrigger a field exit. The field exit is designed to allow anextended input check. It is therefore only called for input fields,even if they are not ready for input at application runtime usingLOOP AT SCREEN. This rule does not apply, however, if the field islocated within a steploop. Here, the field exit will be alwaysactivated, even if the field is invisible.

o Field exits can only be executed for fields that are directlyrelated to the dictionary. If the relation is indirect, for exampleusing an ABAP declaration (<fieldname> LIKE <dictionary element>),the field exit cannot be executed.

11. Field exits do not work on selection screens.

28.12.2010 Page 4 of 5

SAP Note 29377 - FAQs: Field exits (CMOD)

o Results from the previous item, since selection screens useABAP-internal fields and not the original dictionary fields.

12. Field exists do not work on check buttons.

o Field exits are only intended for input fields. Since check buttonsare consideed graphical elements, you cannot install field exits onthem.

13. How can all screens that use a data element be generated?

o If you want to be sure that all screens that use a specific dataelement are regenerated, you can transfer the report rsmodfdg fromthe correction instructions into a customer report (for example,zsmodfdg). The report regenerates all screens. You can thereforeensure that active field exits refer to screens, and that inactiveexits cannot be called on any screen. The report uses the affecteddata element as the input parameter. The affected data element isin the name of the exit: FIELD_EXIT_<data element name>.

14. Restriction of usage

o The field exit technology was developed for input fields on screensand cannot be used for other/new screen elements. This means thatthis technology does not offer support for the new ScreenPainterelements such as graphical elements (for example, checkbuttons,radiobuttons, dropdown list boxes), controls (except for tablecontrols, which are supported like a step loop), or selectionscreens.

Header Data

Release Status: Released for CustomerReleased on: 05.08.2008 14:22:08Master Language: GermanPriority: Recommendations/additional infoCategory: FAQPrimary Component: BC-DWB-CEX Customer Extensions

Valid Releases

Software Component Release FromRelease

ToRelease

andSubsequent

SAP_APPL 30 300 31I X

SAP_APPL 40 40A 40B X

SAP_APPL 45 45A 45B X

SAP_APPL 46 46A 46B X

SAP_APPL 46C 46C 46C X

SAP_BASIS 46 46A 46D

SAP_BASIS 60 610 640

28.12.2010 Page 5 of 5

SAP Note 29377 - FAQs: Field exits (CMOD)

Software Component Release FromRelease

ToRelease

andSubsequent

SAP_BASIS 70 700 702

SAP_BASIS 71 710 720

SAP_ABA 46 46B 46B X

Related Notes

Number Short Text

712065 Service order: Reference for premise data

608469 Change in FI Field Exits for Business Place - EWT TDS

594303 Missing fields in BAPIADDR1 and BAPIADDR2

336145 MM postings: 10 Days Validation

308196 Field exit cannot be found after upgrade to Rel. 4.x

144261 Error in the field transport on screens

Correction Instructions

CorrectionInstructions

Validfrom

Validto

SoftwareComponent

Type*)

ReferenceCorrection

LastChanged

163155 300 46C SAP_APPL C 15.05.200222:00:52

*) C Correction, B Preprocessing, A Postprocessing, M Undefined Work