Application Development and Automation 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: 
Read only

Query regarding User Exit

Former Member
0 Likes
611

Dear All,

Can anyone please tell me how to find the user Exit for a transaction.

Regards,

Vijay

6 REPLIES 6
Read only

Former Member
0 Likes
586

Hi Vijay,

Goto SE38--> Give USEREXIT and Press F4 u can find the User exits.

based on the description u can put a Break point and check with the Transcation.

Thanks,

Nelson

Reward poins if really helpfull....

Read only

0 Likes
586

SE37 USEREXIT-->F4.

Read only

0 Likes
586

Try with these Programm:

REPORT z_userexit_temp

NO STANDARD PAGE HEADING

LINE-SIZE 200

MESSAGE-ID zz.

&----


  • T A B L E D E C L A R A T I O N S *

&----


TABLES: tftit,

e071,

e070.

&----


  • S T R U C T U R E D E C L A R A T I O N S *

&----


TYPES: BEGIN OF x_tstc,

tcode TYPE tcode,

pgmna TYPE program_id,

END OF x_tstc.

TYPES: BEGIN OF x_tadir,

obj_name TYPE sobj_name,

devclass TYPE devclass,

END OF x_tadir.

TYPES: BEGIN OF x_slog,

obj_name TYPE sobj_name,

END OF x_slog.

TYPES: BEGIN OF x_final,

name TYPE smodname,

member TYPE modmember,

include(15), "Include name

END OF x_final.

&----


  • I N T E R N A L T A B L E D E C L A R A T I O N S *

&----


DATA: it_tstc TYPE STANDARD TABLE OF x_tstc WITH HEADER LINE.

DATA: it_tadir TYPE STANDARD TABLE OF x_tadir WITH HEADER LINE.

DATA: it_jtab TYPE STANDARD TABLE OF x_slog WITH HEADER LINE.

DATA: it_final TYPE STANDARD TABLE OF x_final WITH HEADER LINE.

&----


  • V A R I A B L E S D E C L A R A T I O N S *

&----


&----


  • U S E R I N P U T S S C R E E N *

&----


&----


  • S E L E C T I O N S C R E E N *

&----


SELECTION-SCREEN: BEGIN OF BLOCK blk01 WITH FRAME TITLE text-t01.

PARAMETERS: p_tcode LIKE tstc-tcode OBLIGATORY.

SELECTION-SCREEN END OF BLOCK blk01.

&----


  • S t a r t o f S e l e c t i o n *

&----


START-OF-SELECTION.

PERFORM get_tcodes. "Get Tcodes

PERFORM get_objects. "Get Objects

&----


  • E n d o f S e l e c t i o n *

&----


END-OF-SELECTION.

PERFORM display_results. "Display Results

&----


*& Form get_tcodes

&----


  • Get Tcodes

----


FORM get_tcodes.

SELECT tcode

pgmna

INTO TABLE it_tstc

FROM tstc

WHERE tcode = p_tcode.

IF sy-subrc = 0.

SORT it_tstc BY tcode.

ENDIF.

ENDFORM. " get_tcodes

&----


*& Form get_objects

&----


  • Get Objects

----


FORM get_objects.

DATA: l_fname LIKE rs38l-name,

l_group LIKE rs38l-area,

l_include LIKE rs38l-include,

l_namespace LIKE rs38l-namespace,

l_str_area LIKE rs38l-str_area.

DATA: v_include LIKE rodiobj-iobjnm.

DATA: e_t_include TYPE STANDARD TABLE OF abapsource WITH HEADER LINE.

DATA: l_line TYPE string,

l_tabix LIKE sy-tabix.

IF NOT it_tstc[] IS INITIAL.

SELECT obj_name

devclass

INTO TABLE it_tadir

FROM tadir FOR ALL ENTRIES IN it_tstc

WHERE pgmid = 'R3TR' AND

object = 'PROG' AND

obj_name = it_tstc-pgmna.

IF sy-subrc = 0.

SORT it_tadir BY obj_name devclass.

SELECT obj_name

INTO TABLE it_jtab

FROM tadir FOR ALL ENTRIES IN it_tadir

WHERE pgmid = 'R3TR' AND

object = 'SMOD' AND

devclass = it_tadir-devclass.

IF sy-subrc = 0.

SORT it_jtab BY obj_name.

ENDIF.

ENDIF.

ENDIF.

*- Get UserExit names

LOOP AT it_jtab.

SELECT name

member

INTO (it_final-name, it_final-member)

FROM modsap

WHERE name = it_jtab-obj_name AND

typ = 'E'.

APPEND it_final.

CLEAR it_final.

ENDSELECT.

ENDLOOP.

*- Process it_final contents.

LOOP AT it_final.

l_tabix = sy-tabix.

CLEAR: l_fname,

l_group,

l_include,

l_namespace,

l_str_area.

l_fname = it_final-member.

CALL FUNCTION 'FUNCTION_EXISTS'

EXPORTING

funcname = l_fname

IMPORTING

group = l_group

include = l_include

namespace = l_namespace

str_area = l_str_area

EXCEPTIONS

function_not_exist = 1

OTHERS = 2.

IF sy-subrc = 0.

IF NOT l_include IS INITIAL.

*- Get Source code of include.

CLEAR: v_include, e_t_include, e_t_include[].

v_include = l_include.

CALL FUNCTION 'MU_INCLUDE_GET'

EXPORTING

i_include = v_include

TABLES

e_t_include = e_t_include.

IF sy-subrc = 0.

LOOP AT e_t_include.

IF e_t_include-line CS 'INCLUDE'.

CLEAR l_line.

l_line = e_t_include-line.

CONDENSE l_line NO-GAPS.

TRANSLATE l_line USING '. '.

l_line = l_line+7(9).

it_final-include = l_line.

MODIFY it_final INDEX l_tabix TRANSPORTING include.

ENDIF.

ENDLOOP.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

ENDFORM. " get_objects

&----


*& Form display_results

&----


  • Display Results

----


FORM display_results.

FORMAT COLOR COL_HEADING.

WRITE:/1(150) sy-uline.

WRITE:/ sy-vline,

2(23) 'Extension Name',

24 sy-vline,

25(39) 'Exit Name',

64 sy-vline,

65(74) 'Description',

140 sy-vline,

141(9) 'Include',

150 sy-vline.

WRITE:/1(150) sy-uline.

FORMAT RESET.

SORT it_final BY name member.

LOOP AT it_final.

CLEAR tftit.

SELECT SINGLE stext

INTO tftit-stext

FROM tftit

WHERE spras = 'EN' AND

funcname = it_final-member.

WRITE:/ sy-vline,

it_final-name COLOR COL_KEY, 24 sy-vline,

25 it_final-member, 64 sy-vline,

65 tftit-stext, 140 sy-vline,

141 it_final-include, 150 sy-vline.

WRITE:/1(150) sy-uline.

ENDLOOP.

ENDFORM. " display_results

Read only

Former Member
0 Likes
586

HI,

To find out user exits of a particular transation first u have to find out find out on which package it is stored for this u have to go for se93, provide transaction it will display the package name.

2. Go to SMOD tcode provide package name.

it will display all the available exits for that package.

Regards.

B.SREENIVSULU.

Read only

Former Member
0 Likes
586

Hi Vijay,

<b>

Plz refer to following code.</b>

REPORT z_find_userexit NO STANDARD PAGE HEADING.

&----


*& 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.

<b>Reward points if it solves ur query or answer is helpful</b>

Thanks

Chinmay

Read only

former_member196299
Active Contributor
0 Likes
586

Hi ,

To find the user exit for a transaction , follow the process :

open the transaction --> goto SYSTEM menu option -->goto STATUS option and open it . here you can get the package for the transaction .

next open transaction CMOD.

here give the package name and click on the enhancements option .

after doing this you will get a list of includes , which are nothing buit your USER-EXITs linked to your transaction . here choose the proper exit and then write the code for modifications ..

I am sure you will get it !

Reward points for all helpful answers !!

Thanks

Ranjita