Skip to Content
Author's profile photo Jeevan Sagar

Program to display Exits and BAdI

The following program will help you display UserExits and BAdI’s for a particular transaction code or program.

Though this is not my own program and I can’t remember where I found it I thought it will be useful as a ready reference for any one trying to look up the userexits in a more intuitive way.

Go to SE38, enter program name as ZUSEREXIT and click create and enter the program description, choose executable program and test program, assign an ABAP package in the program attributes window.

Now copy paste this source code

REPORT ZUSEREXIT .

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:/(19) ‘Transaction Code – ‘,
20(20) P_TCODE,
45(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:/1 SY-VLINE,
2 wa_tadir-OBJ_NAME hotspot on,
41 SY-VLINE ,
42 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.

Save activate the program and transport it.

Now go to SE93, create a transaction code ZEXIT of type report and assign the program ZUSEREXIT to it.

Now when you execute tcode ZEXIT any time you will the screen which looks like below.

3-22-2012 1-45-41 PM.png

When you execute you will have a report of available exits/enhancements and BAdI’s

3-22-2012 1-46-38 PM.png

If you click on any of one of them on the left column you can directly go the relevant exit as shown in screenshot below.

3-22-2012 1-53-09 PM.png

From here on you can select Attribute or Components or Documentation.

If you click on a BAdI the program will take you to SE18 as shown below.

3-22-2012 1-55-39 PM.png

Just select the BAdI Name radio button, it will automatically populate the BAdI you selected.

3-22-2012 1-57-15 PM.png

From here on you can display the BAdI and it’s documentation if available.

P.S. The program works in ECC 6.0, I haven’t tested it on earlier versions. 

Assigned Tags

      19 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Oleg K
      Oleg K

      Well done!

      Regards,

      Author's profile photo Former Member
      Former Member

      Nice find Jeevan. Thanks for the upload and the images to accompany the program. I is always good  like to find new pieces of code to add to my toolkit.

      Kind regards,
      Pete

      Author's profile photo Former Member
      Former Member

      Wow, was I drunk when i wrote that?  This is what is should have said..

      Nice find Jeevan. Thanks for the upload and the images to accompany the program. It is always good to find new pieces of code to add to my toolkit.

      😉

      Author's profile photo Jeevan Sagar
      Jeevan Sagar
      Blog Post Author
      Author's profile photo Syambabu Allu
      Syambabu Allu

      It's very usefull....

      Thsnks,

      Syam

      Author's profile photo Former Member
      Former Member

      Excellent work Jeevan.

      Author's profile photo Zev Yang
      Zev Yang

      wow..wonderful..it\s really a good tool ..thanks..

      Author's profile photo Hrishikesh Joshi
      Hrishikesh Joshi

      Thanks Jeevan, good one!

      Author's profile photo Former Member
      Former Member

      Hi,

      Thanx for such a good knowledge.

      Regd.

      PNU

      Author's profile photo Former Member
      Former Member

      Great work Jeevan.

      Author's profile photo MS kaushek
      MS kaushek

      Nice document

      Author's profile photo Ayaz Khan
      Ayaz Khan

      Thanks Jeevan for this lovely recommendation.

      Author's profile photo Sharat Sugur
      Sharat Sugur

      Hi Jeevan,

      Really helpful program. Thank you.

      Author's profile photo Former Member
      Former Member

      Useful one 🙂

      Thanks for sharing.

      Senthil

      Author's profile photo Former Member
      Former Member

      Great Post.

      Very helpful saves a lot of time 😀 😀

      Author's profile photo Murtuza Chhatariya
      Murtuza Chhatariya

      Really useful and informative. 🙂

      Author's profile photo shailesh mishra
      shailesh mishra

      Very Informative . Awesome Post

      Author's profile photo Former Member
      Former Member

      Great and useful post. Thanks for sharing. 🙂

      Author's profile photo Ulhas K
      Ulhas K

      Very Nice Post and Useful..