2007 Mar 24 4:32 AM
what are user exits? what is the difference between user exit and customer exit.
and also what is the difference between SMOD and CMOD
2007 Mar 24 5:29 AM
2007 Mar 24 5:29 AM
2007 Mar 24 5:38 AM
HI,,,
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.
reward if it helps u...
sai ramesh
2007 Mar 24 11:59 AM
http://www.sap-img.com/abap/what-is-user-exits.htm
http://www.sap-img.com/abap/what-is-the-difference-between-smod-and-cmod.htm
http://www.sap-img.com/abap/field-exits-smod-cmod-questions-and-answers.htm
reward if helpful.
regards.
santhosh reddy
Message was edited by:
santhosh reddy
Message was edited by:
santhosh reddy
2007 Apr 25 6:38 PM
plz help.
1)why and When we use user-exits.what is the need to use user-exit,does we need access key while using user exit?
2)HOW many types of exits are there.
3)when we go to SMOD and and press F4 we can search three types of exits a)function,b)menu exit c)screen exit. if we have these three exits then why we need User exit? Please explain ,
2007 Apr 26 5:30 AM
Hi Zareen,
USER EXITS are FORMS and are called by SAP standard programs using PERFORM.
Inside the form (user exit) you can read and change almost any global data from host program.
User exits are more flexible because you have more information to use in your code but on the other hand , it is very easy to manipulate erroneously global data and lead the standard program to a dump or even to make database inconsistent.
User-exit doesn t have any classification.
Basically designed For SD module
User-exits can be written only using access-key
With user-exits the code , the developer has written will not be there for next version unless modification assistance tool is used
Costomer exits:
CUSTOMER EXITS are FUNCTIONS so they are called using CALL FUNCTION (or more exactly CALL CUSTOMER FUNCTION).
Inside a function (customer exit) you can only acces your import/export/changing/tables parameters.
Customer exits are more restrictive but you are sure any change you can make to any parameters will never lead to inconsistency
In customer-exit we have function-module exit , screen exit , menu exit
Are available for MM,SD,FI,HR ..Basically designed for all modules.
No need of access key
Customer-exits are not wiped during upgradation
USerExits:
User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a functionmodule. The code for the function module is writeen by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module.
The naming standard of function modules for functionmodule exits is:
EXIT_<program name><3 digit suffix>
The call to a functionmodule exit is implemented as:
CALL CUSTOMER.-FUNCTION ❤️ digit suffix>
SMOD:
By using this transaction code we can find the Exits .
Cmod:
Here we can activate the exits after providing the logic.
********Rewards some points.
Rgds,
P.Naganjana Reddy
2007 Apr 26 6:35 AM
Customer exits and User exits are entirely different.
They don't have any relationship.
Customer exits are provided to the customer in the form of Function Module which holds the include in the customer namespace.The user can add own source code in it.This is technically an enhancement.Eg for customer exits are Function module exits,Menu Exits,Screen Exits.
User exists are empty subroutines that the SAP Developers have provided for you that u can fill with your own source code.This is technically a modification since the object in the SAP name space is modified.
1. Previously there were only user-exits.
2. Then came the concept of customer-exits.
3. user exits were nothing but
subroutines FORM/PERFORM called from standard programs.
4. The FORM defintion was placed inside an empty include file.
5. So It was called EVERYTIME.and we need to MODIFY/REPAIR the
standard include .
6. Then it came with concept of customer-exit
7. It consists of calling a FUNCTION MODULE,
which is called only if the user-exit is ACTIVATED (other wise not called)
In this case, the code in put inside
a pre-defined Z include.
*----
8. Functionality of both is same, howerver
we can note the following important differences
a) Customer exit is called only if activated.
(hence, it does not waste resources)
b) in customer exit, REPAIR does not happen
to the standard include.
Thanks,
Anitha