Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

can anyone let me know the step by step procedure for creating userexits?

Former Member
0 Kudos

Hi all,

can anyone let me know the step by step procedure for creating user exits? for any transaction code like mm01 or vd01.

thanxs in advance

hari

3 REPLIES 3

Former Member
0 Kudos

Hi

User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a function module. The code for the function module is written 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>

To find a Exit.

Goto Transaction -- Find The Package

SMOD >f4>Use the Package here to Find the Exits In the Package.

Else if you Want to search by Application Area wise ,

There is one more tab to find the Exits in the Respective Application Area.

Implementing the Exit-- CMOD Create ProjectsAssgn your Component .

Now Run ur Transaction to Check if it Triggers.

Thats it..

Suppose you need to find out all the user exits related to a tcode.

1. Execute the Tcode.

2. Open the SAP program.

3. Get the Development Class.

4. Execute Tcode SE84.

5. Open the Node 'Envir. -> Exit Techniques -> 'Customer Exits -> Enhancements'

6. Enter the Development class and execute.

Check out this thread..

1<b>. Type the transaction : system->status-> <PROG. NAME>

2 open SE37 , type EXIT<PROG NAME> and press F4 to get the list of function exits available.

3. Open CMOD utilities->SAP enhancements

EDIT->All selections

4.type the function module name obtained in step 2, in fields 'component name' in 'additional selections' block. and execute.

5. The displayed list contains the enhancements names for the transaction You were looking for.

6. Create a project in CMOD and the code in default include->activate.</b>

http://www.erpgenie.com/sap/abap/code/abap26.htm

which gives the list of exits for a tcode

http://help.sap.com/saphelp_nw04/helpdata/en/bf/ec079f5db911d295ae0000e82de14a/frameset.htm

For information on Exits, check these links

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

http://www.sapgenie.com/abap/code/abap26.htm

http://www.sap-img.com/abap/what-is-user-exits.htm

http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction

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

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

http://www.sappoint.com/abap/userexit.pdfUser-Exit

http://www.planetsap.com/userexit_main_page.htm

User-Exits

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

http://www.sap-img.com/ab038.htm

http://www.planetsap.com/userexit_main_page.htm

http://www.sap-basis-abap.com/sapab013.htm

http://sap.ittoolbox.com/documents/popular-q-and-a/user-exits-for-the-transaction-code-migo-3283

These links will help you to learn more on user exits.

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

http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/frameset.htm

http://www.planetsap.com/userexit_main_page.htm

http://www.allsaplinks.com/user_exit.html

www.sap-img.com/abap/what-is-user-exits.htm

Also please check these threads for more details about user exits.

1. Document on UserExits in FI/CO

http://www.ficoexpertonline.com/downloads/User%20ExitsWPedit.doc

2. Finding User Exits...

http://sap.ionelburlacu.ro/abap/sap2/Other_Useful_Tips.html#Finding_User_Exits

3. List of all User Exits...

http://www.planetsap.com/userexit_main_page.htm

<b>Reward points for useful Answers</b>

Regards

Anji

Former Member
0 Kudos

Hi,

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.

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.

- 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"

The exit calls function module EXIT_SAPMV45A_003

Refer these links too,

What is User Exits

http://www.sap-img.com/abap/what-is-user-exits.htm

Finding user exit,

http://abap4.tripod.com/Other_Useful_Tips.html#Finding_User_Exits.

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

http://www.sapgenie.com/abap/code/abap26.htm

http://www.sap-img.com/abap/what-is-user-exits.htm

http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction

http://www.erpgenie.com/sap/abap/code/abap26.htm

which gives the list of exits for a tcode

http://help.sap.com/saphelp_nw04/helpdata/en/bf/ec079f5db911d295ae0000e82de14a/frameset.htm

For information on Exits, check these links

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

http://www.sappoint.com/abap/userexit.pdfUser-Exit

http://www.planetsap.com/userexit_main_page.htm

User-Exits

http://www.sap-img.com/ab038.htm

http://www.sap-basis-abap.com/sapab013.htm

http://sap.ittoolbox.com/documents/popular-q-and-a/user-exits-for-the-transaction-code-migo-3283

These links will help you to learn more on user exits.

http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/frameset.htm

http://www.allsaplinks.com/user_exit.html

Also please check these threads for more details about user exits.

1. Document on UserExits in FI/CO

http://www.ficoexpertonline.com/downloads/User%20ExitsWPedit.doc

2. Finding User Exits...

http://sap.ionelburlacu.ro/abap/sap2/Other_Useful_Tips.html#Finding_User_Exits

3. List of all User Exits...

http://www.planetsap.com/userexit_main_page.htm

https://forums.sdn.sap.com/click.jspa?searchID=672084&messageID=312792

https://forums.sdn.sap.com/click.jspa?searchID=672084&messageID=1320078

https://forums.sdn.sap.com/click.jspa?searchID=672084&messageID=2669896

Regards,

Priyanka.

Former Member
0 Kudos

Hi,

&----


*& Report ZEXITFINDER

*&

&----


*&

*&

&----


*report zexitfinder.

&----


*& Enter the transaction code that you want to search through in order

*& to find which Standard SAP User Exits exists.

*&

&----


&----


*& Tables

&----


tables : tstc, "SAP Transaction Codes

tadir, "Directory of Repository Objects

modsapt, "SAP Enhancements - Short Texts

modact, "Modifications

trdir, "System table TRDIR

tfdir, "Function Module

enlfdir, "Additional Attributes for Function Modules

tstct. "Transaction Code Texts

&----


*& Variables

&----


data : jtab like tadir occurs 0 with header line.

data : field1(30).

data : v_devclass like tadir-devclass.

&----


*& Selection Screen Parameters

&----


selection-screen begin of block a01 with frame title text-001.

selection-screen skip.

parameters : p_tcode like tstc-tcode obligatory.

selection-screen skip.

selection-screen end of block a01.

&----


*& Start of main program

&----


start-of-selection.

  • Validate Transaction Code

select single * from tstc

where tcode eq p_tcode.

  • Find Repository Objects for transaction code

if sy-subrc eq 0.

select single * from tadir

where pgmid = 'R3TR'

and object = 'PROG'

and obj_name = tstc-pgmna.

move : tadir-devclass to v_devclass.

if sy-subrc ne 0.

select single * from trdir

where name = tstc-pgmna.

if trdir-subc eq 'F'.

select single * from tfdir

where pname = tstc-pgmna.

select single * from enlfdir

where funcname = tfdir-funcname.

select single * from tadir

where pgmid = 'R3TR'

and object = 'FUGR'

and obj_name = enlfdir-area.

move : tadir-devclass to v_devclass.

endif.

endif.

  • Find SAP Modifactions

select * from tadir

into table jtab

where pgmid = 'R3TR'

and object = 'SMOD'

and devclass = v_devclass.

select single * from tstct

where sprsl eq sy-langu

and tcode eq p_tcode.

format color col_positive intensified off.

write:/(19) 'Transaction Code - ',

20(20) p_tcode,

45(50) tstct-ttext.

skip.

if not jtab[] is initial.

write:/(95) sy-uline.

format color col_heading intensified on.

write:/1 sy-vline,

2 'Exit Name',

21 sy-vline ,

22 'Description',

95 sy-vline.

write:/(95) sy-uline.

loop at jtab.

select single * from modsapt

where sprsl = sy-langu and

name = jtab-obj_name.

format color col_normal intensified off.

write:/1 sy-vline,

2 jtab-obj_name hotspot on,

21 sy-vline ,

22 modsapt-modtext,

95 sy-vline.

endloop.

write:/(95) sy-uline.

describe table jtab.

skip.

format color col_total intensified on.

write:/ 'No of Exits:' , sy-tfill.

else.

format color col_negative intensified on.

write:/(95) 'No User Exit exists'.

endif.

else.

format color col_negative intensified on.

write:/(95) 'Transaction Code Does Not Exist'.

endif.

  • Take the user to SMOD for the Exit that was selected.

at line-selection.

get cursor field field1.

check field1(4) eq 'JTAB'.

set parameter id 'MON' field sy-lisel+1(10).

call transaction 'SMOD' and skip first screen.

look in txn CMOD or SMOD, check enhancement 0VRF0001. It uses function module EXIT_SAPL0VRF_001. It is used to manipulate route determination for SD.

Here is the code

DATA: ls_xvbpa LIKE xvbpa,

lf_aland LIKE tvst-aland,

lf_azone LIKE tvst-azone,

lf_lland LIKE trolz-lland,

lf_lzone LIKE trolz-lzone,

ls_vbadr LIKE vbadr,

ls_xvbap LIKE xvbap,

ls_tvst LIKE tvst,

lv_route LIKE trolz-route.

LOOP AT xvbap INTO ls_xvbap.

IF NOT ls_xvbap-vstel IS INITIAL.

SELECT SINGLE * FROM tvst

INTO ls_tvst

WHERE vstel EQ ls_xvbap-vstel.

IF sy-subrc = 0.

lf_aland = ls_tvst-aland.

lf_azone = ls_tvst-azone.

ENDIF.

ENDIF.

READ TABLE xvbpa INTO ls_xvbpa WITH KEY vbeln = ls_xvbap-vbeln

posnr = ls_xvbap-posnr

parvw = 'Q1'.

IF sy-subrc = 0.

CALL FUNCTION 'SD_ADDRESS_GET'

EXPORTING

fif_address_number = ls_xvbpa-adrnr

IMPORTING

fes_address = ls_vbadr

EXCEPTIONS

address_not_found = 1

address_type_not_exists = 2

no_person_number = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

lf_lland = ls_vbadr-land1.

lf_lzone = ls_vbadr-lzone.

ENDIF.

ENDIF.

CALL FUNCTION 'SD_ROUTE_DETERMINATION'

EXPORTING

i_aland = lf_aland

i_azone = lf_azone

i_lland = lf_lland

i_lzone = lf_lzone

IMPORTING

e_route = lv_route

EXCEPTIONS

no_route_found = 1

departure_error = 2

destination_error = 3

invalid_generic_key = 4

customer_exit_error = 5

OTHERS = 6.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

ls_xvbap-route = lv_route.

MODIFY xvbap FROM ls_xvbap TRANSPORTING route.

ENDIF.

ENDLOOP.

For information on Exits, check these links

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

http://www.sapgenie.com/abap/code/abap26.htm

http://www.sap-img.com/abap/what-is-user-exits.htm

http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction

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

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

http://www.sappoint.com/abap/userexit.pdfUser-Exit

http://www.planetsap.com/userexit_main_page.htm

User-Exits

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

http://www.sap-img.com/ab038.htm

http://www.planetsap.com/userexit_main_page.htm

http://www.sap-basis-abap.com/sapab013.htm

http://sap.ittoolbox.com/documents/popular-q-and-a/user-exits-for-the-transaction-code-migo-3283

<b>Reward points</b>

Regards