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: 

Ways to find out userexits.

Former Member
0 Kudos

Hi frineds,

Yesterday i had a interview, In this interview one of the interviewr asked me a question. In how many ways we can find out an exit ? I said 2 ways but he said,

no we can find out this exit in 6 ways.

Can any one explain me in how many ways we can find out exits.

Regards,

desha

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi desha kulkarni ,

Finding User Exits

Procdedure 1:

Valid up to at least SAP release 4.0B

One way to find user exits applicable for a given SAP screen. From the SE38 screen, enter the desired screen main program, and click Utilities > Find In Source Code, and "CUSTOMER-FUNCTION" as the text to search for. This will give you a list of the user exits and where they are called from for all screens in the module pool.

Note: format of ABAP statement is CALL CUSTOMER-FUNCTION '009', for example. This is the statement called by a submodule attached to the main program.

Actual related function is EXIT_SAPLCOIH_009, for example. This example refers to customer function 9 in main program SAPLCOIH. Not all user exit functions are names as such, but this is the usual format.

If you are doing data validation and want to set an error message with a field open, you must be sure that the user exit you are using is linked to a calling module in the PAI section of the screen and the field you wish to be open was in the CHAIN statement which caused the PAI module to be invoked.

If you use a customer function which was invoked by a PBO module to validate data, the "MESSAGE" statement will cause the screen to return with the desired message at the bottom, but with all screen fields closed for input.

When you make changes to the include module for a given customer function, you must regenerate the related function group before you will see the changes included in the screen behaviour.

Procdedure 2:

Need to find user exits module-wise? Suppose we want to see the available sales module user exits. Go to transaction SE81. Click on SD, then click "edit" on the menu bar and choose select subtree. Click on "information system," Open Environment node, customer exits, and enhancements. Press F8 to get all the user exits for that module. In brief: SE81->SD->Select subtree->Information System->Envir->Exit Techniques->Customers exits->enhancements->Execute(F8)

Procdedure 3:

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.

Enhancements,Creating a project,Assigning SAP enhancements to a project,Editing enhancement components,Activating a project

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

Find user exits with a TCode

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

SAP User Exits Routine

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

cheers!

gyanaraj

****Pls reward points if u find this helpful

4 REPLIES 4

Former Member
0 Kudos

Hi Desha,

The below code helps you to find the user exits within a transaction:

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.

METHOD 2

1) Option 1 : you don't know the name or dont have any info on user exit

************************************************************************************

run T-code : SPRO

SPRO -> Click SAP Reference IMG -> click in the relevant module eg: SD (sales and Distribution) ->System Modifications -> User exits

You can view documentation to understand the purpose of that user exit

It is not that always one can find the user exits under the name "System modifications" but with respect to a module definitely user exits can be found under that module in SPRO

2) Option 2 : You know the name of the user exit

************************************************************************************

Run Tcode : SMOD -> fill in the enhancement name-> click on attributes and then components or directly on components and view the include...if already a code is written in the include,then on double click of include you can see the code...if an existing code is not there and you double click on the include,SAP prompts for a request

<b>Kindly Reward Points If you found this reply helpful.</b>

Cheers,

Chaitanya.

0 Kudos

Thanks a lot gentle men,

regards,

Desha.

Former Member
0 Kudos

hi

4 ways i hope. Please check with this.

Reward if it is useful.

Thanks

Siva kumar

option1:

method1:

1. Go to the screen>System>Status-->Program (Double

click this program. It will take you to the program.

2. Now, Goto-->Object Directory Entry.

3. Make a note the package name.

4. Now run the transactions SMOD, press F4 and enter the

above noted package, press enter.

5. It will display list of Exits.

6. Now go back to the initial screen SMOD.

7. Specify the exit name here and select the radio button

Components.

8. It will display four group boxes one for FM, second

for Fcodes, thrid for Screen areas and last for

includes.

Option2:

run T-code : SPRO

SPRO -> Click SAP Reference IMG -> click in the relevant module eg: SD (sales and Distribution) ->System Modifications -> User exits

You can view documentation to understand the purpose of that user exit

It is not that always one can find the user exits under the name "System modifications" but with respect to a module definitely user exits can be found under that module in SPRO

Option 3 : You know the name of the user exit

Run Tcode : SMOD -> fill in the enhancement name-> click on attributes and then components or directly on components and view the include...if already a code is written in the include,then on double click of include you can see the code...if an existing code is not there and you double click on the include,SAP prompts for a request

Option4: Program

REPORT Z_FIND_USEREXIT .

*report zuserexit no standard page heading.

tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.

tables : tstct.

data : jtab like tadir occurs 0 with header line.

data : field1(30).

data : v_devclass like tadir-devclass.

parameters : p_tcode like tstc-tcode obligatory.

select single * from tstc where tcode eq p_tcode.

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 eq enlfdir-area.

move : tadir-devclass to v_devclass.

endif.

endif.

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.

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.

*---End of Program

Former Member
0 Kudos

Hi desha kulkarni ,

Finding User Exits

Procdedure 1:

Valid up to at least SAP release 4.0B

One way to find user exits applicable for a given SAP screen. From the SE38 screen, enter the desired screen main program, and click Utilities > Find In Source Code, and "CUSTOMER-FUNCTION" as the text to search for. This will give you a list of the user exits and where they are called from for all screens in the module pool.

Note: format of ABAP statement is CALL CUSTOMER-FUNCTION '009', for example. This is the statement called by a submodule attached to the main program.

Actual related function is EXIT_SAPLCOIH_009, for example. This example refers to customer function 9 in main program SAPLCOIH. Not all user exit functions are names as such, but this is the usual format.

If you are doing data validation and want to set an error message with a field open, you must be sure that the user exit you are using is linked to a calling module in the PAI section of the screen and the field you wish to be open was in the CHAIN statement which caused the PAI module to be invoked.

If you use a customer function which was invoked by a PBO module to validate data, the "MESSAGE" statement will cause the screen to return with the desired message at the bottom, but with all screen fields closed for input.

When you make changes to the include module for a given customer function, you must regenerate the related function group before you will see the changes included in the screen behaviour.

Procdedure 2:

Need to find user exits module-wise? Suppose we want to see the available sales module user exits. Go to transaction SE81. Click on SD, then click "edit" on the menu bar and choose select subtree. Click on "information system," Open Environment node, customer exits, and enhancements. Press F8 to get all the user exits for that module. In brief: SE81->SD->Select subtree->Information System->Envir->Exit Techniques->Customers exits->enhancements->Execute(F8)

Procdedure 3:

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.

Enhancements,Creating a project,Assigning SAP enhancements to a project,Editing enhancement components,Activating a project

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

Find user exits with a TCode

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

SAP User Exits Routine

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

cheers!

gyanaraj

****Pls reward points if u find this helpful