We will check various methods to find customer exit with example in standard SAP. Let’s first get the basics about customer exit. In the end, we will check one example of customer exit in VA02 Transaction.

Details of Customer exit: It is a type of enhancement that will enable us to enhance the functionality of Programs, screens & menus. Hence there are three types of enhancement under the hood of customer exit that are

  • Function Exit : It is in the form of Function module,which will enhance the standard functionality of a program.
  • Screen Exit: It is used to enhance the standard screen
  • Menu Exit : It is used to enhance the menu option

Customer exits are of function modules with naming conventions like EXIT_<Program_name>_<number> for example customer exit in sales order in SD module EXIT_SAPMV45A_004

Customer exits are being called inside the standard program using the following statement CALL CUSTOMER-FUNCTION ‘<NUMBER>’ e.g. CALL CUSTOMER-FUNCTION ‘004’

Methods to Find out customer exit in the standard program:

  • Find out the program name and do global search keyword ‘CALL CUSTOMER’ in the program like below in SAPMV45A (Sales Order Program)
search customer exit using global search
  • Set break point at statement ‘CALL CUSTOMER’ during execution standard tcode.Suppose VA02 is the Tcode in which we need to find out the customer exit. while executing the tcode VA02, put /h to initiate debugging and set the break point at statement (menu breakpoint -> breakpoint at -> statement ) or shift + F5
find customer exit using debugging
  • Use the transaction SMOD : Do F4 in the ehancment and provide the details to find out the enahcement
find customer exit in SMOD
Search the enhancement by using package name or short text
  • Check the table MODSAP to find out the enhacement name
search customer exit in MODSAP table

If non of the way worked for you then google it out 😉 to get the enhancement

Let’s check out one example:

Requirement: Make the customer reference field (VBKD-BSTKD) non-editable in the VA02 Screen if the order type is OR1

customer exit for VA02 tcode

So from the above method, we found out that the EXIT_SAPMV45_004 is suitable for this based on the importing and changing parameters

customer exit with example
Double click on the include to implement the same, you will get the warning message but ignore and press enter to implement the same
IF i_screen_name EQ 'VBKD-BSTKD' AND sy-tcode EQ 'VA02'.
   "Read the order type VBAK-AUART from ABAP stack
   DATA:lv_string TYPE string VALUE '(SAPMV45A)VBAK-AUART'.
   FIELD-SYMBOLS:<lv_auart> TYPE any.
   ASSIGN (lv_string) TO <lv_auart>.
   IF <lv_auart> IS ASSIGNED AND <lv_auart> EQ 'OR1'.
     c_screen_input = 0. "make the field non editable
   ENDIF.
ENDIF.

After implementing the above code in the include. Result is below

VA02 transcation

Well, customer exit is the successor of user exit. It has an additional feature called switch framework, which can be used to on-off the enhancement. To add such a feature you need to follow the below steps

  • Create a Project in CMOD Transaction
CMOD
  • Assign the enhancement to the project
CMOD assignment
CMOD enh assignment
the enhancement name can get from MODSAP table by using the Function module name
  • Activate the component
CMOD component
Once the components are activated the red indicator will be turned into green and the project will be activated.
CMOD activation

Now you can play with the switch framework by activating and deactivating the project. Check out the difference

Project activation

Note: Once the enhancement is assigned to a project, it can not be re-assigned to another. To check the project name and enhancement attached to it use the table MODACT

MODACT

Check out our OData series OData – ABAP Skill

Check out our CDS View Series CDS – ABAP Skill

Check out ABAP Blogs ABAP – ABAP Skill

SAP Document: Link


1 Comment

How to implement BTE with example in SAP ABAP - ABAP Skill · August 22, 2021 at 4:39 pm

[…] customer exit (detail can be found in the link ) it has also the feature of switch on-off functionality. The BTE can be disabled by deactivating […]

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *