Enhancements

 Enhancements in ABAP. 

User Exit

  • User exists are typically provided for applications in the SAP ERP Sales and Distribution (SD) module.
  • All the include programs that contain user exits are saved in the VMOD package.
  • Locate the inlcude in which the desired code can be added. 
  • To Add Custom code, remember it is saved as a repair in a Repair Task:-
    1.  Click on Change button to change the include program in which the required subroutine is located.
    2. Now, Inside the Subroutine, i.e place the cursor between Form...EndForm and click on the Insert Icon to add Custom Code.

  1. Example:- A business requirement is to ensure the order quantity that can be saved should not be less than 10.  Transaction VA02 allows us to change a document. We changed the standard code in the include program MV45AFZZ. 
  2. We access the include program and add the custom code following the steps mentioned in the above picture. 

Customer Exits

Customer exits, also known as CMOD enhancements, are the successor to user exits. Customer exits implement hooks using function modules. Customer exit function modules are implemented with the naming convention EXIT_XXXXX_NNN, where  XXXXX is the program name in which the customer function is called and NNN is the exit number. In a standard SAP program, a function module is called using the CALL CUSTOMER-FUNCTION 'NNN' statement.

  • Function Module Exit - Add 
  • Screen Exit
  • Menu Exit

There are many ways but no certain way of finding an Customer Exit. For Example if we want to enhance the transaction VF03.

Method I:-  Find the package to which the transaction belongs to, Go to Tcode SE93. Enter the TCODE whose details we want to know.    


   
  1.  Go to transaction SMOD to find the available enhancements.
     

  2. Choose the Enhancement and click Display.
        
  3.    

                                                                          



  4. Now, open the program  SAPLV60B and search for all the EXIT.   
  5. In the search  result we get all the EXIT, to find the point in the program flow at which our desired EXIT is called search using the EXIT number,  in this case EXIT no. 001.  
  6. Click on the search result, it will take to the point where the EXIT is called. 

  7. Place a break pont here and try to RUN the activity in which you want to add your custom code (Basically Enhance the Program :) ). This case we want to enhance before the document is saved!
  8. Also we check the parameters passed to this function module, if the desired values are available to meet our customizing requirement. Note: The Enhancement should serve 2 purpose, ie. it should be availbale at the right point of program flow and it should have the desired data as importing and exporting parameters to meet the requirement. 

  9. To Write Custom Code in the Enhancement open the function module Exit as seen in fig 4.2 . There would be a include program with its name starting with 'ZX' . Doubleclick on the include name, if it is implemented then it will open the include program else it will give a message as shown. We have to press ENTER to navigate to the include program. We can add our custom code in it.                                                                                                                                                                      

Method II:-

    Another method to search for available enhancements is to use lookup table MODSAP in ABAP Data Dictionary. All enhancements are saved in database table MODSAP, so you can search table MODSAP by using wild cards for a program name (e.g., SAPLV60B).


Method III:- 

Customer exits are called in standard SAP programs using the CALL CUSTOMER statement; therefore, you can search the standard SAP program code using the CALL CUSTOMER keyword to identify the customer exits called in the program. This isn’t a straightforward method to find customer exits and may not be useful if many other programs are called from the main program and the call to
the customer exit is implemented in one of the called programs.
      


Create a Customer Exit

The following steps walk you through implementing a customer exit:
  1. First, create a project using Transaction CMOD. On the initial screen of Transaction CMOD, enter the name of the project and click Create, as shown




  • Enter the Enhancement that was found using the above methods. If the Enhacement is used in any other project it will give an error.




  • Inactive Project


  • See Step 8 of Method I of implementing an Enhancement. 

  • In the above figure we see an active Enhancemnet implementation, which is the feature of Switch Framework.Allowing you to control the Enhancement Implementaion.

Comments