cancel
Showing results for 
Search instead for 
Did you mean: 

hi

Former Member
0 Kudos

what is mean by user exit

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos
Former Member
0 Kudos

hi manish

User exits

1. Introduction

2. How to find user exits

3. Using Project management of SAP Enhancements

1. Introduction

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.

The naming standard of function modules for functionmodule exits is: EXIT_<program name><3

digit suffix>

The call to a functionmodule exit is implemented as: CALL CUSTOMER.-FUNCTION ❤️ digit suffix>

Example:

The program for transaction VA01 Create salesorder is SAPMV45A

If you search for CALL CUSTOMER-FUNCTION i program SAPMV45A you will find ( Among other user

exits):

CALL CUSTOMER-FUNCTION '003'

exporting

xvbak = vbak

xvbuk = vbuk

xkomk = tkomk

importing

lvf_subrc = lvf_subrc

tables

xvbfa = xvbfa

xvbap = xvbap

xvbup = xvbup.

The exit calls function module EXIT_SAPMV45A_003

2. How to find user exits

Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT

If you know the Exit name, go to transaction CMOD. Choose menu Utillities->SAP Enhancements.

Enter the exit name and press enter.

You will now come to a screen that shows the function module exits for the exit.

3. Using Project management of SAP Enhancements

We want to create a project to enahance trasnaction VA01

Go to transaction CMOD

Create a project called ZVA01

Choose the Enhancement assign radio button and press the Change button

In the first column enter V45A0002 Predefine sold-to party in sales document . Note that an

enhancement can only be used i 1 project. If the enhancement is allready in use, and error message

will be displayed

Press Save

Press Components. You can now see that enhancement uses user exit EXIT_SAPMV45A_002.

Double click on the exit.

Now the function module is displayed. Double click on include ZXVVAU04 in the function module

Insert the following code into the include: E_KUNNR = '2155'.

Activate the include program. Go back to CMOD and activate the project.

Goto transaction VA01 and craete a salesorder. Note that Sold-to-party now automatically is "2155"

Former Member
0 Kudos

Hi Manish Sharma

Hi,

Refer below

All SAP User Exits (SMOD/CMOD) on one view

Userxits allow us to add our own functionality to SAP standard program

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.

All Userexits start with the word USEREXIT_...

FORM USEREXIT_..

z..

ENDFORM.

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.

e.g. USEREXIT_SAVE_DOCUMENT_PREPARE

Certain application like SD still provide this form of enhancement using userexit but this practice is no longer being followed for newer extensions

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.

HOW TO FIND USEREXITS

Userexits can be found in number of ways:

1) To find userexits in SD module , goto object navigator(SE80) and select

development class from the list and enter VMOD in it. All of the userexits in SD are contained in the development class VMOD. Press

enter and you will find all the includes which contain userexits in SD for

different functions like PRICING, ORDER PROCESSING etc. Select the userexit according to the requirement and read the comment inserted in it

and start coding .

Some examples of userexits in SD(SALES & DISTRIBUTION ) are:

1)ADDING OF NEW FIELDS IN PRICING

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.

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 pricing

is to be based on some other criteria which is not present in the form of fields in either of the two tables.

This problem can be solved by using USEREXITS which are provided for pricing in SD.

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

USEREXIT_PRICING_PREPARE_TKOMP or

USEREXIT_PRICING_PREPARE_TKOMK

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.

In the case of userexit which will be called when invoicing is done ,these

are provided in the include RY60AFZZ which is in the standard SAP

program SAPMV45A. The name of the userexits are same. i.e

USEREXIT_PRICING_PREPARE_TKOMP or

USEREXIT_PRICING_PREPARE_TKOMK

These userexits are used for passing the data from the communication structure to the pricing procedure, for this we have to fill the newely

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

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.

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

includes are provided in each of them .

To create the field in header data(KOMK) the include provided is KOMKAZ

and to create the field in item data(KOMP) the include provided is KOMPAZ.

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.

.

Some other examples of userexits in SD are:

USEREXIT_NUMBER_RANGE

This userexit is used to assign a different internal document number to the

sales order(VA01) when it is created depending on some criteria like a different SALES ORGANIZAION(VKORG) .

USEREXIT_SAVE_DOCUMENT_PREPARE

This userexit is used to insert the ABAP code which will be called when

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.

TYPES OF EXITS

1)MENU EXITS

2)FUNCTION EXITS

3)TABLE EXITS

4)SCREEN EXITS

5)KEYWORD EXITS

6)FIELD EXITS

We use SAP transactions CMOD and SMOD to manage exits. Before implementing an exit , it is required to create the project by using CMOD

selecting the enhancement e.g. V45A0002 and selecting the component

(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.

An exit can be coded only once.

FUNCTION EXITS

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.

The function exits are called from the standard SAP program in the form

of ABAP statement

CALL CUSTOMER-FUNCTION 'NNN'

This is in contrast to USEREXITs where PERFORM statement is used to call

the required userexit.

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.

http://www.easymarketplace.de/userexit.php

http://help.sap.com/saphelp_47x200/helpdata/en/bf/ec07845db911d295ae0000e82de14a/frameset.htm

Reward if useful to u

Former Member
0 Kudos

hi,

userexit means exit from the std configure according to client requirement..

for example:

predetermine sold to party in sale document.

in SMOD.find out enhancements(V45A002).

IN CMOD create project then assign this enhancement,click components-click that program-write E_KUNNR='100'-ACTIVATE this program& project.then create order in VA01.sold to party has automatically come like 100.

regards,

mcm

Former Member
0 Kudos