Userexit in va01

Hi all,
I have a requirement that, whenever we create salesorder with reference (Debit memo/Credit Memo) and if save that data it has to do some processing (to update external non-sap system). Is there any user exit for this???
Thanks,
Srilatha.

HI SRILATHA
USE THIS PROGRAM YOU , WHEN EVER YOU WANT USEREXIT FOR ANY TRANSACTION YOU WILL GET
REWARD IF USEFULL
Finding the user-exits of a SAP transaction code
Enter the transaction code in which you are looking for the user-exit
and it will list you the list of user-exits in the transaction code.
Also a drill down is possible which will help you to branch to SMOD.
TABLES DECLARATION
TABLES : TSTC, "SAP Transaction Codes.
TADIR, "Directory of Repository Objects.
MODSAPT, "SAP Enhancements - Short Texts.
MODACT, "Modifications.
TRDIR, "System table TRDIR.
TFDIR, "Function Module.
ENLFDIR, "Additional Attributes for Function Modules
TSTCT. "Transaction Code Texts
INTERNAL TABLE DECLARATIONS
DATA : ITAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
DATA DECLARATIONS
DATA : V_FIELD1(30).
DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
INPUT SCREEN DECLARATIONS
PARAMETERS : P_TCODE LIKE TSTC-TCODE OBLIGATORY.
START OF SELECTION EVENT
START-OF-SELECTION.
*--Read SAP Transaction Code from the given input.
  SELECT SINGLE *
  FROM TSTC
  WHERE TCODE EQ P_TCODE.
  IF SY-SUBRC EQ 0.
*--Get the Directory of Repository Objects for the
*---selected program name.
    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.
*--Read System table TRDIR for the selected program name.
      SELECT SINGLE *
      FROM TRDIR
      WHERE NAME = TSTC-PGMNA.
*--Get the function module name for the selected program name.
      IF TRDIR-SUBC EQ 'F'.
        SELECT SINGLE *
        FROM TFDIR
        WHERE PNAME = TSTC-PGMNA.
*--Get the function group for the selected program name.
        SELECT SINGLE *
        FROM ENLFDIR
        WHERE FUNCNAME = TFDIR-FUNCNAME.
*--Read the development class for the corresponding function group.
        SELECT SINGLE *
        FROM TADIR
        WHERE PGMID = 'R3TR' AND
        OBJECT = 'FUGR' AND
        OBJ_NAME EQ ENLFDIR-AREA.
        MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
      ENDIF.
    ENDIF.
*--Read all the entries into the internal table itab.
    SELECT *
    FROM TADIR
    INTO TABLE ITAB
    WHERE PGMID = 'R3TR' AND
    OBJECT = 'SMOD' AND
    DEVCLASS = V_DEVCLASS.
*--Read Transaction code information from the table tstct.
    SELECT SINGLE *
    FROM TSTCT
    WHERE SPRSL EQ SY-LANGU AND
    TCODE EQ P_TCODE.
*-- Column Headings
    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
    WRITE:/(19) 'Transaction Code - ',
    20(20) P_TCODE,
    45(50) TSTCT-TTEXT.
    SKIP.
    IF NOT ITAB[] 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 ITAB.
*--Read SAP Enhancements short texts information.
        SELECT SINGLE *
        FROM MODSAPT
        WHERE SPRSL = SY-LANGU AND
        NAME = ITAB-OBJ_NAME.
        FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
        WRITE:/1 SY-VLINE,
        2 ITAB-OBJ_NAME HOTSPOT ON,
        21 SY-VLINE ,
        22 MODSAPT-MODTEXT,
        95 SY-VLINE.
      ENDLOOP.
      WRITE:/(95) SY-ULINE.
      DESCRIBE TABLE ITAB.
      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 EVENT
AT LINE-SELECTION.
  GET CURSOR FIELD V_FIELD1.
  CHECK V_FIELD1(4) EQ 'ITAB'.
  SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
*-- call transation SMOD : Sap Enhancement.
  CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
*---End of Program
REGARDS
NARESH

Similar Messages

  • Badi/userexit for va01,when save button is clicked

    hi friends,
    i want badi/userexit which triggers when save button is clicked in va01 tcode.
    Thanks,
    Gaurav

    Hello,
    You can debug the standard code ( /h before pressing save button) searching for user-exits or badis.
    Set breakpoints in statements. For example if you are looking for call customer-fuction, click on:
    Breakpoint --> Breakpoint at --> Breakpoint at Statement
    and then here write: CALL CUSTOMER-FUNCTION
    Then pressing F8 it will go directly to the next breakpoint (user exit for this transaction).
    I hope it will help you.

  • Userexit for va01

    Hi Friends,
    I have to code user exit for Tr VA01, i have got the exit name but my requirement is in sales order creation if user enters a material,  here i want to check whether it is a BOM, if it is a bom i want to make its items in display mode. can any one suggest where i want to write the code and how to make that item in grey.
    its urgent
    Regards,
    DVNS.

    check the following exits,
    SDTRM001  Reschedule schedule lines without a new ATP check          
    V45A0001  Determine alternative materials for product selection      
    V45A0002  Predefine sold-to party in sales document                  
    V45A0003  Collector for customer function modulpool MV45A            
    V45A0004  Copy packing proposal                                      
    V45E0001  Update the purchase order from the sales order             
    V45E0002  Data transfer in procurement elements (PRreq., assembly)   
    V45L0001  SD component supplier processing (customer enhancements)   
    V45P0001  SD customer function for cross-company code sales          
    V45S0001  Update sales document from configuration                   
    V45S0003  MRP-relevance for incomplete configuration                 
    V45S0004  Effectivity type in sales order                            
    V45W0001  SD Service Management: Forward Contract Data to Item       
    V46H0001  SD Customer functions for resource-related billing         
    V60F0001  SD Billing plan (customer enhancement) diff. to billing plan
    and lso the following user exits,
    Check the programs MV45AFZZ,MV45ATZZ, MV45AOZZ,MV45AIZZ
    reward if helpful,
    thanks
    krishna

  • VA01 userexit for PO duplication check

    Hi Experts,
    I have an urgent requirement regarding PO duplication check and I need to know if there is a userexit for VA01 where I can perform PO duplication check. This PO duplication check will consists of fields VBAK-KUNNR, VBAK-BSTKD and VBAK-BNAME.
    Points will be awarded. Thanks in advance.
    Regards,
    Leo

    hi,
    check the include MV45AFZZ...It has number of userexits....put a breakpoint and check..
    Regards,
    Nagaraj

  • ERROR MESSAGE for VA01

    hi all,
         i wanna add a userexit for VA01 in program MV45AFZZ to check if reference field in Accounting Tab is initial before i save this sales order.
         when i add the belowing code in Form USEREXIT_SAVE_DOCUMENT,and press save buttom twice.
    CONSTANTS: c_bukrs_vf TYPE vbak-bukrs_vf VALUE 'PK04',
                 c_auart TYPE vbak-auart VALUE 'ZOR',
                 c_ucomm TYPE sy-ucomm VALUE 'T\04',
                 c_text TYPE char40 VALUE 'Please enter Policy reference',
                 c_type TYPE c VALUE 'E'.
      IF vbak-bukrs_vf EQ c_bukrs_vf
       AND vbak-auart EQ c_auart.
        IF vbak-xblnr IS INITIAL.
          FCODE = FCODE_GLEICHE_SEITE.
          MESSAGE c_text TYPE c_type.
        ENDIF.
      ENDIF.
        there's a error message that 'item 00010 doesn't exist.',then i exit this transaction.
        if i put these code in Form USEREXIT_SAVE_DOCUMENT_PREPARE, it works fine.Could anyone give me any suggestion for the reason?Thanks in advance.
    Thanks and Regards.
    Desmond.Yang
    Edited by: desmondyoung on May 25, 2009 4:08 AM

    Hi Yang
    generally USEREXIT_SAVE_DOCUMENT_PREPARE is used when some validations are required before saving any sales order, here we are not updated any tables.
    While USEREXIT_SAVE_DOCUMENT is used for saving sales order in some tables other then standard or some manipulations required before saving data to tables.
    In  your case you are just validating the sales order not manipulating data, hence go for USEREXIT_SAVE_DOCUMENT_PREPARE.
    try and revert

  • I have  doubt on userexits

    I have developed some code in standard SD userexit for VA01 tcode for my own functionality.In standard SD userits some zincludes are there in that include i wrote a code for my requirement.My requirement was successfully worked.But my doubt is if someone use same tcode va01.In this situation my requirement was globally imacted to others or not? Please clarify my doubt.Userexits means without modifying the SAP standard functionality we can add our own functionality.

    Hi Sujatha,
                            Userxits 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 userexits are generally collected in includes and attached to the standard program by the SAP. Or
    when there is a need for customization, then we require User Exits. This is ABAPer Job..he will find User Exits in SMOD Transaction and impliments it in CMOD Transaction. Customisation in the sense, changing the sap standard program.
    You can more detailed information in these links about user exits.
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://sap.niraj.tripod.com/id21.html
    Hope this is helpfull.
    If helpfull rewad poins.
    Thanks and Kind Regards
    Mohan

  • VA01 Partner Header Userexit

    Hi,
    I am looking for a userexit which is triggered on the header screen of VA01/02.
    Basically my requirement is to add one more partner function on a condition.
    Please help me
    Rajiv

    Hi Rajiv,
    I think this is a Customizing and VOFM step. In SPRO, SD -> Basic Functions -> Partner Determination, make sure that ZE is setup to default. Then, in VOFM, if you want a ZE partner number to default, write up a routine to determine this.
    If I am not wrong, a copy of Routine 1 should help. You can add a line to CVBPA.
    If this helps, please remember to award the points and close the post.
    Cheers,
    Bhanu

  • Regarding UserExit in sales Order creation(VA01), change(VA02)

    *Hi Gurus,*
    we are having one requirement that we have to change User status at item level in sales Order creation(VA01), change(VA02) according to certain condition( condition is if user status at item level is 'SGUC' then we need to get item category and with this item category we have to find new user status from our custom table).
    *So is there any FM or user-exits to set the User Status of the Sales Order Line Item at the time of Order Creation(VA01) or Change sales order(VA02) but before saving.*
    *looking for your inputs.*

    Check,
    In include MV45AFZZ
    Routine USEREXIT_SAVE_DOCUMENT_PREPARE
    In include RV45PFZA
    Check with USEREXIT_SET_STATUS_VBUK ,  USEREXIT_SET_STATUS_VBUP

  • VA01. userexit for contract create

    Hi all,
    I have a requirement in which while creating contract thru va01i have to show a popup after the credit limit exceeded message so that user can edit the values and save it.my problem is i have coded a popup in the userexit_save_document to show apopup to confirm such that if user selects NO the contract is not saved.But my problem is after the user presses NO the item details entered is lost. how can i solve it .please help.
    Thanks ,
    Mahesh.

    hi,
    check the include MV45AFZZ...It has number of userexits....put a breakpoint and check..
    Regards,
    Nagaraj

  • Va01 userexit

    hi gurus,
    i want to populate some value to some field in va01 when i am creating the sales order. is there any user exit for this.

    Open this in se38 MV45AFZZ .
    And enter in display mode .
    now press button display object list(ctrlshiftf5)
    will pop up a list of includes check ur exit based on function .
    ur requirement will be to find a exit as USEREXIT_MOVE_FIELD_TO_*
    regards,
    vijay

  • Userexit va01

    When I create a sales order in VA01, when I enter less than 3 different brand( material in line item), The system should first generate message, after that I should be able to block that order with giving proper reason and then I should be able to save that sales order.
    so that the higher authority can check it for further processing.
    This is the scenario.
    Can anybody suggest me the exact user exit name with simple coding.
    naresh

    Hi,
    I think u should use
    USEREXIT_MOVE_FIELD TOVBAP
    Regards
    Sandipan

  • Userexit/BADI for VA01/VA02 on save

    Hello ,
    Can any body provide the avaialble Uesr exits or BADIs which will trigger ON SAVE of sales order creation or change .
    I tried with some BADI but all they are for Internal use only .
    Please provide me the externla BADI s  which can be implemented .
      or
    userexits
    very very urgent
    Points will be given
    thanks

    Enhancement                                                                               
    V60F0001                                SD Billing plan (customer enhancement) diff. to billing plan
    V46H0001                                SD Customer functions for resource-related billing         
    V45W0001                                SD Service Management: Forward Contract Data to Item       
    V45S0004                                Effectivity type in sales order                            
    V45S0003                                MRP-relevance for incomplete configuration                 
    V45S0001                                Update sales document from configuration                   
    V45P0001                                SD customer function for cross-company code sales          
    V45L0001                                SD component supplier processing (customer enhancements)   
    V45E0002                                Data transfer in procurement elements (PRreq., assembly)   
    V45E0001                                Update the purchase order from the sales order             
    V45A0004                                Copy packing proposal                                      
    V45A0003                                Collector for customer function modulpool MV45A            
    V45A0002                                Predefine sold-to party in sales document                  
    V45A0001                                Determine alternative materials for product selection      
    SDTRM001                                Reschedule schedule lines without a new ATP check          
    SDAPO001                                Activating Sourcing Subitem Quantity Propagation                                                                               
    Business Add-in                                                                               
    BADI_SD_SCH_GETWAGFZ                    Scheduling Agreement: Read WAGFZ from S073                 
    BADI_SD_V46H0001                        SD Customer functions for resource-related billing         
    Regards,
    Shib

  • Disable message in VA01 USEREXIT

    I am working in <b>userexit_move_fields_to_vbkd</b>. I want to disable a message which appears before calling this usexexit. What can I do?
    The message is "PO date lies in future Pls check". In such case i have already set the date to system date as per requirements.

    ok

  • How to get the contract number selected on VA01.

    Hello Experts,
    While creating a sales order a contract number is selected.
    ie to which contract this SO is being created.
    We get a ALV list with list of contract number and we select one.
    But no where this contract number is displayed.
    I have a placed a input/output box on additional tab header leve of VA01.
    I need to display the contract number selected by the user for that sales order on to that box.
    and this should  happened the moment the user copies the contract number from the ALV list
    any functon exit or badi's which could be used to get the value.               
    right now iam using the include MV45AFZZ
    I know the table getting used.
    Thanks in advance.
    Regards,
    Ranjith

    You can put your code into the MOVE_FIELD_TO_VBAP userexit in include MV45AFZZ. The contract information is stored on item level (VBAP) in fields WKTNR (contract number) and WKTPS (contract item). If you can have more than one contract in a sales order you should display that information on item level rather than header level, if you always reference one contract only per sales order header should be fine.
    Hope that helps,
    Michael

  • Insert new line item in va01&va02 - urgent

    Hi frndz,
    At the time of creation standard sales order using va01.
    When user enters the sold to party in header and then
    material & quantity in line item reocrds. After user enters the details in first line. I have some checks to be executed and on the basis of that customer will get the free material that should come on second line item.
    I am getting the details which i will be inserting on new line item but the problem is that in which exit i should write the code for the same.
    So frndz could you please let me know, in which userexit I should insert this new line item. There can be more than one free material.
    If anyone has done this already, please let me know.
    I know one exit i.e.MV45AFZB but in that there are many forms. so exactly which form i should where i will write the code to insert new line item???
    Points will be awarded surely.
    Regards,
    Prashant

    HI Stephen,
    I have the same prolem. I modified the 5 global tables, but I don't see the new line in the screen.
    Can you help me with some details?
    Thx!
    Mihaela

Maybe you are looking for