Skip to Content
author's profile photo Former Member
Former Member

Program To check Exits

Hi All,

Can anyone give me a way to check the availablity of exits in a program for corresponding t-codes..

Thanks and Regards,

Seshadri...

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2007 at 10:51 AM

    http://www.sapgenie.com/abap/code/abap26.htm>

    &----


    *& Report YCHATEST *

    *& *

    &----


    *& *

    *& *

    &----


    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2007 at 10:50 AM

    hi,

    Check these threads for source code of the program which gives the user-exits

    Check Ranjit Thakur's post in

    what-is-the-program-to-see-the-all-user-exits-in-t

    program-to-find-out-user-exits-used-in-an-standard

    Regards

    Sailaja

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2007 at 10:52 AM

    Hi,

    Use the program

    &----


    *& Report Z_USEREXIT_DISPLAY

    &----


    REPORT Z_USEREXIT_DISPLAY

    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

    Also see the links:

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

    which gives the list of exits for a tcode

    http://help.sap.com/saphelp_nw04/helpdata/en/bf/ec079f5db911d295ae0000e82de14a/frameset.htm

    For information on Exits, check these links

    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

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

    http://www.sap-img.com/abap/what-is-user-exits.htm

    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction

    http://www.easymarketplace.de/userexit.php

    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

    http://www.sappoint.com/abap/userexit.pdfUser-Exit

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

    reward points if helpful

    regards,

    Anji

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.