Skip to Content
author's profile photo Former Member
Former Member

CMOD and SMOD

Hi All ,

i am new to SAP and ABAP.

can anyone tell me about

1.what is CMOD?

2.how and y is it used?

3.what is SMOD?

4.how and y is it used?

points will be rewarded.

thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 05:07 AM

    Hi,

    CMOD is the Project Management of SAP Enhancements (i.e., SMOD Enhancements). SMOD contains the actual enhancements and CMOD is the grouping of those SMOD enhancements.

    User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a function module. The code for the function module is written 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 function module exits is:

    EXIT_<program name><3 digit suffix>

    The call to a functionmodule exit is implemented as:

    CALL CUSTOMER.-FUNCTION <3 digit suffix>

    For Example:

    The program for transaction VA01 Create salesorder is SAPMV45A

    1. If you search for CALL CUSTOMER-FUNCTION program SAPMV45A you will find ( Among other user exits):

    CALL CUSTOMER-FUNCTION '003'

    exporting

    xvbak = vbak

    xvbuk = vbuk

    xkomk = tkomk

    importing

    lvf_subrc = lvf_subrc

    tables

    xvbfa = xvbfa

    xvbap = xvbap

    xvbup = xvbup.

    The exit calls function module EXIT_SAPMV45A_003

    2. How to find user exits

    Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT

    If you know the Exit name, go to transaction CMOD. Choose menu Utillities->SAP Enhancements.

    Enter the exit name and press enter.

    You will now come to a screen that shows the function module exits for the exit.

    or use this ABAP program to search for user exits :-

    Finding the user-exits of a SAP transaction code

    3. Using Project management of SAP Enhancements

    You want to create a project to enhance transaction VA01

    - Go to transaction CMOD

    - Create a project called ZVA01

    - Choose the Enhancement assign radio button and press the Change button

    In the first column enter V45A0002 Predefine sold-to party in sales document . Note that an enhancement can only be used for 1 project. If the enhancement is allready in use, and error message will be displayed

    - Press Save

    - Press Components. You can now see that enhancement uses user exit EXIT_SAPMV45A_002.

    - Double Click on the exit.

    Now the function module is displayed. Double click on include ZXVVAU04 in the function module

    Insert the following code into the include: E_KUNNR = '2155'.

    Activate the include program. Go back to CMOD and activate the project.

    Goto transaction VA01 and create a salesorder. Note that Sold-to-party now automatically is "2155"

    Regards,

    Renjith Michael.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 05:58 AM

    Hi Nani,

    In addidtion to above replys i would like to add some more information about CMOD and SMOD .These are some question and answers . I hope it would of good help for you

    1. Field exit was created with CMOD, but is not processed when calling the screen.

    - Since the field exit is not processed until PAI, an action must be triggered on the screen (Return, Save, ...).

    - Set profile parameter abap/fieldexit to YES and restart the system.

    - After activating the function module FIELD_EXIT... and the field exit, leave the transaction on whose screen the field exit is to be executed. The screen is not generated until the transaction is started.

    - Do not work on different application servers since there may be some delay before the field exit is activated.

    - The profile parameter must be set on all or none of the application servers.

    - If the field exit is to only be active on specific screens, check whether you chose the correct program and the correct screen

    number (take care with subscreens).

    - Using SE51 -> Field list, check that the screen field does have a reference to a data element. In the name of the field exit use the name of the data element and not the field name.

    - After transport, field exits are marked as active but will not be processed.

    Tip: First try deactivating the field exit once more and then afterwards, activate it again.

    2. How is performance affected by setting abap/fieldexit?

    - If a screen is generated and the profile parameter is set, a check is run on 2 tables (TDDIR, TDDIRS) to see whether a field exit must be generated for the respective field. In practice, the screen load is not generated until the screen is selected after an

    update. The user should not notice any difference because screen generation is very fast.

    3. Can you read the contents of other screen fields in the field exit?

    - In principle, every field exit can store its value in the global variables of the function group (TOP) and hence make them

    available to other field exits. Note here that field exits are always called and not only if an entry is made in the field or if the field is empty. In addition, it is not possible to make any assumptions about the order in which the field exits will be called in the future.

    4. How does the field exit behave on step loop fields ?

    - After the user has entered data, the field exit is called in PAI as often as there are visible fields in the step loop. The system

    variable SY-STEPL is incremented each time. If a new value is assigned to the field, it is displayed in the module between LOOP and ENDLOOP. This module is also called once for each visible step loop line.

    5. Can field exits be debugged ?

    - No. Field exits must be tested separately in the ABAP/4 Development Workbench. For errors which only occur in the screen environment, it is helpful to write interesting variable to the file system using TRANSFER... . These can then be analysed there.

    6. What can you do if the field contents are no longer transported to to ABAP/4.

    - Check whether a value is assigned to the field OUTPUT.

    7. When is the field exit called if a conversion exit is attached to the

    data element ?

    - The field exit is called after the conversion exit. This means that the INPUT field receives the data in the same format as the

    ABAP/4 program also receives it.

    8. Although a global field exit is inactive, a function module is called which does not exist (for example FIELD_EXIT_PROGRAMM_@)

    - This is an error in the kernel which no longer occurs as of 3.0C. As a temporary measure, it is useful to assign a program and a screen which do not exist to the field exit and then activate the field exit.

    9. Field exit is not visible in CMOD, although created.

    - If you want to create a field exit for a data element, a function module is proposed with the name FIELD_EXIT_. This

    function module must exist for the field exit to work. If you do not create this function module, but do create one with a suffix,

    the data element is not displayed in CMOD.

    10. Field exit is not executed although it is active.

    - Fields which do not have the 'Input field' attribute usually do not trigger a field exit. The field exit is designed to allow an

    extended input check. It is therefore only called for input fields - even if they are not ready for input at runtime of the application by LOOP AT SCREEN.

    This rule does not apply, however, if the field is located within a steploop. Here the field will be always activated, even if it is

    invisible.

    - Field exits can only be executed for fields that are directly related tothe dictionary. If the relation is indirect, i.e. via an ABAP declaration ( LIKE ), no field exit can be executed.

    11. Field exits on check buttons do not work

    - Field exits are only intended for input fields. As check buttons count as graphical elements, you cannot install field exits on

    them.

    12. Field exits do not work on selection screens

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 08:46 PM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 09:31 PM

    We use SAP transactions CMOD and SMOD to manage exits. Before implementing an exit , it is required to create the project by using CMOD, selecting the enhancement e.g. V45A0002 and selecting the component

    (one which fulfills our need) i.e the exit which will be implemented in SMOD and after coding has been done the project has to be activated.

    SMOD is used to search for the suitable exit (function/screen/ menu exits) for the application / package level.

    Thanks,

    Srinivas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 04:16 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 05:04 AM

    SMOD is just to see all the enhancements in the sap system.

    CMOD is the customer projects where enhancements are implemented. If you want to implement any enhancements then you will create a project and assign the enhancement and do the coding in exits.

    To customize an existing SAP application we have been provided the user exits by SAP. These exits are packaged under enhancements. You choose an enhancement according to your requirements e.g. enhancement MM06E005 is used for adding custom field in me21/me21n. SAP has limited no of enhancements for any transactions, you have to choose only from them to cater your requiement you cant create them.

    After selecting your enhancements you have to inherit them in your project in CMOD. Thereafter you do coding and other things like making your subscreens or adding fields to standard tables in respective exits.

    To see the effect of your whole project you must activate each componnents of your enhancements.

    Reward if useful.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 07:04 AM

    Hi,

    Mainly Userexits For Adding our own code with out disturbing the SAP Standard Transactions.

    For Example When i create a customer using XD01 Transaction For US customers The Industry sector field should not be blank. This requirement by default SAP is not provided.

    SAP provide only enhancement.we make use o f the enhancement to provide our own requirement.

    SMOD-- Used for Finding the Enhancement.

    CMOD---Create a Custom project and write. our owncode.

    If u found the userexits for any transaction execute the below code and give the Transaction code. U get all the enhancements availble for that transaction:

    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.

    If it helpful rewards points.

    Regards

    Pratap.M

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.