Skip to Content
Author's profile photo Sujeet Mishra

Field Exit and Field Enhancement

Field Exit and Field Enhancement


Field Exit:


Field exit is used to write your custom logic against field, it is no longer used by SAP after 4.6C as SAP has come up with lots of user exit and enhancement options. However this document illustrates the way we can use field exit in our SAP.

Go to Transaction Code CMOD then put Transaction Code PRFB in Command Prompt.

SDN1.JPG

Then Go to Menu option ‘Field Exit -> Create’, it will come to below shown screen.

SDN1.JPG

SDN1.JPG

Or

Run the Program RSMODPRF without parameters.

SDN1.JPG

Execute the program.

SDN1.JPG

Now, once we create FIELD_EXIT_XXXX function Module, then it will get triggered every time we use that field.

Set the profile parameter abap/field exit = YES and restart the system.

And before using this field exit, we need to assign it to program and screen.

To assign field exit to a screen, go to Transaction Code PRFB and select your Data Element and click on Assign program/ screen.

SDN1.JPG

Field Enhancement:


Example:  As we can see in below screen shot, we have VBAK-AUART field with Data Element description ‘SD document category’. Now we will use Field Enhancement Technique to Change this Data Element Description to “Test Document Category”.

SDN1.JPG

Go to Transaction Code CMOD and follow the path as shown in below screen.

SDN1.JPG

Make Changes to description.

SDN2.JPG

Save it and now check the changes.

SDN1.JPG

Assigned Tags

      13 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      What exactly is the used of this Field-exit feature? Does it rename the field labels for the particular data element?

      - Suhas

      Author's profile photo Sujeet Mishra
      Sujeet Mishra
      Blog Post Author

      Suhas,

      You can use field exit for validations, as explained in document, we create function module for exit, and we assign program and screen number to this field exit, so whenever the program gets executed this exit will get triggered for respective field. you can use it like customer exit.

      Author's profile photo SHANKARANARAYAN KRISHNAMOORTHY
      SHANKARANARAYAN KRISHNAMOORTHY

      Hi Sujeet,

      Using field enhancements, can the lables for any standard field can be changed ?

      BR,

      Shankar.

      Author's profile photo Sujeet Mishra
      Sujeet Mishra
      Blog Post Author

      Hi Shankarnarayan,

      Yes, you can change labels of any standard field.

      Regards,

      Sujeet

      Author's profile photo SHANKARANARAYAN KRISHNAMOORTHY
      SHANKARANARAYAN KRISHNAMOORTHY

      Good piece of knowledge. I never knew this.

      Author's profile photo Former Member
      Former Member

      good one

      Author's profile photo Sujeet Mishra
      Sujeet Mishra
      Blog Post Author

      Thanks Thomas.. 🙂

      Regards,

      Sujeet

      Author's profile photo Sijin Chandran
      Sijin Chandran

      Hello Sujeet ,

      I guess there is no need to create Field Exit in order to rename the label.

      As I was able to change the description of AUART using CMOD itself.

      What I think the exact requirement of field exit is for validation , if you could please highlight how can it be done.

      The above technique has already been posted in SD Section ( renaming label )

      I mean how can we use that FM FIELD_EXIT_AUART ?

      Author's profile photo Sujeet Mishra
      Sujeet Mishra
      Blog Post Author

      Hi Sijin,

      Thanks for your review.

      In this document, we have two separate part, One is for Field-Exit and other is for Field Enhancement. Field Exit does not rename the Label.. It's mentioned in Field Enhancement section to rename it's Label. as you said we can rename Label using CMOD only and same is explained.

      Field-Exit : Ref. below link for more details..

      http://wiki.sdn.sap.com/wiki/display/ABAP/Field+exits

      Regards,

      Sujeet

      Author's profile photo Sijin Chandran
      Sijin Chandran

      Fine Sujeet ,

      In the first part you explained about Field Exit creation and without giving any example for its usage , you mentioned about the Field Enhancement . That's why I linked both of them with respect to your document.

      My mistake 🙂

      The link which you have highlighted in the previous comment , I have gone through the same already and created one also.

      But can you please paste a sample code or a scenario explaining the usage of Field Exit ( Function Module ) , I mean how that IMPORT Parameter , EXPORT Parameter can be utilized . This has not been mentioned in this document also.

      Author's profile photo Former Member
      Former Member

      my system says error msg...

      does it have any effect or first i have to configure the system:

      1.JPG

      Author's profile photo Sujeet Mishra
      Sujeet Mishra
      Blog Post Author

      Hello Abhishek,

      FIeld Exit is deactivated by default since NW 6.10, and is obsolete since SAP Basis 4.6a.

      Activation of Field Exit :

      Go to Transaction Code RZ10 and Set the Profile parameter abap/fieldexit = 1.

      Regards,

      Sujeet

      Author's profile photo Former Member
      Former Member

      Good One..