User exit theory and practical knowledge (Pls help experts)

Hi Experts,
Kindly help me to know about user exit.
Thanks in advance
Will reward  points.

Hi,
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 <3 digit suffix>
Example:
The program for transaction VA01 Create salesorder is SAPMV45A
If you search for CALL CUSTOMER-FUNCTION i 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.
3. Using Project management of SAP Enhancements, we want to create a project to enahance trasnaction 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 in 1 project. If the enhancement is already 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 craete a salesorder. 
Note that Sold-to-party now automatically is "2155"
Regards,
M.K

Similar Messages

  • User exit EXIT_SAPLL03T_002 and jobs

    Hi everybody,
    I have a problem with user exit EXIT_SAPLL03T_002 and trx LT12, i put code (the code is in the end) in the user exit in order to update the field QNAME from the standar table LTAP, the sentences for the update are in a job.
    The problem is when a run the LT12, put the order and press enter the trx finish normally, but when i see the jobs resumen (SM37) there isnt any job.
    Thank you for your help, see you.
      INCLUDE ZXLTOU02                                                   *
    DATA:
        WJ_JTANUM LIKE LTAP-TANUM,
        WJ_LGNUM LIKE LTAP-LGNUM,
        WJ_WERKS LIKE LTAP-WERKS,
        WJ_USER LIKE SY-UNAME,
    Parametros para el Job
        l_numero  LIKE tbtcjob-jobcount,    "ID de un job de fondo
        l_fecha   LIKE tbtcjob-laststrtdt,  "Fecha de ejecución más tardía
        l_hora    LIKE tbtcjob-laststrttm,  "Ultima hora de ejecución para
        l_jobname LIKE tbtco-jobname VALUE 'JOB_RF',
        W_USER LIKE SY-UNAME,
        W_HORA LIKE SY-UZEIT,
        W_DIA LIKE SY-DATUM.
    GET PARAMETER ID 'mb_usuario' FIELD W_USER.
    Solo lo realiza para la transaccion LM05 y LM07
    y si es por logueo No SAP
    ***ANTIGUO
    *IF ( SY-TCODE EQ 'LM05' OR
      SY-TCODE EQ 'LM07' OR SY-TCODE EQ 'LM03' OR
      SY-TCODE EQ 'LM04') AND ( W_USER NE '' ).
    **********ACTUALIZADO 07/02*********
    IF ( SY-TCODE EQ 'LM05' OR
       SY-TCODE EQ 'LM07' OR SY-TCODE EQ 'LM03' OR
       SY-TCODE EQ 'LM04' OR SY-TCODE EQ 'LT12' ) AND ( W_USER NE '' ).
    ojo
      UPDATE ZTMB_USERCOLA
        SET STATU = ' ' DOCNUM = ' '
        WHERE
        BNAME = W_USER.
      GET PARAMETER ID 'mb_hora' FIELD W_HORA.
      GET PARAMETER ID 'mb_dia' FIELD W_DIA.
      CALL FUNCTION 'JOB_OPEN'
             EXPORTING
                  jobname          = l_jobname
             IMPORTING
                  jobcount         = l_numero
             EXCEPTIONS
                  cant_create_job  = 1
                  invalid_job_data = 2
                  jobname_missing  = 3
                  OTHERS           = 4.
        SUBMIT ZUPDATE_LTAP
            AND RETURN
              VIA JOB l_jobname NUMBER l_numero
                WITH WJ_TANUM = T_LTAP_VB-TANUM
                WITH WJ_LGNUM = T_LTAP_VB-LGNUM
                WITH WJ_WERKS = T_LTAP_VB-WERKS
                WITH WJ_USER = W_USER.
      Llama a la funcion para cerrar el Job
        CALL FUNCTION 'JOB_CLOSE'
             EXPORTING
                  jobcount             = l_numero
                  jobname              = l_jobname
                  strtimmed            = 'X'  "Inicio inmediato
             EXCEPTIONS
                  cant_start_immediate = 1
                  invalid_startdate    = 2
                  jobname_missing      = 3
                  job_close_failed     = 4
                  job_nosteps          = 5
                  job_notex            = 6
                  lock_failed          = 7
                  OTHERS               = 8.
    ENDIF.
    REPORT ZUPDATE_LTAP .
    PARAMETERS:
          WJ_TANUM LIKE LTAP-TANUM, " Numero de OT
          WJ_LGNUM LIKE LTAP-LGNUM, " Almacen
          WJ_WERKS LIKE LTAP-WERKS, " Centro
          WJ_USER LIKE SY-UNAME,    " Usuario SAP
          W_QNAME LIKE LTAP-QNAME.
    data: w_actual, w_timeout type i.
      Actualiza el campos de usuario
    w_actual = '0'.
    w_timeout = 0.
    while w_actual = '0' and w_timeout < 300.
      w_timeout = w_timeout + 1.
      WAIT UP TO 7 SECONDS.
      UPDATE LTAP
        SET QNAME = WJ_USER ZZRF_BNAME = WJ_USER
      WHERE
        TANUM = WJ_TANUM
            AND
        LGNUM = WJ_LGNUM
            AND
        WERKS = WJ_WERKS.
    AGREGANDO 4 ENERO
      UPDATE ZTMB_USERCOLA
        SET TPICKEO = SY-UZEIT FPICKEO = SY-DATUM
      WHERE
        LGNUM = WJ_LGNUM
            AND
        BNAME = WJ_USER.
    AGREGANDO 4 ENERO
      if sy-subrc = 0.
        w_actual = '1'.
       UPDATE LTAK SET ZZRF_BNAME = WJ_USER
       WHERE TANUM = WJ_TANUM AND
             LGNUM = WJ_LGNUM.
      endif.
      commit work.
    endwhile.

    Hi,
    Check the print parameters. Probably after execution you may be deleting the job.
    You can change the print parameters during runtime.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
       EXPORTING
         no_dialog                    = 'X'
         user                         = sy-uname
       IMPORTING
      OUT_ARCHIVE_PARAMETERS       =
         out_parameters               = params
         valid                        = ws_valid.
      IF ws_valid <> space.   
        params-pdest = 'LOCL'.  "Destination
        params-primm = ''.      "Print Immediately
        params-prnew = 'X'.     "New Spool Request.
        params-armod = '1'.     "Print: Archiving Mode - Print Only
        params-linct = 65.      "Rows
        params-linsz = 255.     "Cols
        params-paart = 'X_65_255'.
        params-prrec = sy-uname.  "User name
        params-prsap = ''.      "Print: SAP Cover Page
        params-prunx = ''.      "PRINT: Host spool cover page
        params-prcop = '001'.   "number of copies
        SUBMIT zmib_fiber_link_background
               WITH file     = i_file_list-name
               WITH rb1      = space
               WITH rb2      = c_x
               WITH p_launch = c_x
      VIA JOB ws_c_session NUMBER ws_c_jobnum
      EXPORTING LIST TO MEMORY 
        TO SAP-SPOOL
        WITHOUT SPOOL DYNPRO
        SPOOL PARAMETERS params
        AND RETURN.
    endif.
      CALL FUNCTION 'JOB_CLOSE'
           EXPORTING
                jobcount             = ws_c_jobnum
                jobname              = ws_c_session
                strtimmed            = 'X'
           EXCEPTIONS
                cant_start_immediate = 1
                invalid_startdate    = 2
                jobname_missing      = 3
                job_close_failed     = 4
                job_nosteps          = 5
                job_notex            = 6
                lock_failed          = 7
                OTHERS               = 8.
    Also check the sy-subrc after JOB_OPEN.
    Regards
    Subramanian

  • BAPI,BADI ,BDC,ALE ,IDOC,USER EXIT,VALIDATION AND SMART FORMS.

    Dear Experts,
    I am pretty new in BAPI,BADI ,BDC,ALE ,IDOC,USER EXIT,VALIDATION AND SMART FORMS.
    Pls let me know for these topics shall i put the question in this community or should i put in any other form. Pl suggest me .
    Regards
    Shivas

    Plz SEARCH in SCN before posting ,you will get lot of posts .
    Don't use all caps in the subject line

  • Difference between user exit,enhancement and BAdi

    hello guys,
    what is the difference between user exit,enhancement and BAdi.
    Please do let me know..
    Thanks in advance.
    regards,
    praveen.

    Pls do search the forum before posting*

  • How do I delete my old iMessage email and change to my current one, that Im using when I buy apps and so on. The old one wont go away when I turn iMessage on and of again. pls help

    How do I delete my old iMessage email and change to my current one, that Im using when I buy apps and so on. The old one wont go away when I turn iMessage on and of again. pls help
    Anyone had the same?

    How do I delete my old iMessage email and change to my current one, that Im using when I buy apps and so on. The old one wont go away when I turn iMessage on and of again. pls help
    Anyone had the same?

  • Please send material or good lionk on USER-EXIT,BADI and ENHANCEMENT

    Hi All,
    Please send some step by step material or good lionk on USER-EXIT,BADI and ENHANCEMENT which will be usefull for beginners like me.
    Thanks in advance
    Srikanta

    Hi Srikanta,
    Please see the SDN page for ABAP Enhancements and Modifications:
    https://www.sdn.sap.com/irj/sdn/abap?rid=/webcontent/uuid/109f5161-ee76-2910-cb99-db10b559ef4b [original link is broken]
    Cheers,
    Ville

  • A/R User Exit Spec and code

    The spec -
    1.     Canadian tax - currently based on Freight type:   Read the country(?) Ship-from (plant jurisdiction) to Ship-to(customer jurisdiction) and the inco term on the line item of the sales order and if it's not equal to 'DDP' the line item tax classification will be set to '0' exempt. (This is freight that comes into Canada from the US)
    We will look at the shipto and shipfrom txjcd on the sales order document and billing document along with the inco term logic and we will tax freight when they are both Canada
    Example Scenario:
    For Freight charges where the Ship from is in Canada (Bedco, Artmedco, etc) and the Ship-to is in Canada the freight will always be taxable regardless of the inco term. This is freight that ships within Canada, no boarder crossing.
    2.     Regular Freight - US & Canada:  If separate line item on sales order, it may be exempt from tax based upon state. revisit
    a.     D.1 Freight included on the line item
    i.     The freight is passed to the external system by populating the field FREIGHT. The freight amount is always included in the base amount.
    ii.     An example to fill the freight using the user-exit:
    iii.     In the customer pricing procedure (for example ZUSA01) enter ‘4’ in the subtotal field of the freight condition type (OTC must have this configuration in the pricing procedure for the freight pricing conditions).
    iv.     In the customer structure CI_TAX_INPUT_USER, add the field KZWI4 as in KOMP-KZWI4.
    v.     In the user-exit, add the code CH_USER_CHANGED_FIELDS-FREIGHT_AM = I_INPUT_USER-KZWI4.
    3.     For PO Specific A/R Tax Exemptions using material tax class of ‘2’, pass the TAXM1 field to the ACCOUNT_NO field in Taxware
    oSolution:
    For PO Specific Tax Exemptions – CSR will go to the line item detail “Billing” Tab, Tax Classification field (TAXM1) and change that to “2” – One-Time Exemption. Configuration complete. 
    CSR will go to the “Text” Tab, Internal Item Notice and CSR will provide a brief description as to why that line is tax exempt.
    This the code----
    TABLES: KNVV, KNA1, KOMK, MLAN, T001W, KNVI.
    DATA: w_taxm1 LIKE mlan-taxm1,
          i_kna1 LIKE kna1,
          c_com_tax type com_tax,
          i_komk LIKE KOMK.
    *--- if this freight comes into canada from US then set TAXM1 to 0
    *----otherwise set TAXM1 to 2 and apply frieght charges. Set ACCNT_CLS
    *----to 'Y' each time TAXM1 is passed to ACCNT_NO.
    IF KNA1-LAND1 EQ 'CA'.
      IF C_COM_TAX-TXJCD_SF EQ C_COM_TAX-TXJCD_ST.
        CH_USER_CHANGED_FIELDS-FREIGHT_AM = I_INPUT_USER-KZWI4.
        w_taxm1 = 2.
        CH_USER_CHANGED_FIELDS-ACCNT_NO = W_TAXM1.
        CH_USER_CHANGED_FIELDS-ACCNT_CLS = 'Y'. 
      ELSEIF C_COM_TAX-TXJCD_SF NE C_COM_TAX-TXJCD_ST.
        C_COM_TAX-TXJCD_SF = C_COM_TAX-TXJCD_ST.
        C_COM_TAX-TXJCD_POA = C_COM_TAX-TXJCD_ST.  
        SELECT SINGLE * FROM KNVV
                        WHERE INCO1 = KOMK-INCO1
                        AND INCO1 NE 'DDP'.                     
        IF SY-SUBRC EQ 0.
          w_taxm1 = 0.
          CH_USER_CHANGED_FIELDS-ACCNT_NO = W_TAXM1.
          CH_USER_CHANGED_FIELDS-ACCNT_CLS = 'Y'.
        ENDIF.
      ENDIF.
    ENDIF.
    SELECT SINGLE taxkd FROM knvi INTO knvi-taxkd
                        WHERE kunnr = i_komk-kunwe
                        AND aland = i_komk-land1.
    IF SY-TCODE = 'VA01' OR SY-TCODE = 'VA02' OR SY-TCODE = 'VA03' OR
    SY-TCODE = 'VF01' OR SY-TCODE = 'VF02' OR SY-TCODE = 'VF03' OR SY-TCODE
    = 'VF04' OR SY-TCODE = 'VF05' OR SY-TCODE = 'VF05'.
       SELECT SINGLE * FROM kna1 INTO i_kna1
                       WHERE kunnr = i_komk-kunwe.
       IF i_KNA1-land1 EQ 'CA'.
          C_COM_TAX-TXJCD_SF = C_COM_TAX-TXJCD_ST.
          C_COM_TAX-TXJCD_POA = C_COM_TAX-TXJCD_ST.
       ENDIF.
    ENDIF.
    I am able to enter the user exit, but there is no value for KNA1-LAND1 or C_COM_TAX-TAXJCD_SF or C_COM_TAX-TAXJCD_ST. Does anyone what I am missing ? Please help.
    Thanks in advance !!!!
    N

    Hi NP ,
    which User exit ur using ? Are u talking abt MIRO or VF01.
    Regards
    Prabhu

  • Difference in user exit , fm and includes

    HI,
    What is user exit , function module and includes? What is the difference among them? When and how to use them? Please provide example.
    Regards,
    Pramod

    Hi Pramod,
    user exits, function modules and includes can not be compared to each other. Each one of them carry their own purpose and functionality.
    User exit's help you in achieving the additional functionality that standard SAP doesnt offer.
    For example, if your client requirement is add another tab in sales order in addition to the existing ones............it can be done using the user exit.
    SAP has provided several user exits through which you provide the additional functionality to the client without disturbing the SAP standard code.
    you can view SAP standard user exits using t-code: SMOD
    Function modules help you in carrying out a specific task. They can be called into a program to perform a particular task and are resuable any number of times i.e. can be called into any program to perform the same task.
    SAP has already provided many function modules, for example -  for determining exhange rates, reading texts etc.
    Apart from the SAP standard ones, you can also develop your own function module using transaction code SE37 and use them appropriately.
    Includes can be defined as sub programs.........they are part of a program. Include can either be local or global i.e. can be restricted to be used in a particular program and can be made available to other programs.
    Basically, a main program is divided into several includes for a better understanding.
    REWARD POINTS IF HELPFUL
    Regards
    Sai

  • How to get date and time? pls help~   ~.~

    i tried to get time and date, but dint noe hw to get it.. anyone knows hw to get it? pls help mi ~.~
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.Calendar.*;
    public class Login extends JFrame
    private JFrame mainFrame;
    private JPanel p1;
    private JLabel lblUserId, lblPassword;
    private JTextField tf1, tf2;
    private JButton btnLogin, btnClear;
    public Login()
         mainFrame=new JFrame();
         mainFrame.setTitle("Student Attendance System");
         mainFrame.setSize(400,200);
         mainFrame.setLocation(100,100);
         mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         p1=new JPanel();
         p1.setLayout(new GridLayout(3,2));
         lblUserId=new JLabel("User ID");
         lblPassword=new JLabel("Password");
         tf1=new JTextField(20);
         tf2=new JTextField(20);
         btnLogin=new JButton("Login");
         btnLogin.addActionListener(new ButtonHandler());
         btnClear=new JButton("Clear");
         btnClear.addActionListener(new ButtonHandler());
         p1.add(lblUserId);
         p1.add(tf1);
         p1.add(lblPassword);
         p1.add(tf2);
         p1.add(btnLogin);
         p1.add(btnClear);
         mainFrame.add(p1);
    mainFrame.setVisible(true);
    //inner class event handler
    public class ButtonHandler implements ActionListener
         public void actionPerformed(ActionEvent evt)
              Calendar rightNow = Calendar.getInstance();
              if(evt.getSource()==btnLogin)
                   String login=tf1.getText();
                   String password=tf2.getText();
                   JOptionPane.showMessageDialog(mainFrame, "Student ID "+login+" Login at " + rightNow ,
                   "Response", JOptionPane.PLAIN_MESSAGE);
              if(evt.getSource()==btnClear)
                   tf1.setText("");
                   tf2.setText("");
    public static void main(String []args)
         JFrame.setDefaultLookAndFeelDecorated(true);
         Login l=new Login();
    }

    First off, from http://www.catb.org/~esr/faqs/smart-questions.html
    h1. How To Ask Questions The Smart Way:
    h3. Write in clear, grammatical, correctly-spelled language
    More generally, if you write like a semi-literate boob you will very likely be ignored. So don't use instant-messaging
    shortcuts. Spelling "you" as "u" makes you look like a semi-literate boob to save two entire keystrokes. Worse: writing like
    a l33t script kiddie hax0r is the absolute kiss of death and guarantees you will receive nothing but stony silence (or, at best,
    a heaping helping of scorn and sarcasm) in return.
    Next, use a SimpleDateFormat object. You can use it directly or use a date format string to tell it how you want your date string formatted. The API will give you lots of information on how to use this. Note that you'll have to translate the Calendar object to a date object via the getTime() method:
        class ButtonHandler implements ActionListener
            public void actionPerformed(ActionEvent evt)
                Calendar rightNow = Calendar.getInstance();
                //** use SimpleDateFormat
                SimpleDateFormat dateFormat = new SimpleDateFormat();
                String dateString = dateFormat.format(rightNow.getTime());
                if (evt.getSource() == btnLogin)
                    String login = tf1.getText();
                    String password = tf2.getText();
                    JOptionPane.showMessageDialog(mainFrame, "Student ID " + login
                            + " Login at " + dateString,
                            "Response",
                            JOptionPane.PLAIN_MESSAGE);
                if (evt.getSource() == btnClear)
                    tf1.setText("");
                    tf2.setText("");
        }Finally, when posting your code, please use code tags so that your code will retain its formatting and be readable. To do this, either use the "code" button at the top of the forum Message editor or place the tag &#91;code] at the top of your block of code and the tag &#91;/code] at the bottom, like so:
    &#91;code]
      // your code block goes here.
    &#91;/code]

  • Vl31n & Vl32n user-exits checking to identify which one helps...how to do

    I have to make sure that the manufacturing date given while batch split has to be updated in the document details.
    Basically I have found 17user exits under vl31n tcode...
    except one user-exit all the other user-exits are not activated.
    I am not expert in user-exits.. I want to activate all the user exits and test any user-exits helps me.
    For that what I need to do initially .  Could you please help me ..?
    I need to create project in cmod ?
    Please guide me- thanks in advance.

    Hi,
    In VL31 program put break point at all occurrances of function module CALL-CUTOMER .Each CALL-CUSTOMER refers to an enahancement component in a  user exit. When transaction is running it goes into each of this CALL-CUSTOMER function module. Check whether your required functionality can be achieved in that exit. After finding correct user exit, create project for that and proceed.
    Aswarth

  • VA02 User exit - authorization (AND same requirement for IW32)

    I require user exits in VA02 and IW32 that allows me to stop some users profile from changing Sales Orders and Service Orders.
    Our idea is to create an Autorization object and asign it to a user profile.
    When users try to Modify a Sales order or a Service Order, system should verify authorization object first. If not then user cannot access to the document.
    User exits should be available when document is going to be open, not after opening (meaning that user exits where saving do not work either).
    Thanks for your help

    If you require some user to use VA02 or IW32 then at the t-code level you can set the authorization.
    But when you say "User exits should be available when document is going to be open, not after opening", it is confusing.
    Userexit works only after the document is "opened"
    You can try fieldexit.
    This weblog (/people/ashish.mohapatra/blog/2007/11/28/sd-userexit--i) may also be helpful to you.

  • Credit Management: User Exit LVKMPTZZ and LVKMPFZ1

    Hi,
    I'm trying to implement crdit management and have a special requirment which is not satified by the standard risk control checks.
    Hence i'm planning to implement the USER1 check in the risk catogery.
    I'm aware that some ABAP code has to be done to activate and the user exits are LVKMPTZZ and LVKMPFZ1.
    Where should be the code written LVKMPTZZ or LVKMPFZ1.
    I guess the code has to be written in LVKMPTZZ  and call the exit LVKMPFZ1 which in turns call the function module SD_ORDER_CREDIT_CHECK.
    Am I true in my understanding.
    Does editing LVKMPTZZ SAP access key.
    Please help.
    Thank you in advance.

    Hiii
    You can write the code to call the funtion module for credit check in LVKMPTZZ but for same you need Access key from SAP to edit the Include.
    Regards
    Shambhu Sarkar

  • My gmail wont link up to my phone, it says invalid password,however i log in on my computer with this gmail acc and password. Pls help

    My gmail acc wont link up to my iphone it says invalid password..although I get in on my computer with that username and password.pls help!!

    double check the passowrd.  Failing that delete the account form the phone and carefully re enter all the information making sure the incoming and outgoing server names are correct as well as user name and password

  • I forgot my icloud email and my password pls help me ineed my phone fix

    i forgot my icloud email and password what can i do ? pls help me

    Welcome to the Apple community.
    Unfortunately, you cannot do very much with your phone unless you get assistance from the previous owner, they should either provide you with the password to unlock it or remove their account from the phone entirely remotely through iCloud.com > Find My Phone.

  • User exit activation and deactivation in production server

    If I activate project of corresponding user exit and after transporting the request to Production ,
    then for deactivating the project will a request is generated or should i login to Production for deactivating the project.
    Thanks

    Hi,
    Deactivating the project would again ask for a request so we have to deactivate in development and take it via a transport to production.
    Regards,
    Himanshu

Maybe you are looking for