cancel
Showing results for 
Search instead for 
Did you mean: 

user exits

Former Member
0 Kudos

hi every body

can any body tell me how to use the userexit. i mean the procedure to use the user exit. the procedure involved in that.

ram

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Dear Venkat,

PLease visit the following links:

http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

searchsap.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid21_gci1240915,00.html

sap.niraj.tripod.com/id21.html - 58k

User exits are routine which SAP allows you to add in additional customized programs process without affecting the standard SAP programs.

SAP user exit are usually declare as a form routine :-

form userexit_xxxxx

........................

endform

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.

Steps:-

Goto transaction VL01 to pick a Sales Order for delivery (you don't have to save the data)

In the initial screen, click System -> Status -> Double click on Program (Screen)

In the dialog program SAPMV50A, click Edit -> Search/replace

Type userexit in the Find field, then click the In program radio button and hit Enter

A number of userexit routine will be display. You'll have to roughly decide which is the correct userexit routine to used.

form userexit_save_document_prepare.

case xlips-pstyv.

when 'TAX' or 'REX'.

  • Accept this two Delivery item category

when 'REN'.

if xlips-lgort = space.

  • Reject this Delivery item category

message e001.

endif.

when others.

if xlips-matnr <> space.

  • Check storage location not space

if xlips-lgort = space.

message e002.

endif.

  • Check delivery quantity not zero

if xlips-pikmg < 1.

message e003.

endif.

endif.

endcase.

endform.

What is the use of user-exit and all?

Is it about modifying SAP program?

Suppose that you need some functionality which is not provided in sap what do you do. Sap has provided you with three options.

1) Customizing.

2) Modifications.

3) User Exits.

So what are these three in the first case when you take Customization is nothing but you are customizing SAP according to your need and requirement for example you want the Purchase Order Numbers to start with <Co_Name><seq_no>(sequential no) this kind of stuff is done in customization.

Modification is nothing but you are modifying SAP std code which is written during developing your SAP std programms or screens.

Thirdly to avoid modifications SAP has provide you with some exit points like for example after the PBO event in module pool programming comes the PAI. so in between these two events you wanted the change something so SAP has provided with an exit point. that exit point is called user exits. for example user exits for me21 PO Create is MM06005 if I am not wrong. they are nothing but simple function module within which you write your code which functions just like normal program and executes between the PAI and PBO events.

Please Let me know in case of any queries.

Regards,

Rakesh

Former Member
0 Kudos

hi venkat,

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 in 1 project. If the enhancement is already 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"

Incase you need furhter info :

[Userexits help|http://help.sap.com/saphelp_nw04/helpdata/en/bf/ec07a25db911d295ae0000e82de14a/content.htm]

regards

sadhu kishore