User exit MV45AFZZ

Hi Gurus,
I  have put logic in userexit "MV45AFZZ" , in FORM USEREXIT_SAVE_DOCUMENT_PREPARE .That is to change schedule line category based on "User Status" . If user status is u201CAPPR u201C  schedule line category should automatic change to CP .
loop at XVBEP.
if RV45A-ASTTX = 'APPR'.
xVBEP-ETTYP = 'CP'.
xvbep-updkz = 'U'.
xvbep-BDART = '4'.
modify xvbep .
ENDIF.
endloop.
This is working fine,  updating the value.
Now the problem is:
1.     Whenever schedule line cat changes via user exit for sales orders and sales order saved, sales order is not showing  in MD04 . if I will changed schedule line category manually  CP . It is showing in MD04.
We have make to order scenario . so it is not coming for MRP run if I will changed through user exit.
Please help me out .
Thanks in advance .
Regards,
Subhash

Hi
Please, do a trace with ST05 and check if your system is updating table VBBE before this userexit. Other question, run report SDRQCR21 and check if it update MD04 (see Note 25444 - SDRQCR21: Recovery of sales and delivery requirements)
I hope this helps you
Regards
Eduardo

Similar Messages

  • Is the Sales Order Item User Status available in user exit MV45AFZZ

    Hello,
    Does anyone know if a sales order line item user status is available within user exit MV45AFZZ (USEREXIT_SAVE_DOCUMENT)?
    I need to send an email when the status changes from one specific value to another specific value but I don't seem to have access to what the latest value is in this user exit.
    I have found a table XTVSTAT which cntains some user status' but it's not clear which status maps to which line item.
    If anyone has any suggestion please let me know.
    Thanks,
    Ruby

    Hi,
    I do need to access the values as I need to check for a specific change to the user status from value A to value B.
    I have already tried debugging the user exit and searching through the available variables but the status information doesn't seem to be available.
    I guess I will have to try the output determination route. Can you explain this in a bit more detail please.
    Thanks,
    Ruby

  • User exit MV45AFZZ - Unable to modify the code

    Hi,
    I am working in ECC 6.0 version and new to this editor.
    I need to do some changes in include MV45AFZZ,when sales order is saved.
    When i try to go to change mode,program is asking for 'Access key'.
    Whether i need to get 'Access key' from SAP,or is there any procedure for doing code changes in this exit?
    Please help.
    Thanks & Regards,
    Seshagiri.

    Hi Seshagiri,
    To modify the User exit MV45AFZZ you need to get the Access Key from the Basis.
    The Basis Team will Generate the Access Key so that you can make the changes .User exit MV45AFZZ is not yet Used so that why its asking the Access key.
    Thanks & Regards,
    Nelson
    Reward points if helpfull

  • Manually trigger Availability Check in the Sales Order User Exit MV45AFZZ

    Hi All,
    As per the normal scenario where sales orders are created and the schedule line delivery dates are determined.
    Based on some business logic for few customers we need to change the delivery priority and confirmation delivery date.
    We are implementing this logic in the user exit MV45AFZZ in the routine USER_EXIT_SAVE_DOCUMENT_PREPARE.
    The availability check logic is already implemented by then. Now we have scenarios where the date redetermined by the custom logic is greater than the one determined by the standard availability check done by SAP.
    We have changed the values of the field VBEP-EDATU as per our logic but we still have 2 lines in the schedule line data where the requested date is greater than the confirmed date.
    This can be tackled if we can redo the Availability Check.
    Can someone provide pointers on how can we trigger the availability check manually in the code.
    Regards,
    Karthik

    What was the solution?

  • User Exit Mv45afZZ for Promotional BOM

    Hi All,
    I am adding custom code to the user exit MV45AFZZ for Promotional BOM. The aim is to add a new entry in the Line tiems details with the BOM header data.
    Say if the initial order is  like this:                                       It should like this after user exit execution:
    Material         Quantity            Itm Ctg                                          Material         Quantity            Itm Ctg
      M1                   10                  X                                                   M3                   1                    Z
      M1                   10                  X                                                   M1                   10                  X
                                                                                    M2                   10                  X
    We assume that in the configuration, we have configured so, such that, BOM Item M3 comprises of Items (M2, M1) with 10 Qty each.
    For this purpose, we are adding a new row to the XVBAP table at runtime. But, when we post the order, finally the quantity field for item M3 is automatically getting changed to 10.
    Please help and revert back. Let me know if i have to clarify more on my doubt.
    Thanks
    Debabrata

    Hi,
    The userexit save_document_prepare will directly hit the tables like vbak and vbap. So, as i can see that you would like to change at the pricing conditions so it is better to user the user exit:userexit_pricing_prepare_tkomk...
    All the pricing conditions will be stored in the tkomp and tkomk tables.
    The changes can be happnd at this level also.
    Thanks
    rohith

  • Global data declaration in user exit 'MV45AFZZ ' for VA01

    Hi folks,
    i  am using USEREXIT_PRICING_PREPARE_TKOMP  in MV45AFZZ for VA01 pricing modification.i need to declare one Global internal table for this exit.i tried to do this one in MV45ATZZ.but i can not save as it is asking access key.
      how can i achieve this one?
    ur answers will be rewarded.
    Thanks
    pabi

    Hi Pabitra,
    You can find the parent program and use an enhancement point to declare a global internal table mainly in the top include of the program
    ed: if t-code ABC is executed then the program for the t-code ABC is your parent program...
    Here SAPMV45A is your parent program for VA01
    and in INCLUDE MV45ATOP.
    use ENHANCEMENT-POINT MV45ATOP_02 SPOTS ES_SAPMV45A STATIC. to declare the global internal table
    Once the table is declared,also check in the user exit by debugging if the table is made available..
    i have done the above technique to use an internal table in userexit_save_document after declaring table in the mentioned enhancement point and it worked for me...
    Pls check and revert
    Reward if useful
    Regards
    Byju

  • Which user exit MV45AFZZ or MV45AFZ1 or MV45AFZB to use.

    Hi All,
                In the Sales Order Types ZDRC and ZCRU, when Sales Org is US15, the field VBAP-MVGR1 shall be mandatory.
    We need to use MV45AFZZ or MV45AFZ1 or MV45AFZB user exit.
    In MV45AFZB, USEREXIT_CHECK_VBAP, seems closest, which is used to carry out additional checks (e.g. for completion) at item level.
    Please suggest.
    Thanks.

    Hi
    Pl check this exit...this may be useful to meet the requirement
    in program MV45AFZB
    USEREXIT_CHECK_VBAK
    This user exit can be used to carry out additional checks (e.g. for completion) in the document header. The system could, for example, check whether certain shipping conditions are allowed for a particular customer group.
    Thanks,
    Ravi

  • User Exit - MV45AFZZ - Urgent

    Hello,
    I have a requirment when the user changes the delivery date for a order a mail has to trigger to the sales people.
    As of now I know the place to capture both the new and the old date. - FORM USEREXIT_SAVE_DOCUMENT.
    My question is, is Email possible through the exit.
    If it is, is it recommended, would it impact a lot on the performance of the exit.
    any alternative ideas.
    Let me know.
    Thanks,
    Ster

    It will not have any performance issue to give email functionality,hardly it takes 2 or 3 seconds to raise message.
    Note : Use one include program within MV45AFZZ ,use email coding in that include.
    Thanks
    Seshu

  • Urgent- Help abt  User Exit MV45AFZZ

    very good morning to all the SAP Masters out there....
    I had already posted a thread regarding the same but didnt get helpful answers...
    Hope I will get some this time...
    It is Interesting actually...
    I need ur help for solving an issue...
    when Sales Order is Being created...the Purchase Requisition and Requisition item is generated in the Schedule Line of Sales order's Line Items
    If I am not worng we are able to make changes in MV45AFZZ program for SalesOrder..
    So My requirement is..
    When Sales order is being created the value of KDMAT field of VBAP table should also be saved in EBAN-BEDNR...the length for BEDNR is 10 so it'll b taken care to limit VBAP-KDMAT with in 10 Chars...
    help me to Carry XVBAP-KDMAT into EBAN-BEDNR for VA01 Transaction....
    Points Rewrded for Helpful answers

    Hi,
    Why don't you try the exit
    V45E0001
    where the description says "Update Purchase Order from Sales Order"
    Please find below the documentation for the exit
    Update Purchase Order from Sales Order
    With this customer exit the standard system behavior regarding updating order data from the sales order can be expanded or restricted.
    The module is called up when the sales order is changed, as long as the conditions for changing the order have been filled. It transfers the document number, the purchase requisition number and a table for the fields to be changed in the order (T_PURCHASE_DATA). This can be expanded or restricted in the existing Customizing.
    The rule is: To change a field with the name FIELDNAME, a subprogram (form routine) with the name POSITION_CHANGE_FIELDNAME must exist in the program SAPMM06E.
    OR..in MV45AFZZ in userexit_save_document we need to write the code to manually update the table EBAN field by using abap code like modify table or seeking a BAPI..consider this as the last resort pls.....
    Reward if it helps
    Regards
    Byju

  • User-Exit MV45AFZZ - userexit_move_field_to_vbkd

    Hi All,
               I have one requirement which i need to get department number, stored in table T023T and assigned to sales order item level.
               The logic is based on material i am getting the material group and based on material group i am getting the department number which is maintained in the Description2 field of table T023T.
    i written the above logic in form 'userexit_move_field_to_vbkd' and moved department number to VBKD-ABTNR. But i dont know why for some materials Department number is assigning wrong values and for some it is assigning correct value.
    Please help me out is there any other place to move the data to department number while creating sales order.
    Regards,
    Siva.

    HI Siva,
    In this user MV45AFZZ, value are store in structure like,
    Xvbkd- hold current values, Yvbkd contain old value.
    like this yvbak, yvbak, Xvbep,yvbep,vbap,xvbap,yvbap.
    try to change this internal structure value then it will populate.
    Thanks,
    Sendil

  • How to capture an address change for a sale order in user exit MV45AFZZ?

    Hi ,
    My requirement is to capture the address change in sale order .
    I have to write the code in my own z-include in MV45AFZZ of SAPMV45A.
    Here I have to use VBAP-KUNNR for PARVW = ‘AG’ or ‘WE’. And  ADDR1_DATA.
    Could you please give me idea , how to capture the address change?
    Thanks ,
    Suresh.

    Farshid,
    As I understand it it is the RCS software that replaces the $Revision$ with $Revision: 1.2$. Is that correct?
    There are two things that you need to be aware of if this is the case.
    First, the length of the text fields are saved as part of the SystemBuild model file. This means that when the revision control software replaces the tag the length is no longer correct, and SystemBuild will not be able to load the file correctly. You can still change the text as long as you make sure the the length of the tag stays the same. For example if the version number is a single digit decimal then single digit, then when you create the file you could store the revision as $Revision: x.x$. When the tag gets replaced by the revision control software you would get
    $Revision: 1.2$ which is the same length.
    Next you need to be aware of potential line breaks. When the SystemBuild model is saved as ASCII then line breaks are added at regular intervals, so the tag might be broken up on two lines. This could prevent the revision control software from recognizing the tag. To prevent this save the file as binary.
    In short make sure that the text the revision control software adds is the same length as the text that it replaced and save the files as binary files.
    Carl L
    National Instruments
    www.ni.com/matrixx

  • VA01 - User Exit mv45afzz

    Dear All
    I have crated one validation for VBAK-VKBUR  (Sales office) field in VA01.  - MV45aFZZ
    In  FORM USEREXIT_FIELD_MODIFICATION.  section, I put the validation. 
    On error message, it come out of the session, 
    However, i want to stay in the same session and focus on filed VKBUR.
    my code as
          if <Conditon>
            MESSAGE 'error message here..!' TYPE 'E' DISPLAY LIKE 'S'.
          endif.
    I want the error message and control should stay on the same session.
    Your input will be helpful to me
    Regards,
    Venkat

    Hi,
    You can try as below.
         if <Conditon>
            MESSAGE 'error message here..!' TYPE 'S' DISPLAY LIKE 'E'.
          endif.
    Regards
    Gangadhar

  • Sales order split line user exit MV45AFZZ

    Hi Guys.
    Requirement is to split the sales order line items into multiple based on certain requirement. I Started coding in MV45AFZZ (USerexit_Save_Document_Prepare).  Basically what i am doing is looping at XVBAP and based on some condition inserting additional line in XVBAP and adding a new line with new UOM and incrementing the POSNR.). The data seems to be ok to me. But when i save i am getting update terminated error.  Can anyone help me out ?
    Thanks
    Vikram.

    Hi,
    Ary you using any 'COMMIT WORK' there?? If yes, that may cause this kind of error. Appending the records in XVBAP with mandatory fields should work.

  • Custom error message in user exit is giving Short dump

    Hi All,
    We have a scenario where in if any user try to create/Change/Delete particular types of contract in SAP system we have to issue error message
    saying ZIN/ZIR contract creation/Change/Deletion is blocked in SAP. This has to be done from the web application. So we are putting below code
    in user exit MV45AFZZ in the form USEREXIT_SAVE_DOCUMENT_PREPARE.
    CONSTANTS: lc_vbcpic01 TYPE sy-uname VALUE u2018VBCPIC01u2019, u201CWeb application user ID
             lc_zin           TYPE vbak-auart VALUE u2018ZINu2019,
                         lc_zir            TYPE vbak-auart VALUE u2018ZIRu2019,
                         lc_text(32)    TYPE c VALUE u2018Check long text for more detailsu2019.
    DATA: l_uname TYPE sy-uname.
    CLEAR: l_uname.
    MOVE sy-uname TO l_uname.
    *If user ID is not the Web application ID then block the creation/Change/Deletion
    IF   l_uname NE lc_vbcpic01
    AND ( vbak-auart EQ lc_zin
    OR    vbak-auart EQ lc_zir ).
    MESSAGE e830(zv) WITH lc_text.
    ENDIF.
    This code is working fine while creating/Changing the contract i.e. Giving us error message so that user wonu2019t be able to create/change the contract.
    But when we delete the contract from VA42, Control is coming to this message statement and is giving Short dump. Below is the error analysis of the dump.
    Error Analysis:
    During "Exit Command" processing, the program tried to send a " " message.
    This is not allowed at this point in processing.
    The program had to be terminated.
    Screen name.............. "SAPMV45A"
    Screen number............ 4001
    If any one has come across such scenario/any work around for this problem please let me know your inputs. Your inputs are highly appreciated.
    I am working on 4.6C version of SAP.
    Note: When i issue information/Warning message contract is getting deleted after displaying the message.
    Thanks,
    Vinod.

    I exactly replicated the same in DELETE_DOCUMENT also
    I am getting the Dump. I tried with exit also , but it continued and deleted. To avoid deletion we have to use Leave program or LEAVE TO CURRENT TRANSACTION.
    Delete Function is Defined as EXIT command. so it is not possible to give error message. To convice you i just copied demo program and raised the error message.
    it is also giving the dump.
    copy the demo program DEMO_DYNPRO_AT_EXIT_COMMAND and make this change , information to error .
    MODULE cancel INPUT.
      MESSAGE e888(sabapdocu) WITH text-001 ok_code input1 input2.
      IF ok_code = 'CANCEL'.
        CLEAR ok_code.
        LEAVE PROGRAM.
      ENDIF.
    ENDMODULE.
    and see...

  • USER-EXIT - sales order, credit block

    Moderator message: moved to correct forum.  In future please use meaningful subject.
    my requiremnet is, Delivery for an sales order should be created even if it is a credit block i.e even the credit check is unsuccessful the order should be deliverd when we deliver the order from salesdocument->deliver.
    i need a user-exit for this to put this check.
    can ne one help me.
    regards,
    pavan,

    Hi,
    According to Std SAP if in case credit mgmt is activated system will check for credit limit for that customer before delivery.You will be trying to change the std scenario which is not advisable.
    However,
    Try user exit MV45AFZZ & in that
    FORM USEREXIT_SAVE_DOCUMENT_PREPARE.
    Also check other exits related to delivery & credit mgmt from
    SPRO->Sales & Distr-> System Modifications->User Exits
    and check out the documentation part next to each exit in that category.
    Regards,
    Amit

Maybe you are looking for