Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

User Exit

Former Member
0 Kudos

Hello,

How to find no. of user exit implemented in the system?

If you have some code to find or any other way please let me know.

Thanks in advance

Regards,

Neelambari

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

execute this report..

&----


*& Report ZMS_ACTIVE_EXITS

&----


*& This report displays all the active customer enhancements in the

*& system and also displays whether they are active or implemented

&----


REPORT ZMS_ACTIVE_EXITS.

Data decleration

types: begin of s_function,

fname like MOD0-FUNCNAME,

ftext like tftit-stext,

impl,

active,

example,

end of s_function.

TYPEs : BEGIN OF display_str,

project type modact-name,

enhancement type modact-member,

fm type modsap-member,

status type char20,

END OF display_str.

data : lt_member type table of modact-member,

ls_member like LINE OF lt_member,

lt_fm type table of modsap-member,

ls_fm like LINE OF lt_fm,

lt_modname type table of modact-name,

ls_modname like line of lt_modname,

lt_display type TABLE OF display_str,

ls_display like LINE OF lt_display,

ls_function type s_function,

field1(30).

START-OF-SELECTION.

Select active customer enhancement.

select name from modattr into ls_modname

where status = 'A'.

append ls_modname to lt_modname.

CLEAR ls_modname.

ENDSELECT.

if lt_modname is INITIAL.

WRITE / 'no active enhancements'.

endif.

Determine the details about the customer enhancement.

LOOP AT lt_modname INTO ls_modname.

CLEAR : ls_display.

SELECT member from modact into ls_member where name = ls_modname.

select member from modsap into ls_fm where name = ls_member and typ = 'E'.

ls_display-project = ls_modname.

ls_display-enhancement = ls_member.

ls_display-fm = ls_fm.

clear : ls_function.

ls_function-fname = ls_fm.

perform get_impl_status USING ls_function.

if ls_function-impl = 'X'.

ls_display-status = 'Implemented'.

ELSE.

ls_display-status = 'Active'.

endif.

APPEND ls_display to lt_display.

endselect.

ENDSELECT.

ENDLOOP.

Displaying results

format color = 1.

write : 'Please double-click on the object for follow-on action'.

new-LINE. uline.

write : 'Customer Project', at 30 'SAP Enhancement', at 60 'Exit Function Modul

e', at 100 'Active/Implemented'.

ULINE.

format color = 0.

loop at lt_display into ls_display.

new-LINE.

write : ls_display-project, at 30 ls_display-enhancement, at 60 ls_displayfm,

at 100 ls_display-status.

ENDLOOP.

For calling transaction CMOD / SMOD / SE37.

at line-selection.

get cursor field field1.

CASE field1.

WHEN 'LS_DISPLAY-PROJECT'.

set parameter id 'MON_KUN' field sy-lisel(10).

call transaction 'CMOD' and skip first screen.

WHEN 'LS_DISPLAY-ENHANCEMENT'.

set parameter id 'MON' field sy-lisel+29(10).

call transaction 'SMOD' and skip first screen.

WHEN 'LS_DISPLAY-FM'.

set parameter id 'LIB' field sy-lisel+59(30).

call transaction 'SE37' and skip first screen.

WHEN OTHERS.

message 'Click on the right place.' TYPE 'I'.

ENDCASE.

&----


*& Form get_impl_status

&----


This FORM checks whether an EXIT FM is implemented or not

-


form get_impl_status using p_function type s_function.

data : l_mand LIKE tfdir-mand,

l_incl_names TYPE smod_names OCCURS 1 WITH HEADER LINE.

l_incl_names-itype = 'C'.

APPEND l_incl_names.

CLEAR l_mand.

SELECT SINGLE mand FROM tfdir INTO l_mand WHERE funcname = p_function-fname.

IF sy-subrc = 0 AND l_mand(1) = 'C'.

p_function-active = 'X'.

l_status-active = c_true.

ELSE.

p_function-active = ' '.

l_status-inactive = c_true.

ENDIF.

CALL FUNCTION 'MOD_FUNCTION_INCLUDE'

EXPORTING

funcname = p_function-fname

TABLES

incl_names = l_incl_names

EXCEPTIONS

OTHERS = 4.

IF sy-subrc = 0.

LOOP AT l_incl_names.

SELECT SINGLE name FROM trdir INTO l_incl_names-iname

WHERE name = l_incl_names-iname.

IF sy-subrc = 0.

p_function-impl = 'X'.

ELSE.

p_function-impl = ' '.

ENDIF.

ENDLOOP.

ENDIF.

endform. "get_impl_status

Regards,

Omkaram.

4 REPLIES 4

Former Member
0 Kudos

Hi ,

Copy this program in SE38 and execute. Will get all list of existing Exits and

Badis for a particular Transaction code.

very useful program

Below code will give a list of BADIs for particular transaction.

&----


*& Report ZNEGI16 *

*& *

&----


*& *

*& *

&----


REPORT ZNEGI16 .

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.

<b>Reward points if this helps.

Manish</b>

Former Member
0 Kudos

u can check tables mod*

modsap, modsapt -- tables

to check the userexits in sap system

Former Member
0 Kudos

hi,

Need to find user exits module-wise? Suppose we want to see the available sales module user exits. Go to transaction SE81. Click on SD, then click "edit" on the menu bar and choose select subtree. Click on "information system," Open Environment node, customer exits, and enhancements. Press F8 to get all the user exits for that module.

In brief:

SE81->SD->Select subtree->Information System->Envir->Exit Techniques->Customers exits->enhancements->Execute(F8)

Hope this helps, Do reward.

Former Member
0 Kudos

hi,

execute this report..

&----


*& Report ZMS_ACTIVE_EXITS

&----


*& This report displays all the active customer enhancements in the

*& system and also displays whether they are active or implemented

&----


REPORT ZMS_ACTIVE_EXITS.

Data decleration

types: begin of s_function,

fname like MOD0-FUNCNAME,

ftext like tftit-stext,

impl,

active,

example,

end of s_function.

TYPEs : BEGIN OF display_str,

project type modact-name,

enhancement type modact-member,

fm type modsap-member,

status type char20,

END OF display_str.

data : lt_member type table of modact-member,

ls_member like LINE OF lt_member,

lt_fm type table of modsap-member,

ls_fm like LINE OF lt_fm,

lt_modname type table of modact-name,

ls_modname like line of lt_modname,

lt_display type TABLE OF display_str,

ls_display like LINE OF lt_display,

ls_function type s_function,

field1(30).

START-OF-SELECTION.

Select active customer enhancement.

select name from modattr into ls_modname

where status = 'A'.

append ls_modname to lt_modname.

CLEAR ls_modname.

ENDSELECT.

if lt_modname is INITIAL.

WRITE / 'no active enhancements'.

endif.

Determine the details about the customer enhancement.

LOOP AT lt_modname INTO ls_modname.

CLEAR : ls_display.

SELECT member from modact into ls_member where name = ls_modname.

select member from modsap into ls_fm where name = ls_member and typ = 'E'.

ls_display-project = ls_modname.

ls_display-enhancement = ls_member.

ls_display-fm = ls_fm.

clear : ls_function.

ls_function-fname = ls_fm.

perform get_impl_status USING ls_function.

if ls_function-impl = 'X'.

ls_display-status = 'Implemented'.

ELSE.

ls_display-status = 'Active'.

endif.

APPEND ls_display to lt_display.

endselect.

ENDSELECT.

ENDLOOP.

Displaying results

format color = 1.

write : 'Please double-click on the object for follow-on action'.

new-LINE. uline.

write : 'Customer Project', at 30 'SAP Enhancement', at 60 'Exit Function Modul

e', at 100 'Active/Implemented'.

ULINE.

format color = 0.

loop at lt_display into ls_display.

new-LINE.

write : ls_display-project, at 30 ls_display-enhancement, at 60 ls_displayfm,

at 100 ls_display-status.

ENDLOOP.

For calling transaction CMOD / SMOD / SE37.

at line-selection.

get cursor field field1.

CASE field1.

WHEN 'LS_DISPLAY-PROJECT'.

set parameter id 'MON_KUN' field sy-lisel(10).

call transaction 'CMOD' and skip first screen.

WHEN 'LS_DISPLAY-ENHANCEMENT'.

set parameter id 'MON' field sy-lisel+29(10).

call transaction 'SMOD' and skip first screen.

WHEN 'LS_DISPLAY-FM'.

set parameter id 'LIB' field sy-lisel+59(30).

call transaction 'SE37' and skip first screen.

WHEN OTHERS.

message 'Click on the right place.' TYPE 'I'.

ENDCASE.

&----


*& Form get_impl_status

&----


This FORM checks whether an EXIT FM is implemented or not

-


form get_impl_status using p_function type s_function.

data : l_mand LIKE tfdir-mand,

l_incl_names TYPE smod_names OCCURS 1 WITH HEADER LINE.

l_incl_names-itype = 'C'.

APPEND l_incl_names.

CLEAR l_mand.

SELECT SINGLE mand FROM tfdir INTO l_mand WHERE funcname = p_function-fname.

IF sy-subrc = 0 AND l_mand(1) = 'C'.

p_function-active = 'X'.

l_status-active = c_true.

ELSE.

p_function-active = ' '.

l_status-inactive = c_true.

ENDIF.

CALL FUNCTION 'MOD_FUNCTION_INCLUDE'

EXPORTING

funcname = p_function-fname

TABLES

incl_names = l_incl_names

EXCEPTIONS

OTHERS = 4.

IF sy-subrc = 0.

LOOP AT l_incl_names.

SELECT SINGLE name FROM trdir INTO l_incl_names-iname

WHERE name = l_incl_names-iname.

IF sy-subrc = 0.

p_function-impl = 'X'.

ELSE.

p_function-impl = ' '.

ENDIF.

ENDLOOP.

ENDIF.

endform. "get_impl_status

Regards,

Omkaram.