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

User Exit

Can any one have User Exits Documents with step by step examples?

If so mail to me dponmurugesh@eminentlabs.com

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 12, 2007 at 12:13 PM

    Hi Pon,

    FUNCTION field_exit_bstnr.*"----


    ""Local interface:" IMPORTING" REFERENCE(INPUT)" EXPORTING" REFERENCE(OUTPUT)*"----

    -


    • create field symbol FIELD-SYMBOLS: <status>.* Assign value of variable from calling prog to field symbol ASSIGN ('(SAPMM06E)RM06E-BSART') TO <status>.* Display value retrieved in message* Note: Messages of type i and w are not allowed IF sy-subrc = 0. MESSAGE e003(zr) WITH <status> 'kkk'. ENDIF.ENDFUNCTION.

    Implementing Business Add-Ins (BADI)


    The use of object orientated code within SAP has lead to new method of enhancing standard SAP code called Business Add-Ins or BADI's for short. Although the implementation concept is based on classes, methods and inheritance you do not really have to understand this fully to implement a BADI. Simply think of methods as a function module with the same import and export parameters and follow the simple instructions below.
    Steps:1. Execute Business Add-In(BADI) transaction SE182. Enter BADI name i.e. HRPBSGB_HESA_NISR and press the display button 3. Select menu option Implementation->Create4. Give implementation a name such as Z_HRPBSGB_HESA_NISR5. You can now make any changes you require to the BADI within this implementation, for example choose the Interface tab6. Double click on the method you want to change, you can now enter any code you require.7. Please note to find out what import and export parameters a method has got return the original BADI definition (i.e. HRPBSGB_HESA_NISR) and double click on the method name for example within HRPBSGB_HESA_NISR contract is a method8. When changes have been made activate the implementation

    reward pts if found usefull:)

    Regards

    Sathish

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 12, 2007 at 11:52 AM

    Hi,

    User exits are predefined includes provided by SAP with some subroutines that start with "userexit-" you can put your code in these subroutines so that they are executed.

    AND

    Customer 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 functionmodule exits is:

    EXIT_<program name><3 digit suffix>

    The call to a functionmodule exit is implemented as:

    CALL CUSTOMER.-FUNCTION <3 digit suffix>

    To find a Exit.

    Goto Transaction -- Find The Package

    SMOD >f4 >Use the Package here to Find the Exits In the Package.

    Else if you Want to search by Application Area wise ,

    There is one more tab to find the Exits in the Respective Application Area.

    Implementing the Exit-- CMOD Create Projects Assgn your Component .

    Now Run ur Transaction to Check if it Triggers.

    Thats it..

    Suppose you need to find out all the user exits related to a tcode.

    1. Execute the Tcode.

    2. Open the SAP program.

    3. Get the Development Class.

    4. Execute Tcode SE84.

    5. Open the Node 'Envir. -> Exit Techniques -> 'Customer Exits -> Enhancements'

    6. Enter the Development class and execute.

    Check out this thread..

    1. Type the transaction : system->status-> <PROG. NAME>

    2 open SE37 , type EXIT<PROG NAME> and press F4 to get the list of function exits available.

    3. Open CMOD utilities->SAP enhancements

    EDIT->All selections

    4.type the function module name obtained in step 2, in fields 'component name' in 'additional selections' block. and execute.

    5. The displayed list contains the enhancements names for the transaction You were looking for.

    6. Create a project in CMOD and the code in default include->activate.

    http://www.erpgenie.com/sap/abap/code/abap26.htm

    which gives the list of exits for a tcode

    http://help.sap.com/saphelp_nw04/helpdata/en/bf/ec079f5db911d295ae0000e82de14a/frameset.htm

    For information on Exits, check these links

    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

    http://www.sapgenie.com/abap/code/abap26.htm

    http://www.sap-img.com/abap/what-is-user-exits.htm

    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction

    http://www.easymarketplace.de/userexit.php

    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

    http://www.sappoint.com/abap/userexit.pdfUser-Exit

    http://www.planetsap.com/userexit_main_page.htm

    User-Exits

    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

    http://www.sap-img.com/ab038.htm

    http://www.planetsap.com/userexit_main_page.htm

    http://www.sap-basis-abap.com/sapab013.htm

    http://sap.ittoolbox.com/documents/popular-q-and-a/user-exits-for-the-transaction-code-migo-3283

    These links will help you to learn more on user exits.

    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

    http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/frameset.htm

    http://www.planetsap.com/userexit_main_page.htm

    http://www.allsaplinks.com/user_exit.html

    www.sap-img.com/abap/what-is-user-exits.htm

    Regards,

    Sesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 12, 2007 at 11:56 AM

    Hi,

    USEREXIT

    User exits allow us to add our own functionality to SAP standard program without modifying it . These are implemented in the form of subroutines and hence are also known as FORM EXITs. The user exits are generally collected in includes and attached to the standard program by the SAP.

    All User exits start with the word USEREXIT_...

    FORM USEREXIT_...

    <User defined code>

    ENDFORM.

    e.g. USEREXIT_SAVE_DOCUMENT_PREPARE

    Example :

    1) ADDING OF NEW FIELDS IN PRICING

    In Pricing in SD the fields on the basis of which pricing is done are derived from the FIELD CATALOG which is a structure KOMG .This structure is used to transfer transaction data to the pricing procedure in SD and is also known as communication structure. This structure KOMG consists of two tables KOMK for Header related fields and KOMP for item related fields.

    The fields which are not in either of the two tables KOMK and KOMP

    cannot be used in pricing .Sometimes a need arises when the pricing

    is to be based on some other criteria which is not present in the form of fields in either of the two tables.

    This problem can be solved by using USEREXITS which are provided for pricing in SD.

    Pricing takes place both when the SALES ORDER (Transaction VA01) is created as well as when INVOICING (Transaction VF01) is done. Hence SAP provides 2 user exits ,one for sales order processing which is

    USEREXIT_PRICING_PREPARE_TKOMP or

    USEREXIT_PRICING_PREPARE_TKOMK

    Depending upon which table (KOMK or KOMP) the new fields were inserted we use either of the above two user exits. These user exits are found in include MV45AFZZ of the standard SAP sales order creation program SAPMV45A.

    In the case of user exit which will be called when invoicing is done, these are provided in the include RY60AFZZ which is in the standard SAP program SAPMV45A. The names of the user exits are same. i.e.

    USEREXIT_PRICING_PREPARE_TKOMP or

    USEREXIT_PRICING_PREPARE_TKOMK

    These user exits are used for passing the data from the communication structure to the pricing procedure, for this we have to fill the newly created field in the communication structure KOMG for this we fill the code in the above user exit using the MOVE statement after the data that

    has to be passed is taken from the database table by using the SELECT statement. The actual structure which is visible in these user exits and which is to be filled for that particular field is TKOMP or TKOMK.

    Before the coding for these user exits is done, it is necessary to create a new field in either of the two tables KOMK or KOMP .For this purpose includes are provided in each of them .

    To create the field in header data (KOMK) the include provided is KOMKAZ and to create the field in item data(KOMP) the include provided is KOMPAZ.

    One possible example for the need of creating new fields can be e.g. Freight to be based upon transportation zone ,for this no field is available in field catalog and hence it can be created in KOMK and then above user exits can be used to fill the transportation data to it.

    1) MENU EXITS

    Menu exits allow you to add your own functionality to menus. Menu exits are implemented by SAP, and are reserved menu entries in the GUI interface. The developer can add his/her own text and logic for the menu. Function codes for menu exits all start with "+".

    Example: We want to create a new menu item in the Office menu. The text for the menu should be "Run ZTEST", and the menu will run report ZTEST.

    1) Go to transaction SE43 Area Menu Maintenance.

    2) In Area Menu Parameter type 'S000' (S triple Zero).

    3) Select Change and ignore all the warning screens.

    4) Expand the office menu. In the bottom of the office tree you will find a menu named "Customer function".

    5) Double click on the text. In the pop-up screen change the text to "Run ZTEST". Note that the transaction code is +C01. Go to transaction SE93 and create transaction +C01 that calls report ZTEST.

    Now you will se the menu displayed in the office tree. If you delete transaction +C01 again, the new menu will disappear.

    3) SCREEN EXIT

    After you have found one, do as directed in the documentation. Generally, the steps are as follows:

    1. Create a project using CMOD including your enhancement.

    2. Create the append structure with new fields.

    3. Go to the desired function group and create a sub screen with the new fields. Write PBO and PAI for the sub screen, if required.

    4. Use the function exits in the enhancement to link the PBO and PAI of the sub screen with that of the main SAP program supporting the SAP transaction.

    5. Maintain necessary linkage between the sub screen area of standard SAP program with the custom sub screen developed along with the custom program name. This can be done in the project (developed by CMOD including the enhancement) or outside as a part of configuration.

    6. Activate the project.

    7. Test to ensure that required functionality is met

    Hi

    Find the available exits with the following program:::

    &----


    *& Report ZFINDUSEREXIT

    *&

    &----


    *&

    *&

    &----


    report zfinduserexit.

    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).

    write the code in the right form and check by keeping a break point

    Try the following link.

    http://help.sap.com/saphelp_47x200/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/content.htm.

    <b>Reward points</b>

    Regards

    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.