Skip to Content
Author's profile photo Former Member

Finding a user exit – code to do so

This is some code that I have archived on another site:

It specifies in it’s initial comments the primary contributers to the best of my knowledge.

Good luck!

*&———————————————————————*

*& Report  Z_FIND_USEREXIT_RNW

*&

*&———————————————————————*

*&

*&

*&———————————————————————*

*&———————————————————————*

*& Report  Z_FIND_EXIT

*&

*&———————————————————————*

*&

*I’m thinking that this is based on a post by

*

*SimonaD86 in http://sap.

*ittoolbox.com/groups/technical-functional/sap-abap/determinate-the-transaction-that-called-a-certain-userexitfrom-the-user-exit-2760810

*

*or  santoshkj in http://sap.

*ittoolbox.com/groups/technical-functional/sap-dev/developing-screen-exits-in-sap-520079

*

*or Deertay in http://sap.

*ittoolbox.com/groups/technical-functional/sap-dev/user-exit-for-a-transaction-code-mb1bmigo-1155130

*&

*&———————————————————————*

REPORT  z_find_exit.

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:/001(19) ‘Transaction Code – ‘,

           020(20) p_tcode,

           045(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:/001 sy-vline,

               002 wa_tadir-obj_name HOTSPOT ON,

               041 sy-vline ,

               042 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.

Assigned Tags

      14 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Jürgen Lins
      Jürgen Lins

      looks pretty equal to the coding in this blog: Looking for user exits for a specific transaction?

      Author's profile photo Former Member
      Former Member

      The real source is unknown. At least this post is attributing to 3 sap.ittoolbox links and other post does not.

      Sap.ittoolbox is probably the website that has oldest post with same snippet.

      But I think real source is finding the user-exits of a SAP transaction

      The website is so badly formatted, it clearly belongs to pre-historic era.

      The guy's the then resume shows 2 years experience in ABAP on version 4.6b.

      Author's profile photo Jürgen Lins
      Jürgen Lins

      hmm, the poster of the code in my link is a SAP employee.

      whatever, we need it only once.

      Author's profile photo Matthew Billingham
      Matthew Billingham

      I chatted with Neal. He says this is his code.

      Author's profile photo Former Member
      Former Member

      I found one document. (ignoring the occurrences in threads)

      Program to find User Exits for standard T-Code

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      With no way of dating it, I'd have to ignore it.  I'd have to claim that it's a copy of mine as refered to against Jurgen's post.

      Author's profile photo Andrea Olivieri
      Andrea Olivieri

      Just for info.

      With the OSS Note http://service.sap.com/sap/support/notes/210073 SAP released on Mar 2000 the ABAP report RCEXITCHECK with a very similar code.

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Here is my original post.

      R. N. Wilhite Professional Profile at Toolbox for IT

      It was posted Oct 2009.

      Neal

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Let's take the broad view on this.  I shouldn't be able to do anything that someone else can't do.  If my post on a previous site invalidates this post then I would expect this post to be invalidated.  Of course, I would also expect all other posts on this site that were of the same ilk to be stricken as well.

      Author's profile photo Jürgen Lins
      Jürgen Lins

      I have almost the same coding in my development system with creation date of 2003.

      It is very common code which could be found everywhere in the webzpcfinduserexit1.PNG

      zpcfinduserexit2.PNG

      Of course I will contact Arminda Jack and ask her if she has a date of origin to compare.

      Author's profile photo Matthew Billingham
      Matthew Billingham

      If there's no evidence of plagiarism (just very similar code, because there's only one (procedural) way of writing it), then perhaps it's a case of "doesn't really add value". In which case it should go to personal space.

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      And so should every other reference there of on the site.

      Author's profile photo Matthew Billingham
      Matthew Billingham

      See SCN Support. This is a common theme. "Why is my content being singled out?" "What about these others?".

      1. Mods are unpaid volunteers doing this in our free time.

      2. We don't catch everything

      3. There's a lot of old content

      4. We don't have time to clean up

      5. We rely on the community to point out content that doesn't quite make the grade.

      I hope that's clear enough for you.

      As I've pointed out to others before. No-one will lose out if your content isn't accepted. No-one will die. It won't adversely affect anyone's career.

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Yes, my statement was nonsensical.

      I guess I'd like to see reports only be taken seriously if the reporter gives an earlier reference (thus making it plagiarism, or at least unintentional duplication) or several equivalent references (making the document irrelevant).

      That completely takes the load off of the volunteers.