<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: User exits in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exits/m-p/3523321#M847450</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stalin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; pls go through this link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://husnie.wordpress.com/2007/08/04/sap-abab-using-the-user-exit/" target="test_blank"&gt;http://husnie.wordpress.com/2007/08/04/sap-abab-using-the-user-exit/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Viveks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Feb 2008 18:14:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-28T18:14:28Z</dc:date>
    <item>
      <title>User exits</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exits/m-p/3523318#M847447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone send me the procedures for user exits...Is ther any easy to understand links for document..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls post it here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 18:00:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exits/m-p/3523318#M847447</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-28T18:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: User exits</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exits/m-p/3523319#M847448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;stalin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.saptechnical.com/Tutorials/ExitsBADIs/ExitsMain.htm" target="test_blank"&gt;http://www.saptechnical.com/Tutorials/ExitsBADIs/ExitsMain.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;SAB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 18:03:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exits/m-p/3523319#M847448</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-28T18:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: User exits</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exits/m-p/3523320#M847449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi check this its a field exit. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step by step procedure for creating Field Exits&lt;/P&gt;&lt;P&gt;There are eight steps to creating a field exit:&lt;/P&gt;&lt;P&gt;Step 1:  Determine Data Element&lt;/P&gt;&lt;P&gt;Step 2:  Go To Field Exit Transaction&lt;/P&gt;&lt;P&gt;Step 3:  Create Field Exit&lt;/P&gt;&lt;P&gt;Step 4:  Create Function Module&lt;/P&gt;&lt;P&gt;Step 5:  Code Function Module&lt;/P&gt;&lt;P&gt;Step 6:  Activate Function Module&lt;/P&gt;&lt;P&gt;Step 7:  Assign Program/Screen&lt;/P&gt;&lt;P&gt;Step 8:  Activate Field Exit&lt;/P&gt;&lt;P&gt;Step 1:  Determine Data Element&lt;/P&gt;&lt;P&gt;-	Before you can begin adding the functionality for a field exit, you must know the corresponding data element.&lt;/P&gt;&lt;P&gt;-	An easy way to determine the data element associated to a particular screen field is to:&lt;/P&gt;&lt;P&gt;		Go the appropriate screen.&lt;/P&gt;&lt;P&gt;		Position the cursor in the appropriate field.&lt;/P&gt;&lt;P&gt;		Press &amp;#145;F1&amp;#146; for field-level help.&lt;/P&gt;&lt;P&gt;		Click on the &amp;#145;Technical info&amp;#146; pushbutton (or press &amp;#145;F9&amp;#146;) on the help dialog box.&lt;/P&gt;&lt;P&gt;		On this Technical Information dialog box, the data element will be specified if the field is 'painted' from the 		ABAP/4 Dictionary.&lt;/P&gt;&lt;P&gt;Step 2:  Go To Field Exit Transaction&lt;/P&gt;&lt;P&gt;-	The transaction to create field exits is CMOD.&lt;/P&gt;&lt;P&gt;-	You can use the menu path Tools -&amp;gt; ABAP/4 Workbench -&amp;gt; Utilities -&amp;gt; Enhancements -&amp;gt; Project management.&lt;/P&gt;&lt;P&gt;-	From the initial screen of transaction CMOD, choose the Text enhancements -&amp;gt; Field exits  menu path.&lt;/P&gt;&lt;P&gt;-	After choosing this menu path, you will be taken to the field exits screen.  From here, you can create a field exit.&lt;/P&gt;&lt;P&gt;NOTE :  Even though you use transaction CMOD to maintain field exits, you do not need to create a project to activate field exits.&lt;/P&gt;&lt;P&gt;Step 3:  Create Field Exit&lt;/P&gt;&lt;P&gt;-	From the field exit screen of transaction CMOD, choose the Field exit -&amp;gt; Create menu path.&lt;/P&gt;&lt;P&gt;-	 After choosing this menu path, a dialog box will prompt you for the appropriate data element .&lt;/P&gt;&lt;P&gt;-	Enter the data element name and click the &amp;#145;Continue&amp;#146; pushbutton.&lt;/P&gt;&lt;P&gt;-	Now, you will be able to create the function module associated to the data element&amp;#146;s field exit.&lt;/P&gt;&lt;P&gt;Step 4:  Create Function Module&lt;/P&gt;&lt;P&gt;-	You will automatically be taken to the Function Library (SE37) after entering a data element name and clicking the 	&amp;#145;Continue&amp;#146; pushbutton.&lt;/P&gt;&lt;P&gt;-	In the &amp;#145;Function module&amp;#146; field, a function module name will be defaulted by the system based on the data element 	specified.  This name will have the following convention:&lt;/P&gt;&lt;P&gt;		          FIELD_EXIT_&amp;lt;data element&amp;gt;&lt;/P&gt;&lt;P&gt;-	You can add an identifier (an underscore followed by a single character ).&lt;/P&gt;&lt;P&gt;-	The first function module for a data element&amp;#146;s field exit must be created without an identifier.&lt;/P&gt;&lt;P&gt;-	To create the function module, click on the &amp;#145;Create&amp;#146; pushbutton, choose menu path Function module -&amp;gt; Create, or 	press &amp;#145;F5&amp;#146;. &lt;/P&gt;&lt;P&gt;-	After choosing to create the function module, you will get the warning:  "Function module name is reserved for 	SAP".  This message is just a warning so a developer does not accidentally create a function module in the field 	exit name range.  By pressing &amp;#145;Enter&amp;#146;, you will be able to go ahead and create the function module.&lt;/P&gt;&lt;P&gt;-	Before coding the function module, you will have to specify the function modules attributes  --  function group, 	application, and short text.&lt;/P&gt;&lt;P&gt;Step 5:  Code Function Module&lt;/P&gt;&lt;P&gt;-	From the function module&amp;#146;s attributes screen, click on the &amp;#145;Source code&amp;#146; pushbutton or choose the Goto -&amp;gt; 		Function module menu path to the code of the function module.&lt;/P&gt;&lt;P&gt;-	Here you will add your desired functionality for the field exit.&lt;/P&gt;&lt;P&gt;-	Remember that field exit&amp;#146;s function module will have two parameters -- one importing parameter called "INPUT" 	and one exporting parameter called "OUTPUT".  These parameters will be set up automatically by the system.&lt;/P&gt;&lt;P&gt;-	You must remember to assign a value to the OUTPUT field.  Even if the value does not change, it must be moved 	from the INPUT field to the OUTPUT field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 6:  Activate Function Module&lt;/P&gt;&lt;P&gt;-	After coding the function module, you must remember to activate it.&lt;/P&gt;&lt;P&gt;-	Use the Function module -&amp;gt; Activate menu path to activate the function module.&lt;/P&gt;&lt;P&gt;-	At this point, you can return to the field exit transaction.&lt;/P&gt;&lt;P&gt;-	You should be able to 'green arrow' back to this transaction.&lt;/P&gt;&lt;P&gt;-	When you return to the field exit transaction, you will see an entry for the newly created field exit.&lt;/P&gt;&lt;P&gt;-	At this point, the field exit is global.  That is, it applies to all screens that use a particular data element.  On any 	screen that uses the data element, the corresponding field exit function module will be triggered, once it is active.&lt;/P&gt;&lt;P&gt;-	Also, the field exit will not be triggered yet because it is inactive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 7:  Assign Program/Screen&lt;/P&gt;&lt;P&gt;-	This step is only needed if you want to make a field exit local.&lt;/P&gt;&lt;P&gt;-	To make a field exit local, select the field exit and click on the &amp;#145;Assign prog./screen&amp;#146; pushbutton.&lt;/P&gt;&lt;P&gt;-	In the dialog box , indicate the appropriate program name and screen number.&lt;/P&gt;&lt;P&gt;	This information indicates that the field exit is local to the specified screen in the specified program.&lt;/P&gt;&lt;P&gt;-	In the dialog box, you determine which function module gets executed for the field exit by specifying the identifier 	in the &amp;#145;Fld. Exit&amp;#146; field.&lt;/P&gt;&lt;P&gt;-	If this field is left blank, the function module triggered will be 'FIELD_EXIT_&amp;lt;data element&amp;gt;'.&lt;/P&gt;&lt;P&gt;-	If a single-character identifier is entered into the field, the function module triggered will be 'FIELD_EXIT_&amp;lt;data 	element&amp;gt;_&amp;lt;identifier&amp;gt;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 8:  Activate Field Exit&lt;/P&gt;&lt;P&gt;-	The field exit must be active for it to be triggered by the system.&lt;/P&gt;&lt;P&gt;-	Activate the field exit by choosing the Field exit -&amp;gt; Activate menu path.&lt;/P&gt;&lt;P&gt;-	After assigning the field exit to a change request, its status will change to &amp;#145;Active&amp;#146; and it will be triggered 		automatically on the appropriate screen(s).&lt;/P&gt;&lt;P&gt;NOTE : In order to activate the field exit the profile parameter abap/fieldexit = YES must be set on all application servers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Rajesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Feb 28, 2008 2:21 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 18:09:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exits/m-p/3523320#M847449</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-28T18:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: User exits</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exits/m-p/3523321#M847450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stalin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; pls go through this link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://husnie.wordpress.com/2007/08/04/sap-abab-using-the-user-exit/" target="test_blank"&gt;http://husnie.wordpress.com/2007/08/04/sap-abab-using-the-user-exit/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Viveks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 18:14:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exits/m-p/3523321#M847450</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-28T18:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: User exits</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exits/m-p/3523322#M847451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;USEREXIT&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;Userxits allow us to add our own functionality to SAP standard program without  modifying it&lt;/STRONG&gt; . These are implemented in the form of subroutines and hence are also known as FORM EXITs. The userexits are generally collected in includes and attached to the standard program by the SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;All Userexits start with the word USEREXIT_...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;FORM USEREXIT_..&lt;/P&gt;&lt;P&gt;z..&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The problem lies in finding the correct userexit and how to find it if one exists for the purpose. Once the correct userexit is found the necessary customer code is inserted in the customer include starting with the z..in the form routine.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;e.g. USEREXIT_SAVE_DOCUMENT_PREPARE&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;Certain application like SD still provide this form of enhancement using userexit but this practice is no longer being followed for newer extensions&lt;/P&gt;&lt;P&gt;instead they are using EXITs which come bundeled in enhancement packages . Neverthiless existing USEREXITS will be supported by SAP an all the newer versions of SAP.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;HOW TO FIND USEREXITS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;Userexits can be found in number of ways:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) To find userexits in SD module , goto object navigator(SE80) and select&lt;/P&gt;&lt;P&gt;    development class from the list and enter VMOD in it. All of the userexits in SD are contained in the development class VMOD. Press &lt;/P&gt;&lt;P&gt;enter and you will find all the includes which contain userexits in SD for&lt;/P&gt;&lt;P&gt;different functions like PRICING, ORDER PROCESSING etc. Select the userexit according to the requirement and read the comment inserted in it&lt;/P&gt;&lt;P&gt;and start coding .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Some examples of userexits in SD(SALES &amp;amp; DISTRIBUTION ) are:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1)ADDING OF NEW FIELDS IN PRICING&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; In Pricing in SD the fields on the basis of which pricing is done are derived from the FIELD CATALOG which is a structure KOMG .This structure is used to transfer transaction data to the pricing procedure in SD and is also known as communication structure.This structure KOMG consists of two tables KOMK for Header related fields and KOMP for item related fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   The fields which are not in either of the two tables KOMK and KOMP cannot be used in pricing .Sometimes a need arises when the pricingis to be based on some other criteria which is not present in the form of fields in either of the two tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  This problem can be solved by using USEREXITS which are provided for pricing in SD.&lt;/P&gt;&lt;P&gt;  Pricing takes place both when the SALES ORDER ( Transaction VA01) is created as well as when INVOICING ( Transaction VF01) is done.Hence SAP provides 2 userexits ,one for sales order processing which is&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;USEREXIT_PRICING_PREPARE_TKOMP  or&lt;/P&gt;&lt;P&gt;USEREXIT_PRICING_PREPARE_TKOMK&lt;/P&gt;&lt;P&gt;Depending upon which table (KOMK or KOMP) the new fields were inserted we use either of the above two userexits.These userexits are found in include MV45AFZZ of the standard SAP sales order creation program SAPMV45A.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;In the case of userexit which will be called when invoicing is done ,these&lt;/P&gt;&lt;P&gt;are provided in the include RY60AFZZ which is in the standard SAP&lt;/P&gt;&lt;P&gt;program SAPMV45A. The name of the userexits are same. i.e&lt;/P&gt;&lt;P&gt;USEREXIT_PRICING_PREPARE_TKOMP  or&lt;/P&gt;&lt;P&gt;USEREXIT_PRICING_PREPARE_TKOMK&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;These userexits are used for passing the data from the communication structure to the pricing procedure, for this we have to fill the newely&lt;/P&gt;&lt;P&gt;created field in the communication structure KOMG for this we fill the code in the above userexit using the MOVE statement after the data that&lt;/P&gt;&lt;P&gt;has to be passed is taken from the database table by using the SELECT statement. The actual structure which is visible in these userexits and which is to be filled for that particular field is TKOMP or TKOMK.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Before the coding for these userexits is done ,it is necessary to create a new field in either of the two tables KOMK or KOMP .For this purpose&lt;/P&gt;&lt;P&gt;includes are provided in each of them .&lt;/P&gt;&lt;P&gt; To create the field in header data(KOMK) the include provided is KOMKAZ&lt;/P&gt;&lt;P&gt; and to create the field in item data(KOMP) the include provided is KOMPAZ.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;One possible example for the need of creating new fields can be e.g. Frieght to be based upon transportation zone ,for this no field is available in field catalog and hence it can be created in KOMK and then above userexits can be used to fill the transportation data to it.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;2)The other method of finding userexit is to find the word USEREXIT in the&lt;/P&gt;&lt;P&gt;associated program of the transaction for which we want to determine userexit using SE38. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3)The other method of finding userexits is to find the include in case of SD/MM applications where the userexits are located ,this can be found in the SAP reference IMG generally in the subfolder under SYSTEM MODIFICATION.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Some other examples of userexits in SD are:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;USEREXIT_NUMBER_RANGE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This userexit is used to assign a different internal document number to the&lt;/P&gt;&lt;P&gt;sales order(VA01) when it is created depending on some criteria like a different SALES ORGANIZAION(VKORG) .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;USEREXIT_SAVE_DOCUMENT_PREPARE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; This userexit is used to insert the ABAP code which will be called when&lt;/P&gt;&lt;P&gt;the document (sales order VA01) is just about to be saved.This userexit is used generally for custom checks on different fields , to display some information before the order will be saved or for making changes to certain fields before the sales order will be saved.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Exits &amp;amp; Enhancements&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; There are mainly six types of EXITs in sap which have been collected in the form of enhancement packages and attached to standard code in SAP.&lt;/P&gt;&lt;P&gt;These are different from USEREXIT in the way that they are implemented &lt;/P&gt;&lt;P&gt;in the form of FUNCTIONs while in USEREXITS we use form routines for their implementation. These are also sometimes known as function exits .&lt;/P&gt;&lt;P&gt;   These start from the word EXIT_ followed by the program name and then followed by a three digit number.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;e.g.  EXIT_SAPMV45A_002&lt;/P&gt;&lt;P&gt;  This exit is found in SD in enhancement V45A0002.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TYPES OF EXITS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;1)MENU EXITS&lt;/P&gt;&lt;P&gt;2)FUNCTION EXITS&lt;/P&gt;&lt;P&gt;3)TABLE EXITS&lt;/P&gt;&lt;P&gt;4)SCREEN EXITS&lt;/P&gt;&lt;P&gt;5)KEYWORD EXITS&lt;/P&gt;&lt;P&gt;6)FIELD EXITS&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;We use SAP transactions CMOD and SMOD to manage exits. Before implementing an exit , it is required to create the project by using CMOD&lt;/P&gt;&lt;P&gt;selecting the enhancement e.g. V45A0002 and selecting the component&lt;/P&gt;&lt;P&gt;(one which fulfills our need) i.e the exit which will be implemented in SMOD and after coding has been done the project has to be activated.&lt;/P&gt;&lt;P&gt;  An exit can be coded only once.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FUNCTION EXITS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  These are used to add functionality through ABAP code . These start from the word EXIT_programname_NNN ending in a 3 digit number. No access code is required to implement any tupe of exit including function exits.&lt;/P&gt;&lt;P&gt;   The function exits are called from the standard SAP program in the form&lt;/P&gt;&lt;P&gt;of ABAP statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CALL CUSTOMER-FUNCTION 'NNN'&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;This is in contrast to USEREXITs where PERFORM statement is used to call&lt;/P&gt;&lt;P&gt;the required userexit.&lt;/P&gt;&lt;P&gt; To implement the FUNCTION EXITs first of all the project is created and a suitable enhancement package is selected and from its compnents the function exit to be implemented is selected and on double clicking it the exit code will appear in ABAP EDITOR(se38) where a Z include will be found and the customer code should be entered in this include.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ADDING A DEFAULT SOLD-TO-PARTY in Sales Order Creation&lt;/P&gt;&lt;P&gt;    To show a default sold-to-party in this field when the user creates a sales order (VA01) we can use a function exit .This function exit is located&lt;/P&gt;&lt;P&gt;in enhancement no V45A0002 . Before we can choose the exit we have to &lt;/P&gt;&lt;P&gt;create a project in CMOD after that enter V45A0002 in the enhancement field and click on the components . In the components you will see the&lt;/P&gt;&lt;P&gt;exit EXIT_SAPMV45A_002 . This exit is used for our purpose.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  Double clicking on this exit will takes us to function builder (SE37) . This&lt;/P&gt;&lt;P&gt;function exit has one exporting parameters and two importing parameters, we are interested in exporting parameter which is  E_KUNNR&lt;/P&gt;&lt;P&gt;of type KNA1-KUNNR i.e if we move the desired customer name to this&lt;/P&gt;&lt;P&gt;structure(E_KUNNR) it will be shown in the field as the default value when we create the sales order.&lt;/P&gt;&lt;P&gt; This function also contains a customer include ZXVVA04 . This include&lt;/P&gt;&lt;P&gt;will be used to write our custom code .&lt;/P&gt;&lt;P&gt;  Double clicking on this include and it will prompt us that this include does not exists do you want to create this object ,select yes and the include will be created .In this include we can write our own code that will fill the field E_KUNNR.&lt;/P&gt;&lt;P&gt; e.g. E_KUNNR = 301.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Activate the include and Activate the project. Now when ever the SALES ORDER will be created , sold-to-party field will come up with a predefined&lt;/P&gt;&lt;P&gt;customer . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FIELD EXITS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  The field exits are managed,created,activated through program RSMODPRF. The field exit is associated with a data element existing in ABAP dictionary and hence to the screen field using that data element.&lt;/P&gt;&lt;P&gt;  The format of field exit is :&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; FIELD_EXIT_dataelement_A-Z or 0-9&lt;/P&gt;&lt;P&gt;   If a particular screen and program name is not specified than the field exit will effect all the screens containing that data element.&lt;/P&gt;&lt;P&gt;   The function module associated with field exit shows two parameters&lt;/P&gt;&lt;P&gt;INPUT and OUTPUT.  Input parameter contains the data passed to the field exit when the field exit was invoked by the R/3 , We can write our own code to change the output parameter depending upon our requirements.&lt;/P&gt;&lt;P&gt;    Before the field exit can have any effect the system profile parameter&lt;/P&gt;&lt;P&gt;ABAP/FIELDEXIT in all the application servers should be set to YES&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ABAP/FIELDEXIT = YES.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Feb 2008 02:52:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exits/m-p/3523322#M847451</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-29T02:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: User exits</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exits/m-p/3523323#M847452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also check these links.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;User Exit Examples&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6378ef94-0501-0010-19a5-972687ddc9ef" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6378ef94-0501-0010-19a5-972687ddc9ef&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SD User exits&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/erplo/sd%2buser%2bexits" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/erplo/sd%2buser%2bexits&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="357142"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;HOW TO FIND USER EXITS IS USED IN A TRANSACTION&lt;/STRONG&gt;  &lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="410018"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Feb 2008 02:58:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exits/m-p/3523323#M847452</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-29T02:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: User exits</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exits/m-p/3523324#M847453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;USER EXITS are FORMS and are called by SAP standard programs&lt;/P&gt;&lt;P&gt;using PERFORM.	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CUSTOMER EXITS are FUNCTIONS so they are called using CALL&lt;/P&gt;&lt;P&gt;FUNCTION (or more exactly CALL CUSTOMER FUNCTION).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.Inside the form (user exit) you can read and change almost&lt;/P&gt;&lt;P&gt;any global data from host program.	&lt;/P&gt;&lt;P&gt;Inside a function (customer exit) you can only acces your&lt;/P&gt;&lt;P&gt;import/export/changing/tables parameters.&lt;/P&gt;&lt;P&gt;3.User exits are more flexible because you have more&lt;/P&gt;&lt;P&gt;information to use in your code but on the other hand , it&lt;/P&gt;&lt;P&gt;is very easy to manipulate erroneously global data and lead&lt;/P&gt;&lt;P&gt;the standard program to a dump or even to make database&lt;/P&gt;&lt;P&gt;inconsistent.&lt;/P&gt;&lt;P&gt;Customer exits are more restrictive but you are sure any&lt;/P&gt;&lt;P&gt;change you can make to any parameters will never lead to&lt;/P&gt;&lt;P&gt;inconsistency&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User-exit doesnâ&amp;#128;&amp;#153;t have any classification.	&lt;/P&gt;&lt;P&gt;In customer-exit we have function-module exit , screen exit&lt;/P&gt;&lt;P&gt;, menu exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5.&lt;/P&gt;&lt;P&gt;User exits are Basically designed For SD module.	&lt;/P&gt;&lt;P&gt;Costomer exits Are available for MM,SD,FI,HRâ&amp;#128;¦..Basically&lt;/P&gt;&lt;P&gt;designed for all modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In computer software, a user exit is a place in a software program where a customer can arrange for their own tailor-made program to be called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the R/3 system from SAP, a user exit is contrasted with a customer exit and allows a customer's developer to access program components and data objects within the R/3 system. In R/3, some user exits use Include statements to include customer program enhancements that are called from the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other user exits use tables that are accessed through customization.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Overview&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Extension of SAP functionality&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP makes different possibilities available to extend SAP functionality in the R/3 without modifying the delivered R/3-Standard. Thus these extensions are further present also after a R/3-Release-Wechsel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; User exit&lt;/P&gt;&lt;P&gt;&amp;#149; Field exit&lt;/P&gt;&lt;P&gt;&amp;#149; Text extensions&lt;/P&gt;&lt;P&gt;&amp;#149; Customer exit&lt;/P&gt;&lt;P&gt;&amp;#149; Table extensions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. User exit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User exits are original one in the selling module (SD) developed expandability.&lt;/P&gt;&lt;P&gt;They consist of empty subroutines (FORM) in special Includes, which can be filled by a ABAP Use developer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In special places in the SA P-CODE such subroutine references were inserted by SAP. An extension is thus only possible, where SAP planned it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;They usually offer a rather rudimentary expandability, since purely technically objects in the SAP name area are modified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Field exit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field exits are bypasses of a Dynprofield with data element purchase into a functional module. These will go through when leaving the Dynpros. There are global and local field exits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Global field exits&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are not limited to a Dynpro. If a data element is used on several Dynpros, after activation of the field exit with all this Dynpros to a functional module one branches out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Local one field exit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;work only on a Dynpro limited. There is the possibility of putting on bus to 36 local field exits to a data element.&lt;/P&gt;&lt;P&gt;3. Text extensions&lt;/P&gt;&lt;P&gt;With text extensions it acts around user keywords and user documentation (F1-Hilfe) to data elements. The new keywords can refer to SAP documentation and to user documentation. Thus one has also the possibility of overwriting the keywords delivered by SAP.&lt;/P&gt;&lt;P&gt;With text extensions the changes are global effective for all SAP applications concerned contrary to application extensions after activation.&lt;/P&gt;&lt;P&gt;4. Customer exit&lt;/P&gt;&lt;P&gt;An application function can be extended by application extensions by the customer. Customer exits must be intended by SAP. They consist generally of several components. The interface SAP/Kunde is clearly defined.&lt;/P&gt;&lt;P&gt;With a R/3-Release-Wechsel and/or. Upgrade remain the customer extensions without effort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; Function exit&lt;/P&gt;&lt;P&gt;&amp;#149; Menu exit&lt;/P&gt;&lt;P&gt;&amp;#149; Dynpro exit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A) Function exit&lt;/P&gt;&lt;P&gt;By functional module exits the customer can implement additional logic in an application function.&lt;/P&gt;&lt;P&gt;SAP built such exits in different places into many application functions. Thus are the interfaces are already given, and/or which data handed over.&lt;/P&gt;&lt;P&gt;These functional modules can be filled now by the customer. It can insert also user Dynpros with associated processing logic and GUI surface and put on user text elements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B) Menu exit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Menu exits make it for the customer possible to build and occupy with a function code in an SAP application new menu entries.&lt;/P&gt;&lt;P&gt;SAP determined, where in the program additional function codes are queried and like to it is being reacted, either by a functional module exit or by an already firmly given functionality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C) Dynpro exit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dynpro exits permit the customer to arrange ranges of a dynpros reserved by SAP. Within these ranges large information can be indicated or data be seized. Those for this force fields by the customer on a user Dynpro are arranged.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Details&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is User Exits?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following document is about exits in SAP: -&lt;/P&gt;&lt;P&gt;The R/3 enhancement concept allows you to add your own functionality to SAP&amp;#146;s standard business applications without having to modify the original applications.&lt;/P&gt;&lt;P&gt;SAP creates user exits for specific programs, screens, and menus within standard R/3 applications.&lt;/P&gt;&lt;P&gt;These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Types of Exits&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are several different types of user exits. Each of these exits acts as hooks where you can attach or "hang" your own add-ons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Menu Exits&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Menu exits add items to the pulldown menus in standard SAP applications. You can use these menu items to call up your own screens or to trigger entire add-on applications.&lt;/P&gt;&lt;P&gt;SAP creates menu exits by defining special menu items in the Menu Painter. These special entries have function codes that begin with "+" (a plus sign). You specify the menu item&amp;#146;s text when activating the item in an add-on project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Screen Exits&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Screen exits add fields to screens in R/3 applications. SAP creates screen exits by placing special subscreen areas on a standard R/3 screen and calling a customer subscreen from the standard screen&amp;#146;s flow logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function Module Exits&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function module exits add functions to R/3 applications. Function module exits play a role in both menu and screen exits.&lt;/P&gt;&lt;P&gt;When you add a new menu item to a standard pull down menu, you use a function module exit to define the actions that should take place once your menu is activated.&lt;/P&gt;&lt;P&gt;Function module exits also control the data flow between standard programs and screen exit fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP application developers create function module exits by writing calls to customer functions into the source code of standard R/3 programs.&lt;/P&gt;&lt;P&gt;These calls have the following syntax:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL CUSTOMER-FUNCTION &amp;#145;001&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field Exits&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field exits allow you to create your own programming logic for any data element in the Dictionary. You can use this logic to carry out checks, conversions, or business-related processing for any screen field. Example: The data element BBBNR identifies a company&amp;#146;s international location number. You might want to set up your R/3 System so that all international location numbers are larger than 100.&lt;/P&gt;&lt;P&gt;The field exit concept lets you create a special function module that contains this logic.&lt;/P&gt;&lt;P&gt;You assign the special function module to the data element BBBNR. You then assign the module to any programs and screens in which users can add new international location numbers. When you activate your field exit, the system automatically triggers your special routine whenever a user enters a company location number.&lt;/P&gt;&lt;P&gt;In 4.6c, you can use "RSMODPRF" program to create field exits.&lt;/P&gt;&lt;P&gt;An example of a user exits :-&lt;/P&gt;&lt;P&gt;MODULE user_exit_0001 INPUT&lt;/P&gt;&lt;P&gt;CASE okcode.&lt;/P&gt;&lt;P&gt;WHEN 'BACK OR EXIT'.&lt;/P&gt;&lt;P&gt;CASE sy-dynnr.&lt;/P&gt;&lt;P&gt;WHEN '100'.&lt;/P&gt;&lt;P&gt;SET SCREEN 0.&lt;/P&gt;&lt;P&gt;LEAVE SCREEN.&lt;/P&gt;&lt;P&gt;WHEN '200'.&lt;/P&gt;&lt;P&gt;******************************************************************************&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="4" type="ul"&gt;&lt;P&gt;Note that you can write any code that satisfy your needs. ****&lt;/P&gt;&lt;/LI&gt;&lt;LI level="4" type="ul"&gt;&lt;P&gt;But in this case, this was wrote as a sample code for reference sake. ****&lt;/P&gt;&lt;/LI&gt;&lt;LI level="4" type="ul"&gt;&lt;P&gt;And you can test it. ****&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;******************************************************************************&lt;/P&gt;&lt;P&gt;SET SCREEN 100.&lt;/P&gt;&lt;P&gt;LEAVE SCREEN.&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP User Exits Routine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User exits are routine which SAP allows you to add in additional customized programs process without affecting the standard SAP programs.&lt;/P&gt;&lt;P&gt;SAP user exit are usually declare as a form routine :-&lt;/P&gt;&lt;P&gt;form userexit_xxxxx&lt;/P&gt;&lt;P&gt;........................&lt;/P&gt;&lt;P&gt;endform&lt;/P&gt;&lt;P&gt;In VL01 - Create Delivery Order, standard program SAPMV50A, the standard program did not check for storage location equal to space, and delivery quantity less than one when the user click the save button. Therefore I have to insert the additional checking into the userexit routine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steps:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; Goto transaction VL01 to pick a Sales Order for delivery (you don't have to save the data)&lt;/P&gt;&lt;P&gt;&amp;#149; In the initial screen, click System -&amp;gt; Status -&amp;gt; Double click on Program (Screen)&lt;/P&gt;&lt;P&gt;&amp;#149; In the dialog program SAPMV50A, click Edit -&amp;gt; Search/replace&lt;/P&gt;&lt;P&gt;&amp;#149; Type userexit in the Find field, then click the In program radio button and hit Enter&lt;/P&gt;&lt;P&gt;&amp;#149; A number of userexit routines will be displayed. You'll have to roughly decide which is the correct userexit routine to used.&lt;/P&gt;&lt;P&gt;Another way of determining the list of user exits could be bus executing the Tcode SE80.&lt;/P&gt;&lt;P&gt;For example if U need to search for the user exits for the above mentioned program, execute the Tcode SE80 and enter the above program name,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The highlighted row denotes a user exit, which is used in this program&lt;/P&gt;&lt;P&gt;form userexit_save_document_prepare.&lt;/P&gt;&lt;P&gt;case xlips-pstyv.&lt;/P&gt;&lt;P&gt;when 'TAX' or 'REX'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Accept this two Delivery item category&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;when 'REN'.&lt;/P&gt;&lt;P&gt;if xlips-lgort = space.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Reject this Delivery item category&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;message e001.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;when others.&lt;/P&gt;&lt;P&gt;if xlips-matnr &amp;lt;&amp;gt; space.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check storage location not space&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if xlips-lgort = space.&lt;/P&gt;&lt;P&gt;message e002.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check delivery quantity not zero&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if xlips-pikmg &amp;lt; 1.&lt;/P&gt;&lt;P&gt;message e003.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finding the user-exits of a SAP transaction code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Finding the user-exits of a SAP transaction code&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Enter the transaction code in which you are looking for the user-exit&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;and it will list you the list of user-exits in the transaction code.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Also a drill down is possible which will help you to branch to SMOD.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Report zuserexit no standard page heading.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.&lt;/P&gt;&lt;P&gt;tables : tstct.&lt;/P&gt;&lt;P&gt;data : jtab like tadir occurs 0 with header line.&lt;/P&gt;&lt;P&gt;data : field1(30).&lt;/P&gt;&lt;P&gt;data : v_devclass like tadir-devclass.&lt;/P&gt;&lt;P&gt;parameters : p_tcode like tstc-tcode obligatory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single * from tstc where tcode eq p_tcode.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;select single * from tadir where pgmid = 'R3TR'&lt;/P&gt;&lt;P&gt;and object = 'PROG'&lt;/P&gt;&lt;P&gt;and obj_name = tstc-pgmna.&lt;/P&gt;&lt;P&gt;move : tadir-devclass to v_devclass.&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;select single * from trdir where name = tstc-pgmna.&lt;/P&gt;&lt;P&gt;if trdir-subc eq 'F'.&lt;/P&gt;&lt;P&gt;select single * from tfdir where pname = tstc-pgmna.&lt;/P&gt;&lt;P&gt;select single * from enlfdir where funcname =&lt;/P&gt;&lt;P&gt;tfdir-funcname.&lt;/P&gt;&lt;P&gt;select single * from tadir where pgmid = 'R3TR'&lt;/P&gt;&lt;P&gt;and object = 'FUGR'&lt;/P&gt;&lt;P&gt;and obj_name eq enlfdir-area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move : tadir-devclass to v_devclass.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;select * from tadir into table jtab&lt;/P&gt;&lt;P&gt;where pgmid = 'R3TR'&lt;/P&gt;&lt;P&gt;and object = 'SMOD'&lt;/P&gt;&lt;P&gt;and devclass = v_devclass.&lt;/P&gt;&lt;P&gt;select single * from tstct where sprsl eq sy-langu and&lt;/P&gt;&lt;P&gt;tcode eq p_tcode.&lt;/P&gt;&lt;P&gt;format color col_positive intensified off.&lt;/P&gt;&lt;P&gt;write:/(19) 'Transaction Code - ',&lt;/P&gt;&lt;P&gt;20(20) p_tcode,&lt;/P&gt;&lt;P&gt;45(50) tstct-ttext.&lt;/P&gt;&lt;P&gt;skip.&lt;/P&gt;&lt;P&gt;if not jtab[] is initial.&lt;/P&gt;&lt;P&gt;write:/(95) sy-uline.&lt;/P&gt;&lt;P&gt;format color col_heading intensified on.&lt;/P&gt;&lt;P&gt;write:/1 sy-vline,&lt;/P&gt;&lt;P&gt;2 'Exit Name',&lt;/P&gt;&lt;P&gt;21 sy-vline ,&lt;/P&gt;&lt;P&gt;22 'Description',&lt;/P&gt;&lt;P&gt;95 sy-vline.&lt;/P&gt;&lt;P&gt;write:/(95) sy-uline.&lt;/P&gt;&lt;P&gt;loop at jtab.&lt;/P&gt;&lt;P&gt;select single * from modsapt&lt;/P&gt;&lt;P&gt;where sprsl = sy-langu and&lt;/P&gt;&lt;P&gt;name = jtab-obj_name.&lt;/P&gt;&lt;P&gt;format color col_normal intensified off.&lt;/P&gt;&lt;P&gt;write:/1 sy-vline,&lt;/P&gt;&lt;P&gt;2 jtab-obj_name hotspot on,&lt;/P&gt;&lt;P&gt;21 sy-vline ,&lt;/P&gt;&lt;P&gt;22 modsapt-modtext,&lt;/P&gt;&lt;P&gt;95 sy-vline.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;write:/(95) sy-uline.&lt;/P&gt;&lt;P&gt;describe table jtab.&lt;/P&gt;&lt;P&gt;skip.&lt;/P&gt;&lt;P&gt;format color col_total intensified on.&lt;/P&gt;&lt;P&gt;write:/ 'No of Exits:' , sy-tfill.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;format color col_negative intensified on.&lt;/P&gt;&lt;P&gt;write:/(95) 'No User Exit exists'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;format color col_negative intensified on.&lt;/P&gt;&lt;P&gt;write:/(95) 'Transaction Code Does Not Exist'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at line-selection.&lt;/P&gt;&lt;P&gt;get cursor field field1.&lt;/P&gt;&lt;P&gt;check field1(4) eq 'JTAB'.&lt;/P&gt;&lt;P&gt;set parameter id 'MON' field sy-lisel+1(10).&lt;/P&gt;&lt;P&gt;call transaction 'SMOD' and skip first screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*---End of Program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Validation Rules &amp;amp; Substitution User exits&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax:&lt;/P&gt;&lt;P&gt;=Uzzzz (zzzz = up to 4 characters - this is true for Document Level validations - call point 3 - *Header Level &amp;amp; Line Item Level - call points 1 &amp;amp; 2 - allow up to 30 charaters.)&lt;/P&gt;&lt;P&gt;/NORFB-&amp;gt;Bus.transactions-&amp;gt;Base parameters-&amp;gt;Validation&lt;/P&gt;&lt;P&gt;/NORFB-&amp;gt;Bus.transactions-&amp;gt;Base parameters-&amp;gt;Substitution&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;=ULTE "FI_DOCU 001 "Parked SA,FY,SI=&amp;gt;long text CORRESP. "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=U&amp;amp;VALID_WBS_IN_ZUONR "FI_ITEM 011 Spon.Res: Check WBS valid in ZUONR"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;changed in 4.5B (* Form UFIA -- formerly U&amp;amp;VALID_WBS_IN_ZUONR)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;User exits are form routines that the user programs. There are two types of&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;user-exits:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Validation exits are used in the prerequisites and checks. They have either the value 'T' for true or 'F' for false. They are interpreted as a part of the logical statement, like a constant or field comparison. For this type of user exit, you must fill a parameter with the results of your check ('T' for true; 'F' for false).&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;FORM Uzzzz USING B_RESULT. "'T' or 'F'&lt;/P&gt;&lt;P&gt;from program ZGGBR000 (ZGGBRI03)&lt;/P&gt;&lt;P&gt;2. Substitution exits are used to change one or more fields. However, you can only change those fields that are permitted in the Boolean class for the substitution. You can display these fields by selecting the following menu options in substitution maintenance: Fields for substitutions&amp;gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;FORM Uzzzz USING COST_CENTER.&lt;/P&gt;&lt;P&gt;from program ZGGBS000 (ZGGBSI02)&lt;/P&gt;&lt;P&gt;Substitution Fields can be found from this window&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/NORFB-&amp;gt;Bus.transactions-&amp;gt;Base parameters-&amp;gt;Substitution-&amp;gt;Call Pnt 2-&amp;gt;Substitution step 3-&amp;gt;Extras-&amp;gt;Substitution flds&lt;/P&gt;&lt;P&gt;The name of the form pool (e.g., ZGGBR000 &amp;amp; ZGGBS000) that contains your user exit must be stored in table T80D.&lt;/P&gt;&lt;P&gt;Note&lt;/P&gt;&lt;P&gt;1. Data declaration&lt;/P&gt;&lt;P&gt;Tables and field stings cannot be declared in form routines, so that the contents can be used along with the calling transaction.&lt;/P&gt;&lt;P&gt;2. Parameter definition&lt;/P&gt;&lt;P&gt;It is important that you make declare the code generation program for your user exit; how many and what type of parameters you are using for the user exit. You do this by entering your newly defined user exits in the form routine GET_EXIT_TITLES.&lt;/P&gt;&lt;P&gt;found in program ZGGBR000 (ZGGBRTIT)&lt;/P&gt;&lt;P&gt;found in program ZGGBS000 (ZGGBSTIT)&lt;/P&gt;&lt;P&gt;One exception is the parameter for the results of a validation exit. You must not declare this, it is automatically generated be the system. What types of parameters are available and how you use them is described in the online documentation. When creating your user exits, you can use the example form pools delivered by SAP (RGGBR000 for validations; RGBBS000 for substitutions) as a reference. We recommend that you copy the example form pools delivered by SAP when creating your own user exits. In these example form pools, entries already exist in the form routine GET_EXIT_TITLES for the examples delivered. The GET_EXIT_TITLES must absolutely exist in your form pool.&lt;/P&gt;&lt;P&gt;You can find additional information on the creation of user exits in the online documentation on validations and substitutions.&lt;/P&gt;&lt;P&gt;SAP exits&lt;/P&gt;&lt;P&gt;SAP exits are form rountines programmed by SAP. The name of the form pool is SAPFGBEB.&lt;/P&gt;&lt;P&gt;Syntax:&lt;/P&gt;&lt;P&gt;=Szzzz (zzzz = up to four characters)&lt;/P&gt;&lt;P&gt;FORM Szzzz using B_result. "'T' or 'F'&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;=S01 "SAP exit S01"&lt;/P&gt;&lt;P&gt;Display description of T80D configuration&lt;/P&gt;&lt;P&gt;Return -&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Feb 2008 03:26:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exits/m-p/3523324#M847453</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-29T03:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: User exits</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exits/m-p/3523325#M847454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;Difference Between BADI and User Exits &lt;/P&gt;&lt;P&gt;Business Add-Ins are a new SAP enhancement technique based on ABAP Objects. They can be inserted into the SAP System to accommodate user requirements too specific to be included in the standard delivery. Since specific industries often require special functions, SAP allows you to predefine these points in your software.  &lt;/P&gt;&lt;P&gt;As with customer exits two different views are available: &lt;/P&gt;&lt;P&gt;In the definition view, an application programmer predefines exit points in a source that allow specific industry sectors, partners, and customers to attach additional software to standard SAP source code without having to modify the original object.  &lt;/P&gt;&lt;P&gt;In the implementation view, the users of Business Add-Ins can customize the logic they need or use a standard logic if one is available. &lt;/P&gt;&lt;P&gt;In contrast to customer exits, Business Add-Ins no longer assume a two-level infrastructure (SAP and customer solutions), but instead allow for a multi-level system landscape (SAP, partner, and customer solutions, as well as country versions, industry solutions, and the like). Definitions and implementations of Business Add-Ins can be created at each level within such a system infrastructure. &lt;/P&gt;&lt;P&gt;SAP guarantees the upward compatibility of all Business Add-In interfaces. Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces. You do not have to register Business Add-Ins in SSCR. &lt;/P&gt;&lt;P&gt;The Business Add-In enhancement technique differentiates between enhancements that can only be implemented once and enhancements that can be used actively by any number of customers at the same time. In addition, Business Add-Ins can be defined according to filter values. This allows you to control add-in implementation and make it dependent on specific criteria (on a specific Country value, for example). &lt;/P&gt;&lt;P&gt;All ABAP sources, screens, GUIs, and table interfaces created using this enhancement technique are defined in a manner that allows customers to include their own enhancements in the standard. A single Business Add-In contains all of the interfaces necessary to implement a specific task. &lt;/P&gt;&lt;P&gt;The actual program code is enhanced using ABAP Objects. In order to better understand the programming techniques behind the Business Add-In enhancement concept, SAP recommends reading the section on ABAP Objects. &lt;/P&gt;&lt;P&gt;What is difference between badi and user-exists? &lt;/P&gt;&lt;P&gt;What is difference between enhancements and user-exists? and what is the full form of BADI? &lt;/P&gt;&lt;P&gt;I have another doubt in BDC IN BDC WE HAVE MSEGCALL (i did not remember the &amp;gt; correct name) where the error logs are stored, MSEGCALL is a table or structure. &lt;/P&gt;&lt;P&gt;What is the system landscape? &lt;/P&gt;&lt;P&gt;1) Difference between BADI and USER-EXIT. &lt;/P&gt;&lt;P&gt;    i) BADI's can be used any number of times, where as USER-EXITS can be used only one time. &lt;/P&gt;&lt;P&gt;       Ex:- if your assigning a USER-EXIT to a project in (CMOD), then you can not assign the same to other project. &lt;/P&gt;&lt;P&gt;    ii) BADI's are oops based. &lt;/P&gt;&lt;P&gt;2) About 'BDCMSGCOLL' it is a structure.  Used for finding error records. &lt;/P&gt;&lt;P&gt;3) Full form of BADI 'Business addins'. &lt;/P&gt;&lt;P&gt;3) System land scape will be depends on your project  &lt;/P&gt;&lt;P&gt;    Ex:- 'Development server'&lt;DEL&gt;&amp;gt;'Quality server'&lt;/DEL&gt;-&amp;gt; 'Production server'......  &lt;/P&gt;&lt;P&gt;Business Add-Ins&lt;/P&gt;&lt;P&gt;Business add-ins are enhancements to the standard version of the system. They can be inserted into the SAP System to accommodate user requirements too specific to be included in the standard delivery. Since specific industries often require special functions, SAP allows you to predefine these points in your software.&lt;/P&gt;&lt;P&gt;As with  customer exits, two different views are available:&lt;/P&gt;&lt;P&gt;&amp;#149;         In the definition view, an application programmer defines exit points in a source that allow specific industry sectors, partners, and customers to attach additional coding to standard SAP source code, without having to modify the original object. &lt;/P&gt;&lt;P&gt;&amp;#149;         In the implementation view, the users of Business Add-Ins can customize the logic they need or use a standard solution, if one is available.&lt;/P&gt;&lt;P&gt;In contrast to customer exits, Business Add-Ins no longer assume a two-level infrastructure (SAP and customer solutions), but instead allow for a multi-level system landscape (SAP, country-specific versions, industry solutions, partner, customer, and so on). You can create definitions and implementations of Business Add-Ins at any level of the system landscape.&lt;/P&gt;&lt;P&gt;SAP guarantees the upward compatibility of all Business Add-In interfaces. Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces. You do not have to register Business Add-Ins in SSCR.&lt;/P&gt;&lt;P&gt;The Business Add-In enhancement technique differentiates between enhancements that can only be implemented once and enhancements that can be used actively by any number of customers at the same time. In addition, Business Add-Ins can be defined according to filter values. This allows you to differentiate between Add-In implementations using the filter Country or other criteria.&lt;/P&gt;&lt;P&gt;The enhancement technique is set up in such a way that it is possible to define interfaces for ABAP soure code, screens, GUI interfaces, and tables. These allow customers to include their own enhancements in the standard. A single Business Add-In contains all of the interfaces necessary to implement a specific task. &lt;/P&gt;&lt;P&gt;The actual program code is enhanced using ABAP Objects. In order to better understand the enhancement technique behind the Business Add, we recommend reading the section  ABAP Objects.&lt;/P&gt;&lt;P&gt;User exits : &lt;/P&gt;&lt;P&gt;1. Introduction &lt;/P&gt;&lt;P&gt;2. How to find user exits &lt;/P&gt;&lt;P&gt;3. Using Project management of SAP Enhancements  &lt;/P&gt;&lt;P&gt;1. Introduction: &lt;/P&gt;&lt;P&gt;User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a functionmodule. The code for the function module is writeen by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module. &lt;/P&gt;&lt;P&gt;The naming standard of function modules for functionmodule exits is:  &lt;/P&gt;&lt;P&gt;EXIT_&amp;lt;program name&amp;gt;&amp;lt;3 digit suffix&amp;gt;  &lt;/P&gt;&lt;P&gt;The call to a functionmodule exit is implemented as: &lt;/P&gt;&lt;P&gt;CALL CUSTOMER.-FUNCTION &lt;span class="lia-unicode-emoji" title=":red_heart:"&gt;❤️&lt;/span&gt; digit suffix&amp;gt; &lt;/P&gt;&lt;P&gt;Example: &lt;/P&gt;&lt;P&gt;The program for transaction VA01 Create salesorder is SAPMV45A &lt;/P&gt;&lt;P&gt;If you search for CALL CUSTOMER-FUNCTION i program &lt;/P&gt;&lt;P&gt;SAPMV45A you will find ( Among other user exits): &lt;/P&gt;&lt;P&gt;CALL CUSTOMER-FUNCTION '003' &lt;/P&gt;&lt;P&gt;  exporting &lt;/P&gt;&lt;P&gt;    xvbak   = vbak &lt;/P&gt;&lt;P&gt;    xvbuk   = vbuk &lt;/P&gt;&lt;P&gt;    xkomk   = tkomk &lt;/P&gt;&lt;P&gt;  importing &lt;/P&gt;&lt;P&gt;    lvf_subrc = lvf_subrc &lt;/P&gt;&lt;P&gt;  tables &lt;/P&gt;&lt;P&gt;    xvbfa = xvbfa &lt;/P&gt;&lt;P&gt;    xvbap = xvbap &lt;/P&gt;&lt;P&gt;    xvbup = xvbup. &lt;/P&gt;&lt;P&gt;The exit calls function module EXIT_SAPMV45A_003 &lt;/P&gt;&lt;P&gt;2. How to find user exits? &lt;/P&gt;&lt;P&gt;Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT &lt;/P&gt;&lt;P&gt;If you know the Exit name, go to transaction CMOD. &lt;/P&gt;&lt;P&gt;Choose menu Utillities-&amp;gt;SAP Enhancements. Enter the exit name and press enter. &lt;/P&gt;&lt;P&gt;You will now come to a screen that shows the function module exits for the exit. &lt;/P&gt;&lt;P&gt;3. Using Project management of SAP Enhancements, we want to create a project to enahance trasnaction VA01 . &lt;/P&gt;&lt;P&gt;- Go to transaction CMOD &lt;/P&gt;&lt;P&gt;- Create a project called ZVA01 &lt;/P&gt;&lt;P&gt;- Choose the Enhancement assign radio button and press the Change button &lt;/P&gt;&lt;P&gt;In the first column enter V45A0002 Predefine sold-to party in sales document.  &lt;/P&gt;&lt;P&gt;Note that an enhancement can only be used in 1 project. If the enhancement is already in use, and error message will be displayed &lt;/P&gt;&lt;P&gt;Press Save &lt;/P&gt;&lt;P&gt;Press Components. You can now see that enhancement uses user exit EXIT_SAPMV45A_002. Double click on the exit. &lt;/P&gt;&lt;P&gt;Now the function module is displayed. Double click on include ZXVVAU04 in the function module &lt;/P&gt;&lt;P&gt;Insert the following code into the include: E_KUNNR = '2155'. &lt;/P&gt;&lt;P&gt;Activate the include program. Go back to CMOD and activate the project.  &lt;/P&gt;&lt;P&gt;Goto transaction VA01 and craete a salesorder.  &lt;/P&gt;&lt;P&gt;Note that Sold-to-party now automatically is "2155" &lt;/P&gt;&lt;P&gt;What is User Exits and Customer Exits? &lt;/P&gt;&lt;P&gt;Difference between user exits &amp;amp; customer exits: &lt;/P&gt;&lt;P&gt;User exit - A user exit is a three character code that instructs the system to access a program during system processing. &lt;/P&gt;&lt;P&gt;SXX: S is for standard exits that are delivered by SAP.   XX represents the 2-digit exit number. &lt;/P&gt;&lt;P&gt;UXX: U is for user exits that are defined by the user.  XX represents the 2-digit exit number &lt;/P&gt;&lt;P&gt;Customer exit - The R/3 enhancement concept allows you to add your own functionality to SAP&amp;#146;s standard business applications without having to modify the original applications. SAP creates customer exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks.     *-- Mani &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;The following document is about exits in SAP :- &lt;/P&gt;&lt;P&gt;The R/3 enhancement concept allows you to add your own functionality to SAP&amp;#146;s standard business applications without having to modify the original applications.  &lt;/P&gt;&lt;P&gt;SAP creates user exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks. &lt;/P&gt;&lt;P&gt;Types of Exits  &lt;/P&gt;&lt;P&gt;There are several different types of user exits. Each of these exits acts as hooks where you can attach or "hang" your own add-ons. &lt;/P&gt;&lt;P&gt;Menu Exits &lt;/P&gt;&lt;P&gt;Menu exits add items to the pulldown menus in standard SAP applications. You can use these menu items to call up your own screens or to trigger entire add-on applications. &lt;/P&gt;&lt;P&gt;SAP creates menu exits by defining special menu items in the Menu Painter. These special entries have function codes that begin with "+" (a plus sign). You specify the Screen Exits &lt;/P&gt;&lt;P&gt;Screen exits add fields to screens in R/3 applications. SAP creates screen exits by placing special subscreen areas on a standard R/3 screen and calling a customer subscreen from the standard screen&amp;#146;s flow logic. &lt;/P&gt;&lt;P&gt;Function Module Exits  &lt;/P&gt;&lt;P&gt;Function module exits add functions to R/3 applications. Function module exits play a role in both menu and screen exits.  &lt;/P&gt;&lt;P&gt;When you add a new menu item to a standard pull down menu, you use a function module exit to define the actions that should take place once your menu is activated.  &lt;/P&gt;&lt;P&gt;Function module exits also control the data flow between standard programs and screen exit fields. SAP application developers create function module exits by writing calls to customer functions into the source code of standard R/3 programs.  &lt;/P&gt;&lt;P&gt;These calls have the following syntax:  &lt;/P&gt;&lt;P&gt;CALL CUSTOMER-FUNCTION &amp;#145;001&amp;#146;. &lt;/P&gt;&lt;P&gt;Field Exits &lt;/P&gt;&lt;P&gt;Field exits allow you to create your own programming logic for any data element in the Dictionary. You can use this logic to carry out checks, conversions, or business-related processing for any screen field.  Example: The data element BBBNR identifies a company&amp;#146;s international location number. You might want to set up your R/3 System so that all international location numbers are larger than 100.  &lt;/P&gt;&lt;P&gt;The field exit concept lets you create a special function module that contains this logic.  &lt;/P&gt;&lt;P&gt;You assign the special function module to the data element BBBNR. You then assign the module to any programs and screens in which users can add new international location numbers. When you activate your field exit, the system automatically triggers your special routine whenever a user enters a company location number.  &lt;/P&gt;&lt;P&gt;In 4.6c, you can use "RSMODPRF" program to create field exits. &lt;/P&gt;&lt;P&gt;An example of a user exits :- &lt;/P&gt;&lt;P&gt;MODULE user_exit_0001 INPUT  &lt;/P&gt;&lt;P&gt;    CASE okcode. &lt;/P&gt;&lt;P&gt;        WHEN 'BACK OR EXIT'. &lt;/P&gt;&lt;P&gt;            CASE sy-dynnr. &lt;/P&gt;&lt;P&gt;                    WHEN '100'. &lt;/P&gt;&lt;P&gt;                         SET SCREEN 0. &lt;/P&gt;&lt;P&gt;                         LEAVE SCREEN. &lt;/P&gt;&lt;P&gt;                    WHEN '200'. &lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="78" type="ul"&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;LI level="4" type="ul"&gt;&lt;P&gt;Note that you can write any code that satisfy your needs.                                                     **** &lt;/P&gt;&lt;/LI&gt;&lt;LI level="4" type="ul"&gt;&lt;P&gt;But in this case, this was wrote as a sample code for reference sake.                                    **** &lt;/P&gt;&lt;/LI&gt;&lt;LI level="4" type="ul"&gt;&lt;P&gt;And you can test it.                                                                                **** &lt;/P&gt;&lt;/LI&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="78" type="ul"&gt;&lt;P&gt; &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;                         SET SCREEN 100. &lt;/P&gt;&lt;P&gt;                         LEAVE SCREEN. &lt;/P&gt;&lt;P&gt;             ENDCASE. &lt;/P&gt;&lt;P&gt;      ENDCASE.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Finding the user-exits of a SAP transaction code&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Enter the transaction code in which you are looking for the user-exit&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;and it will list you the list of user-exits in the transaction code.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Also a drill down is possible which will help you to branch to SMOD.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Written by : SAP Basis, ABAP Programming and Other IMG Stuff&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             &lt;A href="http://www.sap-img.com" target="test_blank"&gt;http://www.sap-img.com&lt;/A&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report zuserexit no standard page heading.&lt;/P&gt;&lt;P&gt;tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.&lt;/P&gt;&lt;P&gt;         tables : tstct.&lt;/P&gt;&lt;P&gt;data : jtab like tadir occurs 0 with header line.&lt;/P&gt;&lt;P&gt;data : field1(30).&lt;/P&gt;&lt;P&gt;data : v_devclass like tadir-devclass.&lt;/P&gt;&lt;P&gt;parameters : p_tcode like tstc-tcode obligatory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single * from tstc where tcode eq p_tcode.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;   select single * from tadir where pgmid = 'R3TR'&lt;/P&gt;&lt;P&gt;                    and object = 'PROG'&lt;/P&gt;&lt;P&gt;                    and obj_name = tstc-pgmna.&lt;/P&gt;&lt;P&gt;   move : tadir-devclass to v_devclass.&lt;/P&gt;&lt;P&gt;      if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;         select single * from trdir where name = tstc-pgmna.&lt;/P&gt;&lt;P&gt;         if trdir-subc eq 'F'.&lt;/P&gt;&lt;P&gt;            select single * from tfdir where pname = tstc-pgmna.&lt;/P&gt;&lt;P&gt;            select single * from enlfdir where funcname =&lt;/P&gt;&lt;P&gt;            tfdir-funcname.&lt;/P&gt;&lt;P&gt;            select single * from tadir where pgmid = 'R3TR'&lt;/P&gt;&lt;P&gt;                               and object = 'FUGR'&lt;/P&gt;&lt;P&gt;                               and obj_name eq enlfdir-area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            move : tadir-devclass to v_devclass.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;       endif.&lt;/P&gt;&lt;P&gt;       select * from tadir into table jtab&lt;/P&gt;&lt;P&gt;                     where pgmid = 'R3TR'&lt;/P&gt;&lt;P&gt;                       and object = 'SMOD'&lt;/P&gt;&lt;P&gt;                       and devclass = v_devclass.&lt;/P&gt;&lt;P&gt;        select single * from tstct where sprsl eq sy-langu and&lt;/P&gt;&lt;P&gt;                                         tcode eq p_tcode.&lt;/P&gt;&lt;P&gt;        format color col_positive intensified off.&lt;/P&gt;&lt;P&gt;        write:/(19) 'Transaction Code - ',&lt;/P&gt;&lt;P&gt;             20(20) p_tcode,&lt;/P&gt;&lt;P&gt;             45(50) tstct-ttext.&lt;/P&gt;&lt;P&gt;                    skip.&lt;/P&gt;&lt;P&gt;        if not jtab[] is initial.&lt;/P&gt;&lt;P&gt;           write:/(95) sy-uline.&lt;/P&gt;&lt;P&gt;           format color col_heading intensified on.&lt;/P&gt;&lt;P&gt;           write:/1 sy-vline,&lt;/P&gt;&lt;P&gt;                  2 'Exit Name',&lt;/P&gt;&lt;P&gt;                 21 sy-vline ,&lt;/P&gt;&lt;P&gt;                 22 'Description',&lt;/P&gt;&lt;P&gt;                 95 sy-vline.&lt;/P&gt;&lt;P&gt;           write:/(95) sy-uline.&lt;/P&gt;&lt;P&gt;           loop at jtab.&lt;/P&gt;&lt;P&gt;              select single * from modsapt&lt;/P&gt;&lt;P&gt;                     where sprsl = sy-langu and&lt;/P&gt;&lt;P&gt;                            name = jtab-obj_name.&lt;/P&gt;&lt;P&gt;                   format color col_normal intensified off.&lt;/P&gt;&lt;P&gt;                   write:/1 sy-vline,&lt;/P&gt;&lt;P&gt;                          2 jtab-obj_name hotspot on,&lt;/P&gt;&lt;P&gt;                         21 sy-vline ,&lt;/P&gt;&lt;P&gt;                         22 modsapt-modtext,&lt;/P&gt;&lt;P&gt;                         95 sy-vline.&lt;/P&gt;&lt;P&gt;           endloop.&lt;/P&gt;&lt;P&gt;           write:/(95) sy-uline.&lt;/P&gt;&lt;P&gt;           describe table jtab.&lt;/P&gt;&lt;P&gt;           skip.&lt;/P&gt;&lt;P&gt;           format color col_total intensified on.&lt;/P&gt;&lt;P&gt;           write:/ 'No of Exits:' , sy-tfill.&lt;/P&gt;&lt;P&gt;        else.&lt;/P&gt;&lt;P&gt;           format color col_negative intensified on.&lt;/P&gt;&lt;P&gt;           write:/(95) 'No User Exit exists'.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;P&gt;          format color col_negative intensified on.&lt;/P&gt;&lt;P&gt;          write:/(95) 'Transaction Code Does Not Exist'.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at line-selection.&lt;/P&gt;&lt;P&gt;   get cursor field field1.&lt;/P&gt;&lt;P&gt;   check field1(4) eq 'JTAB'.&lt;/P&gt;&lt;P&gt;   set parameter id 'MON' field sy-lisel+1(10).&lt;/P&gt;&lt;P&gt;   call transaction 'SMOD' and skip first   screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*---End of Program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPERT RESPONSE&lt;/P&gt;&lt;P&gt;There are three kind of user exits. You can search for them by looking for: &lt;/P&gt;&lt;P&gt;-	The string "userexit"&lt;/P&gt;&lt;P&gt;- Customer-function (in case of CMOD/SMOD)&lt;/P&gt;&lt;P&gt;- exithandler (in case of a BAdI, see SE18/SE19)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USEREXIT&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  Userxits allow us to add our own functionality to SAP standard program&lt;/P&gt;&lt;P&gt;without  modifying it . These are implemented in the form of subroutines and hence are also known as FORM EXITs. The userexits are generally collected in includes and attached to the standard program by the SAP.&lt;/P&gt;&lt;P&gt;    All Userexits start with the word USEREXIT_...&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;FORM USEREXIT_..&lt;/P&gt;&lt;P&gt;z..&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The problem lies in finding the correct userexit and how to find it if one exists for the purpose. Once the correct userexit is found the necessary&lt;/P&gt;&lt;P&gt;customer code is inserted in the customer include starting with the z..&lt;/P&gt;&lt;P&gt;in the form routine.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;e.g. USEREXIT_SAVE_DOCUMENT_PREPARE&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Certain application like SD still provide this form of enhancement using userexit but this practice is no longer being followed for newer extensions&lt;/P&gt;&lt;P&gt;instead they are using EXITs which come bundeled in enhancement packages . Neverthiless existing USEREXITS will be supported by SAP an all the newer versions of SAP.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;HOW TO FIND USEREXITS&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  Userexits can be found in number of ways:&lt;/P&gt;&lt;P&gt;1) To find userexits in SD module , goto object navigator(SE80) and select&lt;/P&gt;&lt;P&gt;    development class from the list and enter VMOD in it. All of the userexits in SD are contained in the development class VMOD. Press &lt;/P&gt;&lt;P&gt;enter and you will find all the includes which contain userexits in SD for&lt;/P&gt;&lt;P&gt;different functions like PRICING, ORDER PROCESSING etc. Select the userexit according to the requirement and read the comment inserted in it&lt;/P&gt;&lt;P&gt;and start coding .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Some examples of userexits in SD(SALES &amp;amp; DISTRIBUTION ) are:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;1)ADDING OF NEW FIELDS IN PRICING   &lt;/P&gt;&lt;P&gt; In Pricing in SD the fields on the basis of which pricing is done are derived from the FIELD CATALOG which is a structure KOMG .This structure is used to transfer transaction data to the pricing procedure in SD and is also known as communication structure.This structure KOMG consists of two tables KOMK for Header related fields and KOMP for item related fields. &lt;/P&gt;&lt;P&gt;   The fields which are not in either of the two tables KOMK and KOMP&lt;/P&gt;&lt;P&gt;cannot be used in pricing .Sometimes a need arises when the pricing&lt;/P&gt;&lt;P&gt;is to be based on some other criteria which is not present in the form of fields in either of the two tables.&lt;/P&gt;&lt;P&gt;  This problem can be solved by using USEREXITS which are provided for pricing in SD.&lt;/P&gt;&lt;P&gt;  Pricing takes place both when the SALES ORDER ( Transaction VA01) is created as well as when INVOICING ( Transaction VF01) is done.Hence SAP provides 2 userexits ,one for sales order processing which is&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;USEREXIT_PRICING_PREPARE_TKOMP  or&lt;/P&gt;&lt;P&gt;USEREXIT_PRICING_PREPARE_TKOMK&lt;/P&gt;&lt;P&gt;Depending upon which table (KOMK or KOMP) the new fields were inserted we use either of the above two userexits.These userexits are found in include MV45AFZZ of the standard SAP sales order creation program SAPMV45A.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;In the case of userexit which will be called when invoicing is done ,these&lt;/P&gt;&lt;P&gt;are provided in the include RY60AFZZ which is in the standard SAP&lt;/P&gt;&lt;P&gt;program SAPMV45A. The name of the userexits are same. i.e&lt;/P&gt;&lt;P&gt;USEREXIT_PRICING_PREPARE_TKOMP  or&lt;/P&gt;&lt;P&gt;USEREXIT_PRICING_PREPARE_TKOMK&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;These userexits are used for passing the data from the communication structure to the pricing procedure, for this we have to fill the newely&lt;/P&gt;&lt;P&gt;created field in the communication structure KOMG for this we fill the code in the above userexit using the MOVE statement after the data that&lt;/P&gt;&lt;P&gt;has to be passed is taken from the database table by using the SELECT statement. The actual structure which is visible in these userexits and which is to be filled for that particular field is TKOMP or TKOMK.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Before the coding for these userexits is done ,it is necessary to create a new field in either of the two tables KOMK or KOMP .For this purpose&lt;/P&gt;&lt;P&gt;includes are provided in each of them .&lt;/P&gt;&lt;P&gt; To create the field in header data(KOMK) the include provided is KOMKAZ&lt;/P&gt;&lt;P&gt; and to create the field in item data(KOMP) the include provided is KOMPAZ.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;One possible example for the need of creating new fields can be e.g. Frieght to be based upon transportation zone ,for this no field is available in field catalog and hence it can be created in KOMK and then above userexits can be used to fill the transportation data to it.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;2)The other method of finding userexit is to find the word USEREXIT in the&lt;/P&gt;&lt;P&gt;associated program of the transaction for which we want to determine userexit using SE38. &lt;/P&gt;&lt;P&gt;3)The other method of finding userexits is to find the include in case of SD/MM applications where the userexits are located ,this can be found in the SAP reference IMG generally in the subfolder under SYSTEM MODIFICATION.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Some other examples of userexits in SD are:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;USEREXIT_NUMBER_RANGE&lt;/P&gt;&lt;P&gt;This userexit is used to assign a different internal document number to the&lt;/P&gt;&lt;P&gt;sales order(VA01) when it is created depending on some criteria like a different SALES ORGANIZAION(VKORG) .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;USEREXIT_SAVE_DOCUMENT_PREPARE&lt;/P&gt;&lt;P&gt; This userexit is used to insert the ABAP code which will be called when&lt;/P&gt;&lt;P&gt;the document (sales order VA01) is just about to be saved.This userexit is used generally for custom checks on different fields , to display some information before the order will be saved or for making changes to certain fields before the sales order will be saved.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;Exits &amp;amp; Enhancements&lt;/P&gt;&lt;P&gt; There are mainly six types of EXITs in sap which have been collected in the form of enhancement packages and attached to standard code in SAP.&lt;/P&gt;&lt;P&gt;These are different from USEREXIT in the way that they are implemented &lt;/P&gt;&lt;P&gt;in the form of FUNCTIONs while in USEREXITS we use form routines for their implementation. These are also sometimes known as function exits .&lt;/P&gt;&lt;P&gt;   These start from the word EXIT_ followed by the program name and then followed by a three digit number.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;e.g.  EXIT_SAPMV45A_002&lt;/P&gt;&lt;P&gt;  This exit is found in SD in enhancement V45A0002.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;TYPES OF EXITS&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;1)MENU EXITS&lt;/P&gt;&lt;P&gt;2)FUNCTION EXITS&lt;/P&gt;&lt;P&gt;3)TABLE EXITS&lt;/P&gt;&lt;P&gt;4)SCREEN EXITS&lt;/P&gt;&lt;P&gt;5)KEYWORD EXITS&lt;/P&gt;&lt;P&gt;6)FIELD EXITS&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;We use SAP transactions CMOD and SMOD to manage exits. Before implementing an exit , it is required to create the project by using CMOD&lt;/P&gt;&lt;P&gt;selecting the enhancement e.g. V45A0002 and selecting the component&lt;/P&gt;&lt;P&gt;(one which fulfills our need) i.e the exit which will be implemented in SMOD and after coding has been done the project has to be activated.&lt;/P&gt;&lt;P&gt;  An exit can be coded only once.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;FUNCTION EXITS&lt;/P&gt;&lt;P&gt;  These are used to add functionality through ABAP code . These start from the word EXIT_programname_NNN ending in a 3 digit number. No access code is required to implement any tupe of exit including function exits.&lt;/P&gt;&lt;P&gt;   The function exits are called from the standard SAP program in the form&lt;/P&gt;&lt;P&gt;of ABAP statement &lt;/P&gt;&lt;P&gt;CALL CUSTOMER-FUNCTION 'NNN' &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;This is in contrast to USEREXITs where PERFORM statement is used to call&lt;/P&gt;&lt;P&gt;the required userexit.&lt;/P&gt;&lt;P&gt; To implement the FUNCTION EXITs first of all the project is created and a suitable enhancement package is selected and from its compnents the function exit to be implemented is selected and on double clicking it the exit code will appear in ABAP EDITOR(se38) where a Z include will be found and the customer code should be entered in this include.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ADDING A DEFAULT SOLD-TO-PARTY in Sales Order Creation&lt;/P&gt;&lt;P&gt;    To show a default sold-to-party in this field when the user creates a sales order (VA01) we can use a function exit .This function exit is located&lt;/P&gt;&lt;P&gt;in enhancement no V45A0002 . Before we can choose the exit we have to &lt;/P&gt;&lt;P&gt;create a project in CMOD after that enter V45A0002 in the enhancement field and click on the components . In the components you will see the&lt;/P&gt;&lt;P&gt;exit EXIT_SAPMV45A_002 . This exit is used for our purpose.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  Double clicking on this exit will takes us to function builder (SE37) . This&lt;/P&gt;&lt;P&gt;function exit has one exporting parameters and two importing parameters, we are interested in exporting parameter which is  E_KUNNR&lt;/P&gt;&lt;P&gt;of type KNA1-KUNNR i.e if we move the desired customer name to this&lt;/P&gt;&lt;P&gt;structure(E_KUNNR) it will be shown in the field as the default value when we create the sales order.&lt;/P&gt;&lt;P&gt; This function also contains a customer include ZXVVA04 . This include&lt;/P&gt;&lt;P&gt;will be used to write our custom code .&lt;/P&gt;&lt;P&gt;  Double clicking on this include and it will prompt us that this include does not exists do you want to create this object ,select yes and the include will be created .In this include we can write our own code that will fill the field E_KUNNR.&lt;/P&gt;&lt;P&gt; e.g. E_KUNNR = 301.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Activate the include and Activate the project. Now when ever the SALES ORDER will be created , sold-to-party field will come up with a predefined&lt;/P&gt;&lt;P&gt;customer . &lt;/P&gt;&lt;P&gt;FIELD EXITS&lt;/P&gt;&lt;P&gt;  The field exits are managed,created,activated through program RSMODPRF. The field exit is associated with a data element existing in ABAP dictionary and hence to the screen field using that data element.&lt;/P&gt;&lt;P&gt;  The format of field exit is :&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; FIELD_EXIT_dataelement_A-Z or 0-9&lt;/P&gt;&lt;P&gt;   If a particular screen and program name is not specified than the field exit will effect all the screens containing that data element.&lt;/P&gt;&lt;P&gt;   The function module associated with field exit shows two parameters&lt;/P&gt;&lt;P&gt;INPUT and OUTPUT.  Input parameter contains the data passed to the field exit when the field exit was invoked by the R/3 , We can write our own code to change the output parameter depending upon our requirements.&lt;/P&gt;&lt;P&gt;    Before the field exit can have any effect the system profile parameter&lt;/P&gt;&lt;P&gt;ABAP/FIELDEXIT in all the application servers should be set to YES&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ABAP/FIELDEXIT = YES.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; regards,&lt;/P&gt;&lt;P&gt;sreelakshmi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Feb 2008 03:53:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exits/m-p/3523325#M847454</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-29T03:53:41Z</dc:date>
    </item>
  </channel>
</rss>

