User exit in CJ20N transaction

Question: hello,

i'm looking for user exits used in the CJ20N transaction.
How can i do to find all the user exits used ?


Thanx a lot

Answer:
Try using this program. Get an ABAPer to put it in for you.
Regards
Gary McInnes
SAP PS/Im
gmcinnes@toyota.co.za






report z_find_userexits no standard page heading .
tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir, tstct.
**** Enhancement - Johan Jacobs.
tables: modsap.
****

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.
**** Enhancement - JJ.
parameters : cb_scan as checkbox default ' '.
****

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.
**** Enhancement - JJ
  perform scan_code_for_user_exits.
****
  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.

*&---------------------------------------------------------------------*
*&      form  scan_code_for_user_exits
*&---------------------------------------------------------------------*
form scan_code_for_user_exits.

  check cb_scan eq 'x'.

  data lv_function like rs38l-name.

  data: begin of kw occurs 10,
          line(30),
        end of kw.
  data  begin of tk occurs 5000.
          include structure stokex.
  data  end of tk.
  data  begin of stm occurs 1000.
          include structure sstmnt.
  data  end of stm.
  data  begin of lv occurs 100.
          include structure slevel.
  data  end of lv.
  data  overflow_area(30000).

  data: tk_index like sy-tabix,
        incl like trdir-name,
        devclass like tadir-devclass,
        begin of source_table occurs 0,
          line(72),
        end of source_table,
        msg(132),
        wrd(30),
        return_code like sy-subrc,
        row like tk-row,
        col like tk-col.

  read report tstc-pgmna into source_table.
  refresh: kw, tk, stm, lv. clear: kw, tk, stm, lv.

  kw = 'call'.            append kw.
  scan abap-source source_table
                           tokens     into tk
                           statements into stm
                           levels     into lv
                           overflow into overflow_area
           keywords from kw
*           program from src_name
           with analysis
           with includes
           without trmac
           message into msg
           word    into wrd
           include into incl
           line    into row
           offset  into col.
  return_code = sy-subrc.

  loop at stm.
    clear lv_function.
    tk_index = stm-from.
    clear tk.
    read table tk index tk_index.
    check tk-str = 'call'.
    tk_index = stm-from + 1.
    clear tk.
    read table tk index tk_index.
    check tk-str = 'customer-function'.
    tk_index = stm-from + 2.
    clear tk.
    read table tk index tk_index.
    translate tk-str using ''' '.
    condense tk-str.
    concatenate 'exit_' tstc-pgmna '_' tk-str into lv_function.
    select single * from modsap where typ eq 'e'
                                  and  member eq lv_function.
    check sy-subrc eq 0.
    clear jtab.
    jtab-obj_name = modsap-name.
    append jtab.
  endloop.
  sort jtab by obj_name.
  delete adjacent duplicates from jtab comparing obj_name.

endform.                               " scan_code_for_user_exits

Answer:
Also look at tcode: SMOD with Enhancment = 'CNEX*'. Most of these exits are invoked from CJ20N just like they would be from CJ2B or CJ01/CN21
Copyright ?2007 - 2008 www.jt77.com