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: 

User Exit

Former Member
0 Kudos

Hii,

How to find User Exit of a standard transaction

Regards

Hiren K.Chitalia

7 REPLIES 7

Former Member
0 Kudos

just copy and paste this programm..

when u enter the transaction name in selection scren .

it show <b>all the userexit and badi</b> associate with perticular transaction

&----


*& Report ZNEGI16 *

*& *

&----


*& *

*& *

&----


REPORT ZNEGI16 .

TABLES : TSTC,

TADIR,

MODSAPT,

MODACT,

TRDIR,

TFDIR,

ENLFDIR,

SXS_ATTRT ,

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,

P_PGMNA LIKE TSTC-PGMNA .

DATA wa_tadir type tadir.

START-OF-SELECTION.

IF NOT P_TCODE IS INITIAL.

SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.

ELSEIF NOT P_PGMNA IS INITIAL.

TSTC-PGMNA = P_PGMNA.

ENDIF.

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 in ('SMOD', 'SXSD')

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:/(105) SY-ULINE.

FORMAT COLOR COL_HEADING INTENSIFIED ON.

  • Sorting the internal Table

sort jtab by OBJECT.

data : wf_txt(60) type c,

wf_smod type i ,

wf_badi type i ,

wf_object2(30) type C.

clear : wf_smod, wf_badi , wf_object2.

  • Get the total SMOD.

LOOP AT JTAB into wa_tadir.

at first.

FORMAT COLOR COL_HEADING INTENSIFIED ON.

WRITE:/1 SY-VLINE,

2 'Enhancement/ Business Add-in',

41 SY-VLINE ,

42 'Description',

105 SY-VLINE.

WRITE:/(105) SY-ULINE.

endat.

clear wf_txt.

at new object.

if wa_tadir-object = 'SMOD'.

wf_object2 = 'Enhancement' .

elseif wa_tadir-object = 'SXSD'.

wf_object2 = ' Business Add-in'.

endif.

FORMAT COLOR COL_GROUP INTENSIFIED ON.

WRITE:/1 SY-VLINE,

2 wf_object2,

105 SY-VLINE.

endat.

case wa_tadir-object.

when 'SMOD'.

wf_smod = wf_smod + 1.

SELECT SINGLE MODTEXT into wf_txt

FROM MODSAPT

WHERE SPRSL = SY-LANGU

AND NAME = wa_tadir-OBJ_NAME.

FORMAT COLOR COL_NORMAL INTENSIFIED OFF.

when 'SXSD'.

  • For BADis

wf_badi = wf_badi + 1 .

select single TEXT into wf_txt

from SXS_ATTRT

where sprsl = sy-langu

and EXIT_NAME = wa_tadir-OBJ_NAME.

FORMAT COLOR COL_NORMAL INTENSIFIED ON.

endcase.

WRITE:/1 SY-VLINE,

2 wa_tadir-OBJ_NAME hotspot on,

41 SY-VLINE ,

42 wf_txt,

105 SY-VLINE.

AT END OF object.

write : /(105) sy-ULINE.

ENDAT.

ENDLOOP.

WRITE:/(105) SY-ULINE.

SKIP.

FORMAT COLOR COL_TOTAL INTENSIFIED ON.

WRITE:/ 'No.of Exits:' , wf_smod.

WRITE:/ 'No.of BADis:' , wf_badi.

ELSE.

FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.

WRITE:/(105) 'No userexits or BADis exist'.

ENDIF.

ELSE.

FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.

WRITE:/(105) 'Transaction does not exist'.

ENDIF.

AT LINE-SELECTION.

data : wf_object type tadir-object.

clear wf_object.

GET CURSOR FIELD FIELD1.

CHECK FIELD1(8) EQ 'WA_TADIR'.

read table jtab with key obj_name = sy-lisel+1(20).

move jtab-object to wf_object.

case wf_object.

when 'SMOD'.

SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).

CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.

when 'SXSD'.

SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).

CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.

endcase.

Former Member
0 Kudos

Hi,

There are diffrent ways for finding an user-exit in the system. Some of the ways are:

a) Using transaction SPRO and under each hierarchy, you will get these enhancements and exits.

b)There is a program called as ZUSEREXIT. Run this in SE38 and execute the report by giving the name of the transaction for which you need to find the exit.

c) You can also go to transaction SMOD and press F4 and then find out the exits available for each transaction.

Lakshminarayanan

P.S.Mark all helpful answers for points

Former Member
0 Kudos

Hi Hiren,

Pls refer this SDN thread:

Hope it helps you.

Regds,

Akshay Bhagwat

Note: Pls mark helpful answers.

Former Member
0 Kudos

Hi,

There are various ways to find the Exits.

1. Thru SPRO

2. Open the transaction for which want the exit in SE93.

go to object browser and check the function modules.

The exit modules normally starts with 'X'.

3. Copy the following program and execute it with the req trx code.

&----


*& Report Z_USER_EXIT *

*& *

&----


*& *

*& *

&----


*EPORT Z_USER_EXIT

*

  • Finding the user-exits of a SAP transaction code

*

  • Enter the transaction code in which you are looking for the user-exit

  • and it will list you the list of user-exits in the transaction code.

  • Also a drill down is possible which will help you to branch to SMOD.

*

  • Written by : SAP Basis, ABAP Programming and Other IMG Stuff

*

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.

.

-


Regards,

Shashank

Former Member
0 Kudos

Hi,

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.

here is a link for the program to find the user exit for a particular transaction

Rgds,

prakash

Former Member
0 Kudos

Hai Hiren

Go through the following

Go to se93 and give the tcode to find the main program associated to it.

Go to se38 and give the main program.

Find the package associated to it.Go to->Object Directory Entry.

Go to smod transaction.

Press f4.

Press Information System Button.

Give the Project(Dev Class).

Press enter.

Find the enhancements associated

Thanks & regards

Sreenivasulu P

0 Kudos

REPORT z_find_userexit .

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.

*perform start_debugging(ZHIR_DEBUGG).

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.