VBAP modify in MV45AFZZ

Hi people! I need some help, please.
I'm trying to duplicate line in VA01, with some changes, for this I'm using MV45AFZZ. I already tried in USEREXIT_SAVE_DOCUMENT and USEREXIT_SAVE_DOCUMENT_PREPARE, copying a new line to XVBAP, changing and appending, but doesn't  work, when save and see in the VA02, the Sales order apper with 1 line unchanged...
somebody can help?
Thanks in advance.

You must have forgotten one of these (or both):
XVBAP-UPDKZ = 'I'.
APPEND XVBAP.
Also pay attention to the line types, some items just can't be added in this way. Check with your SD consultant.
And maybe try using Search once in a while:
Re: Adding Line items to sales order on creation using User-Exit in VA01.

Similar Messages

  • How to update vbak,vbap in MV45AFZZ

    DATA:  lw_WZEIT TYPE marc-WZEIT,
                lw_date  type sy-datum.
    LOOP at XVBAP where PSTYV = 'ZRET'.
    SELECT single WZEIT
             into lw_WZEIT
             from marc
            where matnr = xvbap-matnr.
    IF sy-subrc = 0.
        lw_date = lw_WZEIT + sy-datum.
       if vbak-VDATU < lw_date.
         move 'Z1' to xvbak-LIFSK.
          move 'A' to xvbap-ABGRU .
       endif.
    ENDIF.
    ENDLOOP.
        how to update vbak vbap table in MV45AFZZ ( while saving va01).
    Thanks
    Suresh

    Hi Suresh,
    It is not recommended to code custom update to table VBAK and VBAP directly in MV45AFZZ ( i don't think that would work either since the lock is taking place ).
    Use the appropriate procedure instead ( that is USEREXIT_SAVE_DOCUMENT and USEREXIT_SAVE_DOCUMENT_PREPARE depend on requirement ) , and
    perform modifications you need to internal table vbak and xvbap. Standard SAP program will then update the database tables for you.
    XVBAK is available through all part of MV45AFZZ since this is defined globally to include non vbak header information.
    Rettung von VBAK Feldern nach AG-Änderung.
    DATA:    BEGIN OF XVBAK.
            INCLUDE STRUCTURE VBAK.
    DATA: AGUPDA LIKE RV02P-AGUPD,
              WEUPDA LIKE RV02P-WEUPD,
              AUARTUPDA,
              END OF XVBAK.
    Rgds,
    Tuwuh Sih Winedya

  • USER EXIT to change VBAP-VSTEL

    Hi all, i have a question
    i'm fighting with consultant about this issue.
    We have a order type (ZRI0) with many Order Reasons, for a specific order reason (Z30) i want to change the default Shipping Point (VBAP-VSTEL)from V_TVSTZ-VSTEL (FAM1) to V_TVSTZ-VSTE1 (FAM2)
    the customization of table TVSTZ is that FAM1 is the default Shipping Point and FAM2 is the Manual Shipping Point
    So i asked an user exit that for the specific order reason changes Shipping Point to  V_TVSTZ-VSTE1 (FAM2)
    they say it's impossible , they can modify only exit MV45AFZZ FORM userexit_move_field_to_vbap
    i tried to modifying exit MV45AFZZ FORM userexit_save_document but nothing change, it seems that the customizing overwrites our modifications.
    So the question is : where can i insert this modification on document saving?

    Hi,
    There's no flag as such.
    What you can try is :
    Along with the modification of VBAP structure try modifying XVBAP too using the following code.
    SELECT SINGLE mtart INTO mara-mtart FROM mara WHERE matnr = vbap-matnr.
    IF mara-mtart 'DI' .
    if vbak-vkorg = 'FA01' and vbak-augru = 'Z30' and vbak-auart = 'ZRI0'.
    move 'FRGA' to vbap-lgort.
    move 'FAM2' to *X*vbap-vstel.
    move 'FA01' TO VBAP-WERKS.
    loop at xvbap.
    xvbap-vstel = 'FAM2'.
    xvbap-lgort = 'FRGA'.
    modify xvbap.
    endloop.
    endif.
    endif.
    Hope you are still writing this logic under save_document_prepare. It should work.
    Make sure my syntax is proper. Its been a while I lost tocuh with ABAP.
    Regards,
    Amit
    Edited by: Amit Iyer on Jun 10, 2011 1:07 PM

  • Add new field

    Hi all,
    I need to add a new field for sales order in additional data a tab.  I have two user exits MV45Aozz and mv45AIzz ( user modules fo rPBO and PAI). Need to update 3 standard table. VBAK, LIKP, BBRK.
    Plz help me in this regard,
    1. Do i need to create any FM, user_customXXX for this user exit.
    2. If I add the field to these standard tables will that field automatically apears on the screan.
    3. Help me with some useful links for user exits of this kind.
    appreciate you for spending your valuable time for helping me !
    Thanks in advance,
    Mohan.

    hi,
    to 1.
    You can put your coding directly into the user-Exit. A fm is recommended, when there are several developer on the System. with a fm you cane capsule your coding an do the transport independante form other developers.
    to 2.
    while adding Fields to a table, there is no automatic apperance of a screan. You have th modify this by your own.
    You mentioned 3 tables --
    VBAK - i modify in MV45AFzz or MV45AFZB
    LIKP -- i modify only in rv50AFZ1 - user exit save prepare
    Für the userexits in the delivery there is a good note avalible in oss
    bbrk i don't know.
    hans

  • Userexit_move_field_to_vbap.

    i have added a new column  in the screen 4900 of sales order which corresponds to the field zzitbsez in vbap table . i have added this field in vbap . I wrote code in userexit_move_field_to_vbap to move values
    MOVE xVBAP-ZZITBSEQ TO VBAP-ZZITBSEQ. in mv45afzz
    But the problem comes when i enter some value in this column in VA01 transaction, the debugger does not even goto this code part.

    Hi,
    Since you want to update vbap at item level with the new field you have inserted, write your logic in
    FORM USEREXIT_SAVE_DOCUMENT_PREPARE and loop table XVBAP with the number of line items and update table VBAP finally with commit.
    This should work with FORM USEREXIT_MOVE_FIELD_TO_VBAP , try checking VBAP after the sales order is saved if there is any entry in your new field. Try inserting just a breakpoint and comment your logic and see if it stops there at the time of order processing.
    Regards,
    Amit

  • Account Assignment - Project

    Hi everyone,
    I am basically PS consultant, Our scenario is Customer project, where we get order from customer and execute project. so each sales order will have one WBSE element as account assignment. My requirement is, I wanted to restrict user from assigning same WBSE to different sales order..i.e., one WBSE must be assigned to only one sales order not many...how to restrict this?..is there any user exit available for this..Pls guide me.

    Hello,
    Try user exit move field to vbap in include mv45afzz. you will have to check other sales order created for your WBS.
    Think about creating an extra index on VBAP to speed up process.
    Piotr.

  • Modify positions using MV45AFZZ

    Hi SAPGurus,
    I am attempting to add a verification to the user-exit MV45AFZZ that, accorting to parameters it will clear the field VBAP-PS_PSP_PNR.  I am not sure how to do this as there are various tables, xvbap, yvbap for example.  I have tried modifying all of them with no luck, is there a flag that has to be marked to carry out the update?
    Regards,
    Simon

    >
    Suneel Kumar Gopisetty wrote:
    > Hi ,
    >
    >  What is verfication you need to add ??
    >
    > Regards,
    > Suneel G
    This is what I have now;
    IF vbak-faksk EQ 'ZC'.
        loop at xvbap.
        clear xvbap-ps_psp_pnr.
        modify xvbap.
        endloop.
        ENDIF.
    I had it in the FORM USEREXIT_PRICING_PREPARE_TKOMP also I tried in USEREXIT_SAVE_DOCUMENT and USEREXIT_SAVE_DOCUMENT_PREPARE.

  • Modifying Field in vbap

    Hi Experts,
    i have to modify VBAP table field Business area(gsber) for creation of sales order(VA01) ,changinng of sales order(VA02) in which user exit i need to write the code..Plz help me on this. I tried in include MV45AFZZ userexit_save_document.but it is not working in case of va01.
    Thanks in advance for your help.

    Hi,
    Have a look @FORM USEREXIT_MOVE_FIELD_TO_VBAP of MV45AFZZ.
    I hope this helps,
    Regards
    Raju Chitale

  • VBAP-ABDAT field updation in MV45AFZZ.

    Dear Gurus,
    we have a requirement , when we are changing the field VBAP-ABGRU through BAPI_SALESORDER_CHANGE  we should update sy-date in the VBAP-ABDAT.
    i have tried for the ABDAT field in the bapi item structure it is not there.
    i found the exit MV45AFZZ with exit: USEREXIT_MOVE_FIELD_TO_VBAP.
    can guide how insert the sydate in 'ABDAT' field if VBAP-ABGRU is changed is changed or filled with value thorough BAPI_SALESORDER_CHANGE.
    Regards,
    Abdul Rahim

    Hi Abdul,
    could you please check if the value of ABGRU has been changed by comparing VBAP and XVBAP?
    Also, check that you do this only when the sales document changes (t180-trtyp eq 'V').
    You can do this in userexit_move_field_to_vbap
    reg, bob

  • Change 'Z' field of VBAP in MV45AFZZ

    Hi All,
    I am trying to populate a 'Z' field for the line items in the SAVE_DOCUMENT_PREPARE exit of MV45AFZZ.
    The values are getting populated in VBAP when I am in VA01, but they are not getting populated in VBAP when I am doing the same in VA02.
    What can be the problem?
    <deleted by Moderator>
    Thanks,
    Jiten

    >
    Jiten Rajendra Barai wrote:
    > Quick responses will be rewarded.
    >
    Do not offer points, its against [Forum Rules|http://wiki.sdn.sap.com/wiki/x/FgQ].
    Anyway, i would rather code the logic in USEREXIT_MOVE_FIELD_TO_VBAP routine.
    Regards
    Karthik D

  • 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

  • How to modify the field VBAP-FIXMG

    Hello All,
    I have the value of VBELN and POSNR.
    I have to mofdify the value of field VBAP-FIXMG on the basis of VBELN and POSNR.
    Can u plz provide a solution for that.
    Bapi is also possible.
    if yes then plz provide name and exporting parameter.
    thanks.

    Hi
    Try to use BAPI BAPI_SALESORDER_CHANGE:
    Field FIXDAT_QTY of parameter ORDER_ITEM_IN
    Max

  • Moving fields to VBAP from user_exits in MV45AFZZ.

    Hi all,
    To Display fields on VA01, VA02 and VA03 transactions.
    1.  I need to take stceg from KOMK structure. So in
         FORM USEREXIT_MOVE_FIELD_TO_VBAK.    i wrote code as:
          vbak-zz_stceg = tkomk-stceg.
    2.  for MWSKZ(TAX code) from KOMP structure. i coded as    
         FORM USEREXIT_MOVE_FIELD_TO_VBAP.
          vbap-zz_mwskz = tkomp-mwskz.
    STCEG is working fine but MWSKZ tax code is showing empty field.
    i have added zz_stceg and zz_mwskz to vbak and vbap tables respectively. then added these fields to screen.
    Please suggest me where i went wrong.
    Thanks & regards,
    Cheruku.

    Hi
    Please put a break point the statement -   vbap-zz_mwskz = tkomp-mwskz.
    and check tkomp-mwskz has any value or not. TKOMP is an internal table. Check which line value you can assign to it if TKOMP[] is not initial.

  • Modify VBEP-EDATU in MV45AFZZ

    Hi,
    I have a requirement to modify the schedule line date based on the planned delivery delivery days maintained in the purchasing info record.
    The purchasing info record details are available only at the time of document save USEREXIT_SAVE_DOCUMENT.
    I am using the update indicator to update the date in XVBEP,but still it does not work.
    xvbep-edatu  = .............
    xvbep-updkz = 'U'.
    MODIFY xvbep.
    But this still does not work.
    Can you please let me know if some additional parameter is required to achieve this.
    Many Thanks.
    Regards,
    Babul.

    As you know, MV45AFZ* includes are always active.  USEREXIT_SAVE_DOCUMENT is too late to change any internal tables...that subroutine is used only to launch other processes, etc.  In USEREXIT_SAVE_DOCUMENT_PREPARE, you may find that you have to modify the internal VBEP rather than XVBEP...  I don't understand why the data you need would only be available at that point...  Surely, you can obtain or find earlier in the process.

  • Modifying the production order from VBAP

    Hi Expers
    I need some modification and write a code so how to proceed with the following comments as below
    Modification to processing of Command Orders & Tickets
    Currently there is an assumption that every sales order (and its deliveries) will include a product which is made to order, i.e. for which a production order will be required.
    In ZINT_CSTPORD_ROUTINES, a check is made to identify the production order linked to the sales order. If there is no such production order (usually because of the customeru2019s credit status) then processing of the ticket is terminated.
    This assumption would fall down if an order was to be raised (in Command) on which there is no concrete material. For example, if we sold a bag of pigment or a screed to a customer. In this case the item would be sold from stock and there would be no need for a production order.
    The solution
    In the routine which checks for the existence of a production order, modify the code as follows:
    u2022     Inspect each item on the sales order
    u2022     If (and only if) there is at least one item with a category of u201CZTACu201D then check for a production order, otherwise process the order in the usual manner.
    Regards
    Piroz

    Thread closed

Maybe you are looking for

  • Can i use a single download for multiple accounts

    I have a new MacBook Air and just downloaded Mountain Lion--took about 12 hours. I saved the App on an external drive and would like to use that image two upgrade two other computers in my household--each using a different Apple ID than the one used

  • Organizer defect creates and leaves temporary files in the open directory.

    I'm using Photoshop Elements 11 Organizer and Adobe Bridge CS6 concurrently.  If I have Bridge open to the same folder as PSE Organizer and I do an "Add captions ..." operation to a group of files selected in the Organizer, then there is a very good

  • How to start with bootable backup

    My iMac power button has "ceased function". but I have a bootable backup on one external drive, and also an additional Time Machine drive. Any suggestions on how to use a loaner iMac while this one is being repaired? i.e. - How do I start up with the

  • Multiple Portals on Same Server

    What is the best way for 2 separate groups in an organization to have (or appear to have) their own instance of the Oracle Portal? We have 2 separate groups ready to begin development in the Portal and are trying to figure out a good way to accomplis

  • Partner selection pop-up not appearing while saving

    HI Experts, I have maintained partner determination procedure, based on this there is pop-up box triggered for selecting the partner for service team, but the same is not appearing when i change the determination time to "When saving" but the pop-up