Technical Articles
Field-Exit Implementing – CMOD / PRFB
In this Post, we will learn how to create a Field-Exit Global and Local.
– What’s a Field Exit? It allows you to define consistencies for a specific field, standard or non-standard.
- Global Field-Exit: Applicable to all screens.
- Local Field-Exit: That is applicable to a particular screen (ie if you want to create a validation for the “Old material number” field in MM01 only, the same validation will not be applicable for other screens such as VL32N, MB1C etc.).
A didactic activity of this Post: you place a validation in the “Old material number” field on the Basic Data 1 tab (MM01) which will not allow you to enter the value “ABC” (See the picture below).
Steps
1) For Field-Exits in R3 740, execute CMOD transaction. Then type PRFB in the command field.
2) In the top menu, click in the menu Field-Exit >> Create >> Enter the name of the Data Element of the field to which you want to insert a validation (BISMT for the tutorial).
3) Enter the required data element for the screen field to be required and execute.
4) Another screen comes with a <FIELD_EXIT_{Element_Data_name}> name function.
5) Click create and save it corresponding function group.
6) You will have a function module with an import parameter as INPUT and an export parameter as OUTPUT.
7) In the source code of the function, write the code for validation and activate it.
FUNCTION field_exit_bismt.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(INPUT)
*" EXPORTING
*" REFERENCE(OUTPUT)
*"----------------------------------------------------------------------
IF input = 'ABC'.
MESSAGE 'the value ABC for the field Old material number is not allowed' TYPE 'E'.
ENDIF.
ENDFUNCTION.
8) Return to the PRFB command and you can see that Field-Exit is global and not yet active.
9) So, go to menu Field-Exit >> Activate.
10) The field is active now, but we need to set it as a local only for the MM01 screen, so, click on “Assign Prog./Screen”, set the fields and save it:
![]() |
![]() |
11) You can see that Field-Exit is up and working:
This is a simple way to create a Field-Exit. Let me know if you have any questions or suggestions.
FIeld Exits are deactivated by default since 6.10, and have been considered obsolete for many years. On that basis, I have to say: DO NOT USE.
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenfield_exit_glosry.htm
Could not agree more. That's exactly why PRFB code is not available directly in CMOD transaction.
I have too agree. They are unstable, often behave in unexpected ways and are almost impossible to troubleshoot.
Whatever the business problem is that is attempting to be solved suing a field exit, there is always a better way.
Menu exits were similarly deprecated several years ago.