Application Development and Automation 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: 
Read only

how to create user exist.

suneel_uggina
Participant
0 Likes
1,351

Hi,

    I tried to create a user exist for mm01.

    At first I used se93 transaction to know the development class of mm01.

     Now I  placed the development class(MG) to find out the user exist  in SMOD.

     But it gives a message no values on  selection creteria..

     Please explain is there any user exist for mm01

thanks in advance.

6 REPLIES 6
Read only

FredericGirod
Active Contributor
0 Likes
1,048

First take this program (it will find exit by transaction for you)

REPORT zz_recherche_user_exit NO STANDARD PAGE HEADING.

* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Finding the user-exits of a SAP transaction code
* Enter the transaction code in which you are looking for the user-exit
* and it will list you the list of user-exits in the transaction code.
* Also a drill down is possible which will help you to branch to SMOD.
*
* Written by : SAP Basis, ABAP Programming and Other IMG Stuff
*              http://www.sap-img.com

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.

*---End of Program

Use SMOD to test User exit, when you know you would like to use it, use the transaction CMOD, create a project ...  and activate it

regards

Fred

Read only

Former Member
0 Likes
1,048

Hi Suneel,

Open MM01 -- Go to System -->Click on Status.

It will display the program name. Double click on the program name (SAPLMGMM ).

In SAPLMGMM - GO to GOTO-OBJECT DIRECTOTY ENTRY- and find package name ie (MGA)

Go to SE84 and expand enhancements-expand customer exits on LHS in RHS provide package and execute you will find the exits. MGA00001...

For reference, please check the below links :

http://wiki.sdn.sap.com/wiki/display/ABAP/Ways+to+find+a+userexit

http://wiki.sdn.sap.com/wiki/display/ABAP/Enhancements+(User+Exits+and+Customer+exits)

Hope it helps to resolve your issue!

Best Regards,

NKC

Read only

Former Member
0 Likes
1,048

Hello Suneel,

Below are the exit's for MM01.

Exit Name           Description

MGA00001            Material Master (Industry): Checks and Enhancements
MGA00002            Material Master (Industry): Number Assignment
MGA00003            Material Master (Industry and Retail): Number Display

There is a code snippet avaliable in SDN.

For finding exit for a given t-code,the codesnippet's link is as follows : http://wiki.sdn.sap.com/wiki/display/Snippets/Code+snippet+to+find+user+exits+in+a+transaction

http://wiki.sdn.sap.com/wiki/display/Snippets/Find+User-exits,+BADIs,+BTEs,+Etc+by+TCode+or+Program

For reference(Working with user exit) , check this :  http://saptechnical.com/Tutorials/ExitsBADIs/UserExits/page1.htm

Thanks

Katrice.

Read only

Former Member
0 Likes
1,048

Hi,

First find the package of of that tcode.....to do so go to SE93 and give tcode mm01.....

there you can see the package name , copy that.

Now go to SMOD to find the exits.......press f4 and in package field enter the name of the package and enter......you will get exits.........choose the exit according to your requirement.

To implement go to CMOD and create project for that exit.

--

Jack

Read only

Former Member
0 Likes
1,048

If I have been following correctly, what my SAP instructor told me and i have been using

is that USER EXITS are modifications and implemented through subroutines and the ones that the guys

wrote here like SMOD and CMOD are specifically called CUSTOMER EXITS okay.

Anyways thats a real terminology issue that I wanted to clarify as i see folks mixing the 2 pretty often

For finding user exits i will advise you to really identify them jusing naming comnventions that SAP follows for them like very simple case is MV45AFZZ  see here 'ZZ' this marks it an include for the user exits for the Sales program SAPMV45A.

similiarly there are many other alternates go to se81->Expand the relevant node-> click on set focus.->Click on information systems.

also u can use the Tx code se84 directly and expand the node Enhancements and perform search for customer exits BAdis , Enhancement spots etc...

Another old trick to find customer exits is you can use the search term 'CALL CUSTOMER-FUNCTION' and perform a search on the program... and for BADIs u can use the break point approach by placing a break point inside the method GET_INSTANCE of the global class CL_EXITHANDLER.

Read only

former_member209120
Active Contributor
0 Likes
1,048

Hi Suneel uggina,

See this thread

http://scn.sap.com/docs/DOC-44382