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: 

Find Userexit/badi

Former Member
0 Kudos

Hi Experts

My seniors have made some user exit or badi to the transaction VF02 to download a text file while save the transaction in change mode.

Now i want to do some changes in it, but am not able to find the user exit/badi, how can i find.

I have tried to find using exit_handler, and cutomer_exit, but there is no such names, but its working , advise me how can we find.

Regards

Rajaram

4 REPLIES 4

Former Member
0 Kudos

check this program this will give you the list of user-exit and BADI for the perticular Tcode.

REPORT zuserexit_badi.

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.

Reward IF...........

Regards

Anbu

Former Member
0 Kudos

Hi,

Try this code!!!!!!!

&----


*& Report ZUSEREXITS

*&

&----


*&

*&

&----


*REPORT ZUSEREXITS.

report zuserexit no standard page heading.

tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.

tables : 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 obligatory.

select single * from tstc where tcode eq p_tcode.

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 = '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.

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.

Former Member
0 Kudos

Hello Rajaram,

u said that u have tried using exit_handler.

Do like this u will definitely find the badi.

Go to se24.

give classname as cl_exithandler.

in that open get_instance method , put a breakpoint there.

run the transaction for which u want to find badis.

in exit_name parameter u can find the badis names while debugging.

once u find the badis go to se18 create definition and then go to se19 and implement tht.

In order to find userexits.

search for call customer function string in standard programs of the transactions. or try to find using package . or u can make use of the program which is already posted.

Rgds.,

subash

GauthamV
Active Contributor
0 Kudos

Hi ram,

open TADIR table give object type as CMOD and object name as Z* and execute u will get all Zexits implemented in ur system.

u can find ur required exit.

reward points if hlpful.