‎2007 Aug 09 9:34 AM
‎2007 Aug 09 9:35 AM
************************************************************************
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.
*
************************************************************************
*----
TABLES DECLARATION
*----
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
*----
INTERNAL TABLE DECLARATIONS
*----
DATA : ITAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
*----
DATA DECLARATIONS
*----
DATA : V_FIELD1(30).
DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
*----
INPUT SCREEN DECLARATIONS
*----
PARAMETERS : P_TCODE LIKE TSTC-TCODE OBLIGATORY.
*----
START OF SELECTION EVENT
*----
START-OF-SELECTION.
*--Read SAP Transaction Code from the given input.
SELECT SINGLE *
FROM TSTC
WHERE TCODE EQ P_TCODE.
IF SY-SUBRC EQ 0.
*--Get the Directory of Repository Objects for the
*---selected program name.
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.
*--Read System table TRDIR for the selected program name.
SELECT SINGLE *
FROM TRDIR
WHERE NAME = TSTC-PGMNA.
*--Get the function module name for the selected program name.
IF TRDIR-SUBC EQ 'F'.
SELECT SINGLE *
FROM TFDIR
WHERE PNAME = TSTC-PGMNA.
*--Get the function group for the selected program name.
SELECT SINGLE *
FROM ENLFDIR
WHERE FUNCNAME = TFDIR-FUNCNAME.
*--Read the development class for the corresponding function group.
SELECT SINGLE *
FROM TADIR
WHERE PGMID = 'R3TR' AND
OBJECT = 'FUGR' AND
OBJ_NAME EQ ENLFDIR-AREA.
MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
ENDIF.
ENDIF.
*--Read all the entries into the internal table itab.
SELECT *
FROM TADIR
INTO TABLE ITAB
WHERE PGMID = 'R3TR' AND
OBJECT = 'SMOD' AND
DEVCLASS = V_DEVCLASS.
*--Read Transaction code information from the table tstct.
SELECT SINGLE *
FROM TSTCT
WHERE SPRSL EQ SY-LANGU AND
TCODE EQ P_TCODE.
*-- Column Headings
FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
WRITE:/(19) 'Transaction Code - ',
20(20) P_TCODE,
45(50) TSTCT-TTEXT.
SKIP.
IF NOT ITAB[] 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 ITAB.
*--Read SAP Enhancements short texts information.
SELECT SINGLE *
FROM MODSAPT
WHERE SPRSL = SY-LANGU AND
NAME = ITAB-OBJ_NAME.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
WRITE:/1 SY-VLINE,
2 ITAB-OBJ_NAME HOTSPOT ON,
21 SY-VLINE ,
22 MODSAPT-MODTEXT,
95 SY-VLINE.
ENDLOOP.
WRITE:/(95) SY-ULINE.
DESCRIBE TABLE ITAB.
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 EVENT
*----
AT LINE-SELECTION.
GET CURSOR FIELD V_FIELD1.
CHECK V_FIELD1(4) EQ 'ITAB'.
SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
*-- call transation SMOD : Sap Enhancement.
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
*---End of Program
‎2007 Aug 09 9:35 AM
************************************************************************
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.
*
************************************************************************
*----
TABLES DECLARATION
*----
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
*----
INTERNAL TABLE DECLARATIONS
*----
DATA : ITAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
*----
DATA DECLARATIONS
*----
DATA : V_FIELD1(30).
DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
*----
INPUT SCREEN DECLARATIONS
*----
PARAMETERS : P_TCODE LIKE TSTC-TCODE OBLIGATORY.
*----
START OF SELECTION EVENT
*----
START-OF-SELECTION.
*--Read SAP Transaction Code from the given input.
SELECT SINGLE *
FROM TSTC
WHERE TCODE EQ P_TCODE.
IF SY-SUBRC EQ 0.
*--Get the Directory of Repository Objects for the
*---selected program name.
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.
*--Read System table TRDIR for the selected program name.
SELECT SINGLE *
FROM TRDIR
WHERE NAME = TSTC-PGMNA.
*--Get the function module name for the selected program name.
IF TRDIR-SUBC EQ 'F'.
SELECT SINGLE *
FROM TFDIR
WHERE PNAME = TSTC-PGMNA.
*--Get the function group for the selected program name.
SELECT SINGLE *
FROM ENLFDIR
WHERE FUNCNAME = TFDIR-FUNCNAME.
*--Read the development class for the corresponding function group.
SELECT SINGLE *
FROM TADIR
WHERE PGMID = 'R3TR' AND
OBJECT = 'FUGR' AND
OBJ_NAME EQ ENLFDIR-AREA.
MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
ENDIF.
ENDIF.
*--Read all the entries into the internal table itab.
SELECT *
FROM TADIR
INTO TABLE ITAB
WHERE PGMID = 'R3TR' AND
OBJECT = 'SMOD' AND
DEVCLASS = V_DEVCLASS.
*--Read Transaction code information from the table tstct.
SELECT SINGLE *
FROM TSTCT
WHERE SPRSL EQ SY-LANGU AND
TCODE EQ P_TCODE.
*-- Column Headings
FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
WRITE:/(19) 'Transaction Code - ',
20(20) P_TCODE,
45(50) TSTCT-TTEXT.
SKIP.
IF NOT ITAB[] 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 ITAB.
*--Read SAP Enhancements short texts information.
SELECT SINGLE *
FROM MODSAPT
WHERE SPRSL = SY-LANGU AND
NAME = ITAB-OBJ_NAME.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
WRITE:/1 SY-VLINE,
2 ITAB-OBJ_NAME HOTSPOT ON,
21 SY-VLINE ,
22 MODSAPT-MODTEXT,
95 SY-VLINE.
ENDLOOP.
WRITE:/(95) SY-ULINE.
DESCRIBE TABLE ITAB.
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 EVENT
*----
AT LINE-SELECTION.
GET CURSOR FIELD V_FIELD1.
CHECK V_FIELD1(4) EQ 'ITAB'.
SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
*-- call transation SMOD : Sap Enhancement.
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
*---End of Program
‎2007 Aug 09 9:38 AM
Hi Rahul,
if u want to find exit for a transaction first find the development class(package) of the transaction and take this one and go smod transaction by pressing F4 here and give this package name and it will display list of exits then accrding to desc find the suitable exit....
reward points to all helpful answers
kiran.M
‎2007 Aug 09 11:38 AM
Hi Rahul,
There are two types of user exits normally anailable for any transaction.
1. User exits.
2. customised exits.
1. you can find the userexits by going to the transaction then into Menu bar "System" under that "Status" .
Take the program name from this .go to the program and you will find different user exits at different level of processing.
2. customised is find the Development class of the transaction.
go to transaction CMOD give the Development class and use F4 will give you all the user exits available.
Let me know if you need anymore clarification on this.
Reward points if u find this suggestion helpful.
Thanks,
Yuvaraj