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: 

finding the user exit

Former Member
0 Kudos

Hello Experts,

I have to find a user exit <b>that will propose a product expirtation date based on a calculation from the material master field cal by the bulk batch comingle date.</b>

Could you please help in me in finding that.

I appreciate your help.

thnx a ton,

6 REPLIES 6

Former Member
0 Kudos

Hi,

Step 1 :- Execute transaction

step 2 :- Click on Status Menu

step 3 :- Double click on the program (screen) __?????___

Step 4 :- Search source code for the 'Customer-Function' string using the find button. Remember to select 'In main program'.

Step 5 :- A list of search results should be displayed indicating where all function exits can be found.

You can now double click on each of them to go to its position in the source code. This also

allows for the insertion of breakpoints so that you can test if the exits are called in the

appropriate place.

Step 6 :-Once you have found the Function Exit within the source code (Find Function Exit) you need to

access the actual function module it executes. This is done using the following steps:

Step 6.1 :-

Step 1

Locate desired 'Call Customer-function' statement within source code.

Step 2

If code is not within main program (module pool) e.g. SAP* then you will need to find this

out by selecting 'Main Program' from the 'GOTO' menu. The Main program for transaction

Step 3

The actual function module name can now be calculated based on the information retrieved,

it is defined by the following format:

EXIT_<Program name>_<Exit number>

eg :- 'EXIT_SAPLMR1M_004'.

Step 7.1:-

Once you have found the Exit function module

Step 1

Execute transaction CMOD

Step 2

Select 'SAP Enhancements' from the 'Utilities' menu.

Step 3

Select 'All selections' from the 'Edit' menu.

Step 4

Now populate the Component name field with the exit function module and press

the execute button.

Step 5

A list of all Exits(Enhancements) containing that function module should now be displayed.

Step 5

You can now double click on the desired exit to display a detailed description of its uses and a list of all

components contained in it.

<b>Implementing Function Exit </b>

This is required in-order to activate Function exit:

Step 1

The first step is to enter source code into function module in the usual way i.e. via SE37.

There will already be an include declaration within the code with the following

format: Include zx*.

Double click on this to create it, source code can then be entered within here.

Although it is good practice to create another include with this to store your

code, this allows separation of difference enhancements allowing them to be easlity

removed without de-activating the enhancement.

Step 2

Execute transaction CMOD and create new Enhancement. Enter name and press the create

Button.

Step 3

The following screen should be displayed, enter short text then click on the 'Enhancement

Step 4

Now enter the Exit name (enhancement) which contains the desired Function Exit.

Step 5

Return to initial screen of CMOD and press the activate icon. The exit is now ready for use.

Please Mark The Helfull Answers & close the thread.

If still not clear i will send u the document on userexit @E-MAIL

Regards

Manoj.

0 Kudos

Hi Manoj,

Thanks for the reply.

But when I searched for the "customer-function" in the <b>main program</b>, i could not found any.

The program I searched for that is "SAPLMGMM".

Is it the correct program, i'm searching for.

Please let me know.

Thanks,

Former Member
0 Kudos

Hi,

I am not sure about the program which ur using . But this the correct procedure to fine & implement USER-EXIT .

if there are no user exit then there will BADI ( Business Add ins )

since SAP is moving towards BADI in upcomming versions.

Regsrds

Manoj .

0 Kudos

Manoj,

I have tried to find the user exit for other transactions(eg:xk03), i found some user exits with the process you have mentioned. it worked. But I don't know why it is not working for Material Master.

Can you help me in finding the BADI's for that, otherwise.

Thanks a lot,

0 Kudos

Hi,

Use this code to find user exits in a particular transaction. I got this from SDN forums, don't remember the author though.

Please mark the helpful answers


REPORT z_find_userexit NO STANDARD PAGE HEADING.

 

*&---------------------------------------------------------------------*

*&  Enter the transaction code that you want to search through in order

*&  to find which Standard SAP User Exits exists.

*&

*&---------------------------------------------------------------------*

 

*&---------------------------------------------------------------------*

*& Tables

*&---------------------------------------------------------------------*

 

TABLES : tstc,     "SAP Transaction Codes

         tadir,    "Directory of Repository Objects

         modsapt,  "SAP Enhancements - Short Texts

         modact,   "Modifications

         trdir,    "System table TRDIR

         tfdir,    "Function Module

         enlfdir,  "Additional Attributes for Function Modules

         tstct.    "Transaction Code Texts

 

*&---------------------------------------------------------------------*

*& Variables

*&---------------------------------------------------------------------*

 

DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.

DATA : field1(30).

DATA : v_devclass LIKE tadir-devclass.

 

*&---------------------------------------------------------------------*

*& Selection Screen Parameters

*&---------------------------------------------------------------------*

SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.

SELECTION-SCREEN SKIP.

PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN END OF BLOCK a01.

 

*&---------------------------------------------------------------------*

*& Start of main program

*&---------------------------------------------------------------------*

 

START-OF-SELECTION.

 

* Validate Transaction Code

  SELECT SINGLE * FROM tstc

    WHERE tcode EQ p_tcode.

 

* Find Repository Objects for transaction code

  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 = enlfdir-area.

 

        MOVE : tadir-devclass TO v_devclass.

      ENDIF.

    ENDIF.

 

* Find SAP Modifactions

    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.

 

* Take the user to SMOD for the Exit that was selected.

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.

ferry_lianto
Active Contributor
0 Kudos

Hi,

Have you looked this BADI for material master?

<b>BADI_MATERIAL_CHECK</b> - Enhanced checks for material master table

<b>BADI_MATERIAL_OD</b>

<b>BADI_MATERIAL_REF</b> - Addition of customer-defined default data for material

Also find this user exits for material master.

<b>MGA00001</b> - Material Master (Industry): Checks and Enhancements

<b>MGA00002</b> - Material Master (Industry): Number Assignment

<b>MGA00003</b> - Material Master (Industry and Retail): Number Display

Hope this will help.

Regards,

Ferry Lianto