User Exit - EXIT_SAPMF02D_001

Hi All,
I'm currently using this User Exit EXIT_SAPMF02D_001 to do a check for change in Bank details during 'SAVE' from transaction code FD02.
If there is a change (comparing the import tables with a SELECT statement to the database table), I would need to update the import table parameter T_KNBK-BKONT with a special value.
However, my problem is that the value is only updated within the User Exit. Once it returns to the main calling program (SAPMF02D), the updated value is lost. I've checked the codes and concluded that this User Exit only allows checking of data but not changing them. SAP creates a copy of the table before calling the User Exit function module and passed the copy into the Function Module instead.
Can anyone here suggest an alternative for me? I need to change the data during 'SAVE'.
Thanks!
Regards,
Alban

Hi Alban,
I think u can use the following BAdi's
CUSTOMER_ADD_DATA   "Additional Data at Customers"
CUSTOMER_ADD_DATA_CS  "Additional Data at Customers "
CUSTOMER_ADDRSCR_CHG   "Change Address Screen in 
                        the Master Data Maintenance"
u can write ur code for updation of tables that u want.
u have to write this code in method "SAVE_DATA" ,so that
while saving data after cahnge, it will get called.
There are many methods u can appropriate method that u think for ur requirement.
Regards,
Ranjit Thakur.
Mark the Helpful Answers.

Similar Messages

  • Error on reading user exit  EXIT_SAPMF02D_001

    Hello experts,
    Iu2019m working with user exit EXIT_SAPMF02D_001 and need to check certain values which are getting populate in tables I_KNA1 and I_KNVV. I realise these are available within import parameter. When I put a break point then during customer creation/modification before saving all the changes I can come and check all the values within I_KNA1 and I_KNVV but when I tried to write a select using I_KNA1 I get the error saying.
    u201CI_KNA1u201D is not defined in the ABAP Dictionary as a table, projection view or database view.
    Here is my select which gives the above error
      select kunnr ktokd into (v_kunnr, v_ktokd)
        from I_KNA1
           where kunnr = v_kunnr.
      endselect.
    If this is not the way Iu2019m doing in my select to fetch the values from I_KNA1 then how I can get all its values?
    Thanks a lot in advance.

    Hi,
    The importing structure I_KNA1 will contain all the fields available in KNA1. We can directly use I_KNA1-KUNNR and I_KNA1-KTOKD directly. We don't need to fire a select on KNA1 for reading KTOKD value. Just use I_KNA1-KTOKD where ever required.
    Regards,
    Ganga

  • Accessing address in user exit EXIT_SAPMF02D_001 (create/change customer)

    Hi,
    I'm trying to access the address given for a new customer in user exit  EXIT_SAPMF02D_001. I need Street4, which is not available on the i_kna1 object, and therefore I'm trying to play with the i_addrhandle parameter.
    Can this be used with function module GET_ADDR to read addresses before the customer is saved, the following code gives me exception 1.
    ls_addr1-addrhandle = i_addrhandle.
    CALL FUNCTION 'ADDR_GET'
      EXPORTING
        address_selection             = ls_addr1
    IMPORTING
        address_value                 = ls_addr1_val
    EXCEPTIONS
       parameter_error               = 1
       address_not_exist             = 2
       version_not_exist             = 3
       internal_error                = 4
       OTHERS                        = 5
    Regards
    Mattias

    Hello,
    Address handle is used for internal communication in standard program..for the customer creation let's say it would store value like "KNA1                          ADRNR" and for vendor "LFA1                          ADRNR"
    Please use address number in ADDR_GET function module
    Thanks
    Krish

  • User exit for XD01 with delivery priority

    Hi ,
    I am using a user exit EXIT_SAPMF02D_001 for customer master.Below is the piece of code .I am just displaying message based on delivery priority field in the customer master .
    But the probleam is when user only change the value in delivery priority field then only my message should come .But now my logic executes when ever no changes in the delivery priority field also and any touch other than this field also getting the message.
    Means the value in the delivery priority field  not refreshed in the customer master screen .Thats why the message is coming any time when not touching the field also.
    so can somebody suggest what to do?My logic should work only when delivery priority field only changed.
    TABLES:tpakd.
    DATA:l_lprio TYPE lprio,
         l_kztlf TYPE kztlf,
         l_antlf TYPE antlf.
    DATA:l_lp(2) TYPE c VALUE '03',
         l_kz(1) TYPE c VALUE 'B',
         l_an(1) TYPE c VALUE '1'.
    SELECT SINGLE * FROM tpakd
                    INTO tpakd
                    WHERE parvw = 'WE'
                      AND ktokd = i_kna1-ktokd.
    IF sy-subrc = 0 .
      MOVE i_knvv-lprio TO l_lprio.
      MOVE i_knvv-kztlf TO l_kztlf.
      MOVE i_knvv-antlf TO l_antlf.
      IF l_lprio = l_lp AND ( l_kztlf NE l_kz OR l_antlf NE l_an )  .
        MESSAGE w534(zm).
        ELSEIF l_lprio IS NOT INITIAL
                AND ( l_kztlf IS NOT INITIAL
                OR  l_antlf IS NOT  INITIAL
                OR  l_antlf NE '0'
                OR  l_antlf NE '9' ).
        MESSAGE w534(zm) .
      ENDIF.
    ELSE.
      EXIT.
    ENDIF.

    HI
    I think something doesn't sound good in this control
    ELSEIF l_lprio IS NOT INITIAL
      AND ( l_kztlf IS NOT INITIAL
           OR l_antlf IS NOT INITIAL                  "<-------
           OR l_antlf NE '0'
           OR l_antlf NE '9' ).
        MESSAGE w534(zm) .
    ENDIF.
    The control for L_ANTIF seems to be always valid, probably you should use AND insted of OR
    ELSEIF l_lprio IS NOT INITIAL
      AND ( l_kztlf IS NOT INITIAL
           OR ( l_antlf IS NOT INITIAL                  "<-------
           AND l_antlf NE '0'
           AND l_antlf NE '9' ) ).
        MESSAGE w534(zm) .
    ENDIF.
    Max
    Max

  • User exits of enhancement SAPMF02D

    Hi all,
    I need to add an extra input check to customer master. From SMOD I can see that enhancement SAPMF02D contains the user exit EXIT_SAPMF02D_001, but this exit doesn't seem to be triggered when entering/saving the customer data.
    I've searched and found the user exit EXIT_SAPMF02D_800 in SE37, how can I implement this (as part of the SAPMF02D enhancement)? As it is now, I don't get any hits in the where-used-list for this function module.
    All helpful answers will be rewarded!
    - Mari Virik

    Hi again, thanks for your reply!
    I've added both <b>EXIT_SAPMF02D_001</b> and<b> EXIT_SAPMF02D_800</b> to enhancement <b>SAPMF02D</b>. Both function modules are active, and the Z-includes called in the funciton modules are created and activated. After setting breakpoints in these two incloudes, I run FD01/FD02 - but none of the user exits are triggered (the same applies if I run XD01/XD02).
    What I need to do is to create an extra address input check, and I've also checked out BADI <b>CUSTOMER_ADD_DATA</b>, method<b> CHECK_ALL_DATA</b>. But I need to test the fields Street 2, Street 3, and Street 5 - and these fields are not available as input to this method.
    To me it seems that neither the user extis nor the BADI can be used? Is this correct? If so, are there any other options? If they indeed can be used, what am I doing wrong?
    All helpful answers will be rewarded!
    - Mari

  • User exit for VD01 - Create Customer

    I am finding user exit for VD01 - Create Customer.
    I need a newly created Customer number - KNA1-KUNNR.
    I found user exit EXIT_SAPMF02D_001, but if field Customer left blank on screen in VD01, the parameter I_KNA1-KUNNR is blank. Because program genereates KUNNR further.
    Edited by: S S on Dec 23, 2008 7:56 AM

    Dear SS,
    What I understood is system is generating internal number range for customer in your case.
    You want to know the number of customer number.
    I think with this exit EXIT_SAPMF02D_001 you don't get customer number.
    Try with this BADI    CUSTOMER_ADD_DATA  
    Method MODIFY_ACCOUNT_NUMBER. use break point here.
    Then create a customer in VD01 (internal number range). maintain necessary information and save.
    system will take you to debugging mode. here you can see internal number of customer.
    Regards,
    Chandra

  • User exit for VD03 to handle Payment Term (KNVV-ZTERM)

    Hi,
    I need to block a couple of Payment terms in VD03 ( KNVV-ZTERM )
    For that i need to find an exit to handle data associated with KNVV.
    Are there any exits available?
    Regards,
    Remi

    Hi,
    Thank you for the response.
    I tried writting code in the exit :
    EXIT_SAPMF02D_001. (Customers: User Exit for Checks prior to Saving)
      DATA zterm TYPE dzterm.
      "-- Block Payment Terms in SO --
      SELECT SINGLE zterm
             FROM zblkso
             INTO zterm
             WHERE zterm = i_knvv-zterm.
      IF sy-subrc =  0.
        MESSAGE e013(zmsg) WITH i_knvv-zterm.
      ENDIF.
    Set a break point to check whether it goes to that point when i try saving.
    It does not even trigger.
    I needed a point for KNVV much similar to form exit :
    userexit_move_field_to_vbak.
    Regards,
    Remi

  • User exit for xd01

    hi!
    I am opening a customer with trans XD01.
    When I enter the zipcode, i want through the userexit to access external table and update 3 fields  in tables knvv and knb1 before or when saving the transaction.
    if there is no userexit, is it possible when saving xd01
    to trigger a job like a bi and update the relevant tables.

    Hi Yifat
    Look at this exit
    EXIT_SAPMF02D_001    customers: User Exit for Checks prior to Saving
    enhancement name SAPMF02D
    This may help you.
    <b>In this exit you will find an include program ZXF04U01.
    There you have to put you  code for update the relevent tables.</b>
    if it doesn't solve your problem then look for BAdIs
    regards ,
    Amit

  • To find user exit and a screen exit for VD03

    hi ,
    can u please find if there is a user exit and a screen exit to add for adding a Z-field on for the customer master on the shipping tab. i.e VD03 transaction.
    actually i have found the user-exit i.e exit_SAPMF02d_001.
    but this exit is not triggering when i put a breakpoint.
    so can u please tell me the solution for this.
    regards,
    soham p

    Hi,
    try these...
    Enhancement/ Business Add-in            Description
    Enhancement
    SAPMF02D                                User exits: Customer master data
    Business Add-in
    CUSTOMER_ADDRSCR_CHG                    Change Address Screen in the Master Data Maintenance
    CUSTOMER_ADD_DATA                       Additional Data at Customers
    CUSTOMER_ADD_DATA_BI                    Additional Data at Customers (Batch Input and ALE)
    CUSTOMER_ADD_DATA_CS                    Additional Data at Customers (Subscreen Container 4000)
    No.of Exits:          1
    No.of BADis:          4
    Arunima

  • Information on user exits

    hi all ,
           i want to learn user exits , how to  use them and what are the uses of user exit ... can any one tell me the best link or documentation to learn user exits from the basics..
    it will be great favour and person will be rewarded with points
    Thanks and regards
    nikesh kumar

    check the foll link,
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    also refer
    http://www.sap-img.com/abap/what-is-user-exits.htm
    Creating menu exits
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/19762743b111d1896f0000e8322d00/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/83/7a18cbde6e11d195460000e82de14a/frameset.htm
    For screen exits.
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    chech these links for user exists its usefull
    http://www.allsaplinks.com/user_exit.html
    http://help.sap.com/saphelp_47x200/helpdata/en/dd/561602545a11d1a7020000e829fd11/frameset.htm
    http://www.sap-basis-abap.com/sapab013.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    refer
    just refer to the link below for step by step procedure with screen shots
    http://www.sapmaterial.com/?gclid=CN322K28t4sCFQ-WbgodSGbK2g
    Check this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975e643b111d1896f0000e8322d00/frameset.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/52/670ba2439b11d1896f0000e8322d00/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2d40358411d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/10/e7dbde82ba11d295a40000e8353423/content.htm
    http://fuller.mit.edu/tech/dialog_programming.html
    http://sap.mis.cmich.edu/sap-abap/abap09/index.htm
    http://sap.mis.cmich.edu/sap-abap/abap09/sld011.htm
    Also, refer this:
    Overview
    R/3 provides three "customization spots" that allow you to enhance FI/CO features without modifying the standard code. Although often collectively referred to as "user exits," two of the three have different names. SAP Enhancements are used to expand the standard functionality within SAP. Enhancements use function modules and are called from the standard SAP code. Each module in the system has a set of delivered enhancements that help companies expand the standard functionality where they need it. Enhancements were new in release 3.0.
    The Open FI Interfaces or Business Transaction Events are also used to expand the standard functionality within SAP. These events are defined in the IMG. Business Transaction Events were new in release 4.0. They are not available for all modules and are not called on all integrated transactions into FI as of release 4.5B. This will change with each release and should be retested.
    The older User Exits in FI/CO are "Z" programs that are defined in table T80D for client-dependent user exits, and in table T80I for client-independent user exits. These are also used to expand the standard functionality within the FI/CO modules. These User Exits have been available since the early releases of SAP. All of these FI/CO User Exits are listed in this document in the Configuring User Exits (Older). The list is included because these User Exits are not a part of the Enhancements or Business Transaction Events and do not have an Info System for searching.
    Benefits• Standard SAP functionality can be enhanced without modification to the standard code.
    • Upgrades do not erase the functionality and it does not have to be re-transported or re-entered into the system. The enhancements should be thoroughly tested when upgrading to ensure the system will still work as implemented.
    Configuring SAP Enhancements
    Basic Steps in Configuring an Enhancement
    • Find the appropriate Enhancement.
    • Enter the ABAP code in the "Z" program within the function module.
    • Create a project.
    • Add the Enhancement to the project.
    • Activate the project.
    Example Business Scenario for Enhancements
    Company A has a requirement to validate all customer master records created with a U.S. address. The U.S. entity reports on the industry field on the customer master. This is only a U.S. requirement and should not be required for the other countries, so the field status would not work. To accomplish this requirement, Company A will need to set up an Enhancement for the customer master transaction. The necessary steps are detailed below with screenprints. This example was configured in a 4.6C system.
    Detailed Steps
    1. Tools ABAP Workbench Utilities Enhancements Definition Utilities List Enhancements
    2. Do not execute this without any parameters! There are too many Enhancements and it will probably time out. You’re searching for a customer master exit. Enter mast in the short text (see Figure 1). You’ll start there. Searching for an exit can be tricky, so make sure you try several things before giving up.
    3. Execute the search.
    Start Your Search for a Master Exit Here
    4. Look through the list until you find the Enhancement for User exits: Customer Master Data.
    5. Double-click on the enhancement SAPMF02D. This will take you to the details of the Enhancement and list the function modules included in the Enhancement.
    6. To continue, double-click on the function module EXIT_SAPMF02D_001
    7. This will take you to the source code for the function module. Click on the Import tab to review the tables/fields that are available for the Enhancement
    The Tables That Are Available for the Enhancement
    8. To view the tables/fields that can be changed in the function module, click on the Export and Changing tabs. For this function module, these tabs are empty because you can only validate data. You cannot change any fields in this enhancement.
    9. Return to the Source Code tab.
    10. Scroll down until you see the Include statement in the program. The "Z" program listed after the Include is where your code will be written
    Your Program Will Begin After the Include Statement
    11. Double-click on the Include. You will be prompted to create the include. Click on Yes to create.
    12. At this point you will be prompted to enter a development class and to create a transport request. If you do not know which development class to use, please contact your technical team.
    13. Enter the following ABAP code into the program
    User exit to ensure that all US customers have a group key
    entered on the customer master.
    if i_kna1-land1 = 'US' and
    i_kna1-brsch = ' '.
    message e001(F2).
    endif.
    The ABAP Code You Need to Enter
    14. Note that the table name matches the table name in the import tab tables.
    15. In this example you are using the standard message class F2 with message number 001. Normally, you will create your own message within your own message class. All customer message classes must begin with a "Z" and are created in transaction SE91.
    16. Save the program.
    17. The next step is to create the project. Go to transaction code CMOD or follow menu path: Tools ABAP Workbench Utilities Enhancements Project Management.
    18. Enter the project name; begin the name with a "Z."
    19. Click on the Create button.
    Click on Create After You Type in the Project Name
    20. Enter in a description for the project.
    21. Click on the Enhancement Assignments button.
    22. You will be prompted to save the enhancement. Click on Yes.
    23. At this point you will be asked for a development class and to create a transport for the project. You may use the same one created when adding the ABAP code to the function module.
    24. Enter the name of the enhancement SAPMF02D (see Figure 6).
    Enter the Name of the Enhancement Here
    25. Save the project.
    26. Back out of the enhancement assignment.
    27. Activate the project by hitting the Activate button.
    The SAP Enhancement is ready to be tested! Try creating a customer with U.S. as the country and a blank group key. Be sure to test one with a group key to make sure the message is not displayed in error as well.
    Configuring Business Transaction Events
    Basic Steps in Configuring an Event
    • Make sure the application is active for Business Transaction Events.
    • Copy the sample interface function module into a "Z" function module.
    • Enter the ABAP code into the source code section of the new "Z" function module. You may choose to create a "Z" program to enter the code into and then insert the "Z" program into your function module source code.
    • Activate the function module.
    • Assign the function module to the event, country and application.
    Example Business Scenario for Business Transaction Events
    Company A would like to copy the group key field from the vendor master into the allocation field on all the line items within a vendor invoice and payments, including the vendor lines. This requirement assumes only one vendor is posted to in a document.
    To accomplish this requirement, Company A will use the Business Transaction Event 1130, Post Document: SAP Internal Field Substitution.
    1. IMG Menu Path: Financial Accounting Financial Accounting Global Settings Use Business Transaction Events Environment Infosystem (Processes).
    2. Find the correct Business Event. You are updating a field, so you select the Processes Info System instead of the Publish and Subscribe Info System.
    3. Execute the search with the defaults.
    4. Find the correct interface for updating a document: Post Document: SAP- Internal Field Substitution
    Find the Correct Interface for the Business Event
    5. Put your cursor on the event and click on the Sample Function Module button.
    6. You are now in transaction SE37 – Function Builder. This is the function module (sample_process_00001130) you will need to copy into a "Z" name function module for your coding
    Figure 8. This Is the Function Module You Need to Copy Your "Z" Name Function Module
    7. Click on the Copy button.
    8. Enter the "Z" function module name in the To Function Module field
    9. Enter a Function Group. If you need to create a "Z" function group, go to transaction code SE37 and follow menu path: Go to Function Groups Create Group. A function group is a logical grouping of function modules, and the ABAP code is generated for function groups. You will be prompted for a development class and transport when creating the function group.
    Enter Your "Z" Function Module Name Here
    10. In Function Builder (transaction SE37), enter the new "Z" function module. Click on the Change button.
    11. The system will default into the source code screen where you may enter your ABAP code.
    12. Notice the tables available for the code. Additional tables may be declared if necessary.
    13. Enter the following source code
    tables: lfa1.
    data: z_groupkey like lfa1-konzs.
    z_groupkey = ' '.
    loop at t_bseg.
    check for vendor lines. If one is found, read the vendor master and
    retrieve the group key field.
    if t_bseg-koart eq 'K'.
    select single konzs from lfa1 into z_groupkey
    where lifnr = t_bseg-lifnr.
    endif.
    Move the group key field into all line items allocation field.
    loop at t_bsegsub.
    t_bsegsub-zuonr = z_groupkey.
    modify t_bsegsub index sy-tabix.
    endloop. "t_bsegsub
    endloop. "t_bseg
    The Screen Where You Enter Your Source Code
    14. Save the function module.
    15. Back out to the main Function Builder screen by clicking on the green arrow button.
    16. Activate the function module by clicking on the Activate button
    . Activate the Function Module from This Screen
    17. Assign the function module to the event in the IMG: Financial Accounting Financial Accounting Global Settings Business Transaction Events Settings Process Function Modules of an SAP Appl.
    18. Hit enter past the warning messages that this is SAP data.
    19. Click on the New Entries button.
    20. Enter the process for your interface. In your example it is 00001130.
    21. Enter the country the interface is valid for. If it is valid for all countries, leave this field blank.
    22. Enter the application the interface should be called for. If it should be called for all applications, leave this field blank. Please note that not all integrated transactions are programmed to go through these interfaces! You will need to test to find out!
    23. Enter the new "Z" function module
    Enter Your New "Z" Function Module Here
    24. Save the settings. At this point you will be prompted for a CTS number for the configuration change.
    25. The Business Transaction Event is complete! You are ready for testing.
    Configuring User Exits (Older)
    Basic Steps in Configuring an User Exit
    • Create a "Z" program for the User Exits and enter the necessary ABAP code.
    • Enter the new program name into table T80D.
    • Configure the application to call the User Exit.
    List of User Exits
    • Variable Field Movements
    • Substitutions in FI, CO, PCA
    • Validations in FI, CO, PCA
    • Rollups in SPL
    • Fixed Field Movements in SPL
    • Cost Center Summarization on Detail Screen
    • Sets Formula Variables
    Example Business Scenario for User Exits
    Company A would like to add a "Z" field in the Special Purpose Ledger to capture a Business Unit field for reporting. They have used all the standard SAP fields such as Business Area and Profit Center. The field will only be used for reporting and is only needed in the Special Purpose Ledger. You created a special ledger table (ZZSPL1) with field Z_BUNIT and need to populate this field based on a combination of G/L account, fund and functional area.
    To accomplish this requirement, Company A will use the Variable Field Movement User Exit. To make maintenance easier, table ZZBUSUNIT was created with the G/L account, fund and functional area fields as key fields, and the business unit field as a non-key field. You generated the table maintenance so the table could be updated using transaction SM30. SAP users update the business unit determination rules in table ZZBUSUNIT by entering the G/L account, fund and functional area, and then the business unit that combination should be posting to. The User Exit will read table ZZBUSUNIT using the G/L account, fund and functional area from the posting transaction and determine the business unit. The steps for using the user exit are detailed below. This example was created on a 4.6C system.
    1. Copy the delivered template User Exit program RGIVU000_TEMPLATE into a "Z" program. Follow menu path Tools ABAP Workbench Development ABAP Editor (transaction code SE38). In early releases, the delivered program was RGIVU000.
    2. You will be prompted for a development class and a transport. Please check with the technical team for the correct development class.
    3. At the initial ABAP Editor screen, enter your new "Z" program name, select the Source Code button and click on Change
    To Enter Your New Code, Select Source Code and Click on the Change Button
    4. Enter the following code in the User Exit (Figure 14):
    FORM E01_MVC USING FROM_FIELD TO_FIELD.
    to_field = 'CORP'. "Set a default business unit.
    read table zzbusunit to determine the business unit field.
    select single z_bunit from zzbusunit into to_field
    where hkont = accit_glx-hkont and
    geber = accit_glx-geber and
    fkber = accit_glx-fkber.
    ENDFORM.
    Figure 14. Enter Your New Code at This Screen.
    5. Activate the program by clicking on the Activate button.
    6. Change the configuration in the User Exit table to point to your new "Z" program.
    7. Follow the IMG menu path: Financial Accounting Special Purpose Ledger Basic Settings User Exits Maintain Client Specific User Exits.
    8. The entry to maintain is application area GIMV: Variable Field Movement. Enter your "Z" program
    Enter Your "Z" Program in the Application Area GIMV: Variable Field Movement
    9. Save the changes.
    10. The final configuration step is to assign the User Exit in the variable field movement for your special ledger table. In the IMG: Financial Accounting &#61664; Special Purpose Ledger &#61664; Basic Settings &#61664; Master Data &#61664; Maintain Field Movements. Field movements control how the fields in a special ledger table are populated. They can be populated straight from other fields in a posting or through User Exits.
    After You Assign the Business Unit Field and the G/L Account, the Exit Field Should Contain U01.
    11. Assign the business unit field as a receiver and the G/L account as the sender. The Exit field should contain U01 (see Figure 16).
    12. The User Exit number U01 calls User Exit E01_MVC form in the "Z" program.
    13. Save the field movement.
    14. You are ready to test your User Exit!
    Reward points if useful.

  • User exits & varients in SAP

    hi
      i want to know conceptually what are User Exits and  varients , what is the purpose of using these .
       iAftr learing that i want to a practical example on both topics then , if any one have some good material on these plz send me on [email protected]
    thanx

    Hi
    User Exits in FI/CO
    R/3 provides three "customization spots" that allow you to enhance FI/CO features without modifying the standard code. Although often collectively referred to as "user exits," two of the three have different names. SAP Enhancements are used to expand the standard functionality within SAP. Enhancements use function modules and are called from the standard SAP code. Each module in the system has a set of delivered enhancements that help companies expand the standard functionality where they need it. Enhancements were new in release 3.0.
    The Open FI Interfaces or Business Transaction Events are also used to expand the standard functionality within SAP. These events are defined in the IMG. Business Transaction Events were new in release 4.0. They are not available for all modules and are not called on all integrated transactions into FI as of release 4.5B. This will change with each release and should be retested.
    The older User Exits in FI/CO are "Z" programs that are defined in table T80D for client-dependent user exits, and in table T80I for client-independent user exits. These are also used to expand the standard functionality within the FI/CO modules. These User Exits have been available since the early releases of SAP. All of these FI/CO User Exits are listed in this document in the Configuring User Exits (Older). The list is included because these User Exits are not a part of the Enhancements or Business Transaction Events and do not have an Info System for searching.
    Benefits
    •     Standard SAP functionality can be enhanced without modification to the standard code.
    •     Upgrades do not erase the functionality and it does not have to be re-transported or re-entered into the system. The enhancements should be thoroughly tested when upgrading to ensure the system will still work as implemented.
    Configuring SAP Enhancements
    Basic Steps in Configuring an Enhancement
    •     Find the appropriate Enhancement.
    •     Enter the ABAP code in the "Z" program within the function module.
    •     Create a project.
    •     Add the Enhancement to the project.
    •     Activate the project.
    Example Business Scenario for Enhancements
    Company A has a requirement to validate all customer master records created with a U.S. address. The U.S. entity reports on the industry field on the customer master. This is only a U.S. requirement and should not be required for the other countries, so the field status would not work. To accomplish this requirement, Company A will need to set up an Enhancement for the customer master transaction. The necessary steps are detailed below with screenprints. This example was configured in a 4.6C system.
    Detailed Steps
    1.     Tools   ABAP Workbench   Utilities   Enhancements   Definition   Utilities   List Enhancements
    2.     Do not execute this without any parameters! There are too many Enhancements and it will probably time out. You’re searching for a customer master exit. Enter mast in the short text (see Figure 1). You’ll start there. Searching for an exit can be tricky, so make sure you try several things before giving up.
    3.     Execute the search.
    Figure 1. Start Your Search for a Master Exit Here
    4.     Look through the list until you find the Enhancement for User exits: Customer Master Data.
    5.     Double-click on the enhancement SAPMF02D. This will take you to the details of the Enhancement and list the function modules included in the Enhancement.
    6.     To continue, double-click on the function module EXIT_SAPMF02D_001
    7.     This will take you to the source code for the function module. Click on the Import tab to review the tables/fields that are available for the Enhancement (see Figure 2).
    Figure 2. The Tables That Are Available for the Enhancement
    8.     To view the tables/fields that can be changed in the function module, click on the Export and Changing tabs. For this function module, these tabs are empty because you can only validate data. You cannot change any fields in this enhancement.
    9.     Return to the Source Code tab.
    10.     Scroll down until you see the Include statement in the program. The "Z" program listed after the Include is where your code will be written (see Figure 3).
    Figure 3. Your Program Will Begin After the Include Statement
    11.      Double-click on the Include. You will be prompted to create the include. Click on Yes to create.
    12.      At this point you will be prompted to enter a development class and to create a transport request. If you do not know which development class to use, please contact your technical team.
    13.     Enter the following ABAP code into the program (Figure 4):
    User exit to ensure that all US customers have a group key
    entered on the customer master.
    if i_kna1-land1 = 'US' and
    i_kna1-brsch = ' '.
    message e001(F2).
    endif.
    Figure 4. The ABAP Code You Need to Enter
    14.      Note that the table name matches the table name in the import tab tables.
    15.      In this example you are using the standard message class F2 with message number 001. Normally, you will create your own message within your own message class. All customer message classes must begin with a "Z" and are created in transaction SE91.
    16.     Save the program.
    17.     The next step is to create the project. Go to transaction code CMOD or follow menu path: Tools   ABAP Workbench   Utilities   Enhancements   Project Management.
    18.     Enter the project name; begin the name with a "Z."
    19.     Click on the Create button.
    Figure 5. Click on Create After You Type in the Project Name
    20.      Enter in a description for the project.
    21.      Click on the Enhancement Assignments button.
    22.      You will be prompted to save the enhancement. Click on Yes.
    23.      At this point you will be asked for a development class and to create a transport for the project. You may use the same one created when adding the ABAP code to the function module.
    24.     Enter the name of the enhancement SAPMF02D (see Figure 6).
    Figure 6. Enter the Name of the Enhancement Here
    25.     Save the project.
    26.     Back out of the enhancement assignment.
    27.     Activate the project by hitting the Activate button.
    The SAP Enhancement is ready to be tested! Try creating a customer with U.S. as the country and a blank group key. Be sure to test one with a group key to make sure the message is not displayed in error as well.
    Configuring Business Transaction Events
    Basic Steps in Configuring an Event
    •     Make sure the application is active for Business Transaction Events.
    •     Copy the sample interface function module into a "Z" function module.
    •     Enter the ABAP code into the source code section of the new "Z" function module. You may choose to create a "Z" program to enter the code into and then insert the "Z" program into your function module source code.
    •     Activate the function module.
    •     Assign the function module to the event, country and application.
    Example Business Scenario for Business Transaction Events
    Company A would like to copy the group key field from the vendor master into the allocation field on all the line items within a vendor invoice and payments, including the vendor lines. This requirement assumes only one vendor is posted to in a document.
    To accomplish this requirement, Company A will use the Business Transaction Event 1130, Post Document: SAP Internal Field Substitution.
    1.     IMG Menu Path: Financial Accounting   Financial Accounting Global Settings   Use Business Transaction Events   Environment   Infosystem (Processes).
    2.     Find the correct Business Event. You are updating a field, so you select the Processes Info System instead of the Publish and Subscribe Info System.
    3.     Execute the search with the defaults.
    4.     Find the correct interface for updating a document: Post Document: SAP- Internal Field Substitution (see Figure 7).
    Figure 7. Find the Correct Interface for the Business Event
    5.     Put your cursor on the event and click on the Sample Function Module button.
    6.     You are now in transaction SE37 – Function Builder. This is the function module (sample_process_00001130) you will need to copy into a "Z" name function module for your coding (see Figure 8).
    Figure 8. This Is the Function Module You Need to Copy Your "Z" Name Function Module
    7.     Click on the Copy button.
    8.     Enter the "Z" function module name in the To Function Module field (see Figure 9).
    9.     Enter a Function Group. If you need to create a "Z" function group, go to transaction code SE37 and follow menu path: Go to   Function Groups   Create Group. A function group is a logical grouping of function modules, and the ABAP code is generated for function groups. You will be prompted for a development class and transport when creating the function group.
    Figure 9. Enter Your "Z" Function Module Name Here
    10.     In Function Builder (transaction SE37), enter the new "Z" function module. Click on the Change button.
    11.     The system will default into the source code screen where you may enter your ABAP code.
    12.     Notice the tables available for the code. Additional tables may be declared if necessary.
    13.     Enter the following source code (see Figure 10):
    tables: lfa1.
    data: z_groupkey like lfa1-konzs.
    z_groupkey = ' '.
    loop at t_bseg.
    check for vendor lines. If one is found, read the vendor master and
    retrieve the group key field.
    if t_bseg-koart eq 'K'.
      select single konzs from lfa1 into z_groupkey
        where lifnr = t_bseg-lifnr.
    endif.
    Move the group key field into all line items allocation field.
    loop at t_bsegsub.
      t_bsegsub-zuonr = z_groupkey.
      modify t_bsegsub index sy-tabix.
    endloop. "t_bsegsub
    endloop. "t_bseg
    Figure 10. The Screen Where You Enter Your Source Code
    14.     Save the function module.
    15.     Back out to the main Function Builder screen by clicking on the green arrow button.
    16.     Activate the function module by clicking on the Activate button (see Figure 11).
    Figure 11. Activate the Function Module from This Screen
    17.     Assign the function module to the event in the IMG: Financial Accounting   Financial Accounting Global Settings   Business Transaction Events   Settings   Process Function Modules   of an SAP Appl.
    18.     Hit enter past the warning messages that this is SAP data.
    19.     Click on the New Entries button.
    20.     Enter the process for your interface. In your example it is 00001130.
    21.     Enter the country the interface is valid for. If it is valid for all countries, leave this field blank.
    22.     Enter the application the interface should be called for. If it should be called for all applications, leave this field blank. Please note that not all integrated transactions are programmed to go through these interfaces! You will need to test to find out!
    23.     Enter the new "Z" function module (see Figure 12).
    Figure 12. Enter Your New "Z" Function Module Here
    24.     Save the settings. At this point you will be prompted for a CTS number for the configuration change.
    25.     The Business Transaction Event is complete! You are ready for testing.
    Configuring User Exits (Older)
    Basic Steps in Configuring an User Exit
    •     Create a "Z" program for the User Exits and enter the necessary ABAP code.
    •     Enter the new program name into table T80D.
    •     Configure the application to call the User Exit.
    List of User Exits
    •     Variable Field Movements
    •     Substitutions in FI, CO, PCA
    •     Validations in FI, CO, PCA
    •     Rollups in SPL
    •     Fixed Field Movements in SPL
    •     Cost Center Summarization on Detail Screen
    •     Sets Formula Variables
    Example Business Scenario for User Exits
    Company A would like to add a "Z" field in the Special Purpose Ledger to capture a Business Unit field for reporting. They have used all the standard SAP fields such as Business Area and Profit Center. The field will only be used for reporting and is only needed in the Special Purpose Ledger. You created a special ledger table (ZZSPL1) with field Z_BUNIT and need to populate this field based on a combination of G/L account, fund and functional area.
    To accomplish this requirement, Company A will use the Variable Field Movement User Exit. To make maintenance easier, table ZZBUSUNIT was created with the G/L account, fund and functional area fields as key fields, and the business unit field as a non-key field. You generated the table maintenance so the table could be updated using transaction SM30. SAP users update the business unit determination rules in table ZZBUSUNIT by entering the G/L account, fund and functional area, and then the business unit that combination should be posting to. The User Exit will read table ZZBUSUNIT using the G/L account, fund and functional area from the posting transaction and determine the business unit. The steps for using the user exit are detailed below. This example was created on a 4.6C system.
    1.     Copy the delivered template User Exit program RGIVU000_TEMPLATE into a "Z" program. Follow menu path Tools   ABAP Workbench   Development   ABAP Editor (transaction code SE38). In early releases, the delivered program was RGIVU000.
    2.     You will be prompted for a development class and a transport. Please check with the technical team for the correct development class.
    3.     At the initial ABAP Editor screen, enter your new "Z" program name, select the Source Code button and click on Change (see Figure 13).
    Figure 13. To Enter Your New Code, Select Source Code and Click on the Change Button
    4.     Enter the following code in the User Exit (Figure 14):
    FORM E01_MVC USING FROM_FIELD TO_FIELD.
    to_field = 'CORP'. "Set a default business unit.
    read table zzbusunit to determine the business unit field.
    select single z_bunit from zzbusunit into to_field
       where hkont = accit_glx-hkont and
        geber = accit_glx-geber and
        fkber = accit_glx-fkber.
    ENDFORM.
    Figure 14. Enter Your New Code at This Screen.
    5.     Activate the program by clicking on the Activate button.
    6.     Change the configuration in the User Exit table to point to your new "Z" program.
    7.     Follow the IMG menu path: Financial Accounting   Special Purpose Ledger   Basic Settings   User Exits   Maintain Client Specific User Exits.
    8.     The entry to maintain is application area GIMV: Variable Field Movement. Enter your "Z" program (see Figure 15).
    Figure 15. Enter Your "Z" Program in the Application Area GIMV: Variable Field Movement
    9.     Save the changes.
    10.     The final configuration step is to assign the User Exit in the variable field movement for your special ledger table. In the IMG: Financial Accounting &#61664; Special Purpose Ledger &#61664; Basic Settings &#61664; Master Data &#61664; Maintain Field Movements. Field movements control how the fields in a special ledger table are populated. They can be populated straight from other fields in a posting or through User Exits.
    Figure 16. After You Assign the Business Unit Field and the G/L Account, the Exit Field Should Contain U01.
    11.     Assign the business unit field as a receiver and the G/L account as the sender. The Exit field should contain U01 (see Figure 16).
    12.     The User Exit number U01 calls User Exit E01_MVC form in the "Z" program.
    13.     Save the field movement.
    14.     You are ready to test your User Exit!

  • User exit for XD01/XD02 to update KNA1 field

    Hi
    I have added a custom field using append structure in KNA1
    I need to update it during the XD01 or XD02 transaction before it is saved
    I am searching for BADIs and user exits but I am not able to update anything in KNA1
    kindly help if u were having similar requirement
    thanks
    b

    Hi Max,
    I have tried all of the following
    BADI for XD01
    CUSTOMER_ADD_DATA
    BADI_LAYER
    CUSTOMER_ADDRSCR_CHG
    GOS_SRV_SELECT
    ADDRESS_SUBSCREEN
    save button:
    ADDRESS_CHECK
    ADDR_TXJCD_CHECK
    ADDRESS_UPDATE
    exits
    EXIT_SAPMF02D_001.
    BTEs
    00001320
    00001321
    00001330
    00001340
    00001350
    00001360
    but nowhere I have found an interface for updating KNA1 fields.
    I am not able to use CUSTOMER_ADD_DATA_CS and CUSTOMER_ADD_DATA_BI . I checked it using CL_EXITHANDLER
    is there any way i can store the information I need . I just need one field against the customer number
    thanks
    b

  • User exit for XD01 (Customer Creation)

    Hi All Gurus,
    I need to extract some data (kunnr, name1, name2, telephone, mobile etc from KNA1, KNVV, KNBK tables) when user is creating a new customer. I have used the user exit SAPMF02D - EXIT_SAPMF02D_001 for the requirement.
    I am getting all the required data except KUNNR. It is always blank, and according to my guessing it is because yet the KUNNR is not created.
    Is there any other alternative or user exit for this scenario?
    Thank you all in advance,

    This was a very useful post Marcin!
    For those who need detailed steps for BTE regarding customer master data:
    Transaction FIBF
    Environment -> Infosystem P/S
    Find event code using google (debitors are 00001320)
    Click "Sample Function Module" and copy it to your FM (e.g. Z_CUSTOMER_UPDATED)
    Back in FIBF choose menu Settings -> Products -> ...of a customer and create one (check "Active"). Go back to FIBF
    Settings -> P/S Modules -> of a customer and assign your event + product + FM
    Now you can implement your FM
    You can use this FM to track changes to customer master data and e.g. feed the information into interfacing systems.

  • XD02 User Exit/Badi

    Hello,
    I need to locate a User Exit/Badi where I can get the address information (Street, City, etc) that was modified in transaction XD02 once the user press the save button.
    I tried to use the EXIT_SAPMF02D_001 (ZXF04U01) exit but when i get the address information from the ADRC table it's not updated yet.
    Is there a way of obtaining this data by the time the user modifies the customer information in XD02 transaction????
    Thank you
    Felipe Vieira

    USER EXIT
    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.sap-img.com/ab038.htm
    http://help.sap.com/saphelp_46c/helpdata/en/64/72369adc56d11195100060b03c6b76/frameset.htm
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci982756,00.html
    Transaction Code - XD02                     Change Customer (Centrally)
    Exit Name           Description
    SAPMF02D            User exits: Customer master data
    No of Exits:          1
    Rewards if useful.........
    Minal

  • User exit or BADI in XD01 transaction

    Hi friends,
    I Have a requiremnt.
    when ever my Xd01 or vd01 transaction is executed. i need a user exit where i can check for a particular account group ABC if the account group is ABC then i need to add that particular customer number to ztable.
    can any one tell the badi or user exit name
    similar to user_exit_save_document in va01 transaction , in the same way i need a user exit or badi in xd01.
    Regards
    Priyanka

    Hi,
    user exit for XD01 transaction code is
    SAPMF02D   -
    >    User exits: Customer master data
    and the function module is
    EXIT_SAPMF02D_001  --->  Customers: User Exit for Checks prior to Saving
    Badis for XD01
    CUSTOMER_ADDRSCR_CHG Implementation of CUSTOMER_ADDRSCR_CHG by Public Sector
    CUSTOMER_ADD_DATA    Implementation of CUSTOMER_ADD_DATA by Empty
    CUSTOMER_ADD_DATA    DSD Implementation of CUSTOMER_ADD_DATA
    CUSTOMER_ADD_DATA    /NFM/ Screen in Customer Master
    CUSTOMER_ADD_DATA    ETM implementation
    CUSTOMER_ADD_DATA    US Federal Government Customer Master Extension
    CUSTOMER_ADD_DATA    Implementation of CUSTOMER_ADD_DATA by Public Sector
    CUSTOMER_ADD_DATA    IS-Oil-Erweiterungen von Kundenstammdaten
    CUSTOMER_ADD_DATA    IS-Oil Downstream Customer
    CUSTOMER_ADD_DATA    sfsdfsd
    CUSTOMER_ADD_DATA    test implementation for field
    CUSTOMER_ADD_DATA    zCUSTOMER_ADD_DATA
    CUSTOMER_ADD_DATA    g
    CUSTOMER_ADD_DATA    customer_test
    CUSTOMER_ADD_DATA    test custom
    CUSTOMER_ADD_DATA    testing for custom screen
    CUSTOMER_ADD_DATA    testing
    CUSTOMER_ADD_DATA    Customer enhancement
    CUSTOMER_ADD_DATA    testing
    CUSTOMER_ADD_DATA    testing
    CUSTOMER_ADD_DATA    testing
    CUSTOMER_ADD_DATA_BI ETM Implementation
    CUSTOMER_ADD_DATA_BI IS-PS: Additional Data for Customers (Batch-Input and ALE
    CUSTOMER_ADD_DATA_BI IS-OIl customer master fields Batch Input/ALE
    CUSTOMER_ADD_DATA_CS Implementation of CUSTOMER_ADD_DATA_CS by Empty
    CUSTOMER_ADD_DATA_CS DSD Implementation of CUSTOMER_ADD_DATA_CS
    CUSTOMER_ADD_DATA_CS Impl. of CUSTOMER_ADD_DATA_CS by DSD, Sales Area Data
    CUSTOMER_ADD_DATA_CS /NFM/CUSTOMER_DATA
    CUSTOMER_ADD_DATA_CS ETM Implementation
    CUSTOMER_ADD_DATA_CS US Fed Gov't Customer Master Data Extensions
    CUSTOMER_ADD_DATA_CS Implementation of CUSTOMER_ADD_DATA_CS by Public Sector
    CUSTOMER_ADD_DATA_CS IS-Oil Downstream Screens
    Regards,
    Madhu

Maybe you are looking for

  • Problem with Java and APC Network Shutdown Software

    I am having an issue with APC's Network shutdown software. On any Win2k Server I load the software on after logging off from the console I am unable to reconnect to the web interface for the APC Powerchute Network Shutdown software. If I stop and res

  • Using my HomeHub, why do my phone and my tablet ke...

    This is getting to be a pain in the neck.  I have had my Nexus 7 repaired, and when I got it back, charged it up and went through set up. I connected it to my proper Home Hub wifi - the full speed Infinity. Part way through the process, my tablet doe

  • File type .fpbc

    When I burn a disk from a playlist in iTunes, I get a file on the desktop with a disk icon and name with a filetype of *.fpbc. If I open the disk it has all the aiff files on it. What is the significance of the .fpbc file type?

  • SAP GTS-TSW Integration

    Hi Guys Is TSW integration possible, i heard that this can be done. Process should be - Nomination is created with a sanction party and the same gets blocked, this helps a lot since it saves the problem of going to the SO level. If this can be done,

  • Read/Write speeds with Airport Extreme and USB Hard Drives

    Anybody know how fast the read/write speeds are with a USB hard drive and the Airport Extreme Base Station? My Setup I have a 17 MBP (2010) and a 13 MBP (2011) - no SSD's MBP generally connect via 802.11n 5Ghz with a very strong signal Gigabit connec