Hi All,
This report program helps us to get the all USER EXITS for given transcation.
*&---------------------------------------------------------------------*
*& Report ZUSEREXIT_FIND
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZUSEREXIT_FIND.
*&---------------------------------------------------------------------*
*& 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 OCCURS0WITHHEADERLINE.
DATA : field1(30).
DATA : v_devclass LIKE tadir-devclass.
*&---------------------------------------------------------------------*
*& Selection Screen Parameters
*&---------------------------------------------------------------------*
SELECTION-SCREENBEGINOFBLOCK a01 WITHFRAMETITLEtext-001.
SELECTION-SCREENSKIP.
PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
SELECTION-SCREENSKIP.
SELECTION-SCREENENDOFBLOCK a01.
*&---------------------------------------------------------------------*
*& Start of main program
*&---------------------------------------------------------------------*
START-OF-SELECTION.
* Validate Transaction Code
SELECTSINGLE * FROM tstc
WHERE tcode EQ p_tcode.
* Find Repository Objects for transaction code
IF sy-subrc EQ0.
SELECTSINGLE * FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'PROG'
AND obj_name = tstc-pgmna.
MOVE : tadir-devclass TO v_devclass.
IF sy-subrc NE0.
SELECTSINGLE * FROM trdir
WHERE name = tstc-pgmna.
IF trdir-subc EQ'F'.
SELECTSINGLE * FROM tfdir
WHERE pname = tstc-pgmna.
SELECTSINGLE * FROM enlfdir
WHERE funcname = tfdir-funcname.
SELECTSINGLE * 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
INTOTABLE jtab
WHERE pgmid = 'R3TR'
AND object = 'SMOD'
AND devclass = v_devclass.
SELECTSINGLE * FROM tstct
WHERE sprsl EQ sy-langu
AND tcode EQ p_tcode.
FORMATCOLOR COL_POSITIVE INTENSIFIED OFF.
WRITE:/(19) 'Transaction Code - ',
20(20) p_tcode,
45(50) tstct-ttext.
SKIP.
IFNOT jtab[] ISINITIAL.
WRITE:/(95) sy-uline.
FORMATCOLOR COL_HEADING INTENSIFIEDON.
WRITE:/1 sy-vline,
2'Exit Name',
21 sy-vline ,
22'Description',
95 sy-vline.
WRITE:/(95) sy-uline.
LOOPAT jtab.
SELECTSINGLE * FROM modsapt
WHERE sprsl = sy-langu AND
name = jtab-obj_name.
FORMATCOLORCOL_NORMALINTENSIFIED OFF.
WRITE:/1 sy-vline,
2 jtab-obj_name HOTSPOTON,
21 sy-vline ,
22 modsapt-modtext,
95 sy-vline.
ENDLOOP.
WRITE:/(95) sy-uline.
DESCRIBETABLE jtab.
SKIP.
FORMATCOLOR COL_TOTAL INTENSIFIEDON.
WRITE:/ 'No of Exits:' , sy-tfill.
ELSE.
FORMATCOLORCOL_NEGATIVEINTENSIFIEDON.
WRITE:/(95) 'No User Exit exists'.
ENDIF.
ELSE.
FORMATCOLORCOL_NEGATIVEINTENSIFIEDON.
WRITE:/(95) 'Transaction Code Does Not Exist'.
ENDIF.
* Take the user to SMOD for the Exit that was selected.
ATLINE-SELECTION.
GETCURSORFIELD field1.
CHECK field1(4) EQ'JTAB'.
SETPARAMETERID'MON'FIELD sy-lisel+1(10).
CALLTRANSACTION'SMOD'ANDSKIPFIRSTSCREEN.
**********************************************************************************