Update terminate during return sales order creation (Delivery processing)

Hi,
I have having issues with a scenario while creating delivery in a 4.7 system. When creating a return order (using FM SD_SALESDOCUMENT_CREATE) our system is configured to automatically generate deliveries for the return SO.
The scenario we are facing an issue in is, during data processing, a delivery is created using FM W_FRM_DELIVERY_CREATE_GENERAL, delivery is then processed for picking and PGI using FM WS_DELIVERY_UPDATE.
For the next record, a return order is created using FM SD_SALESDOCUMENT_CREATE, which also automatically tries to create the delivery. At this point we get an update terminate upon COMMIT and dump says SAPSQL_ARRAY_INSERT_DUPREC pointing towards form VBFA_BEARBEITEN.
Based on my analysis, while updating table VBFA the internal table DA_XVBFAI also has document flow for the previously processed regular sales order for which the system tries to insert a record in VBFA. This is a duplicate record and the update is terminated. The buffer nees to be refreshed and I tried using FM SHP_DELIVERY_BUFFER_REFRESH and LE_DELIVERY_REFRESH_BUFFER. None of these seem to refresh the VBFA buffer.
I would appreciate if anyone can share their experience with this issue. Thanks for your help!
-Roger

Hi,
Try using one of these function modules BUTX_FRG0010_CLEAR_BUFFER or CK_F_SHARED_BUFFER_DELETE or COM_IL_DB_RESET_BUFFER or SNC_USER_FLUSH_BUFFER .
KR Jaideep,

Similar Messages

  • One time Discount Coupon to be used during the Sales Order Creation

    I need help to configure a one time coupon to be used during a Sales Order creation. During 2009 our customers that have purchased more than certain amount we are going to give them a discount Coupon with a code that they can use just one time during his next purchase. I need help to configure this request.
    Thanks

    Hi Gilberto
    Go VK11.
    After maintaining the material & price, please go to -->Additional data.
    You will be displayed with Validity, Assignments, Assignments for retail promotion, Limits for Pricing, Payments.
    In the 'Limits for Pricing' you have three options - Max. condition value, Max number of orders & Max condition base value.
    In the Max number of Orders - enter 1 to avail this special price only for first order.
    Importent Note: to activate the ' Limit of Pricing' -- you need to tick 'Condition update' for the particular contion type, in condition type customising.
    FOr eg. condition type - ZR00 - you need to have special price for this condition type & want to limit only for first order order.
    In the customising for ZR00 - 'condition update' need to be ticked, then only you can get the above option.
    i hope it is clear to you
    thank you
    Anirudh

  • How the availiblity check is carried out during the sales order creation

    Hi All,
    I have maintained planned delivery time, GRProcesing time and replenishment lead time in days in material master. I am not understand ing how the system is calculating the availability date of the material during sales order creation.
    Please do needful regarding this.
    Regards
    Phani

    Hi,
    Using the Scheduling data from Delivery & Transportation Scheduling, the system does the backward calculation from the Requested Delivery Date. This is used to arrive at Material Availability Date.
    On the Material Availability Date, system checks the Available Qty, as seen in CO09 in column ***. ATP Qty. If the Available Qty is > than Required Qty, Requested Delivery Date is confirmed. Otherwise,
    System moves into the future till it finds the required Available Qty. The new date is then the new Material Availability Date.
    On getting the confirmed Material Availability Date, system does the Forward Scheduling to arrive at a Confirmed Delivery date.
    Regards

  • Not able to Create Credit Memo During Return Sales Order

    Hi Guru's,
    Need your help in the below problem:-
    While Creating Return Sales Order it give us Order No with delivery no. and then finally I am able to do VL02N where I did Post Good Return sucessfully and also check using MB51 that goods got return.
    But when we try to create Credit Memo using VF01 I got the below message in log.
    Error Log
                 0060000799 000000 "Create billing document" not allowed (User Status LKD, object VB0060000799000000)
                LongText
                Technical data   ))))))))
    I have checked all copy control including Iteam Category etc etc all are in place.
    Looking for your help.
    Thanks
    Best Regards
    Bidhan Konar

    Thanks Krishna,
    Thanks for the solution. Find below the steps which i follow:-
    Go to Tcode VA02, Use the sale order reference and execute. From top menu bar, click on "Goto -- Header -- Status. Then again click on "Object Status" and when check I find that lock is there:- A radio button checked at -- 10 LKD Locked and change it to
    --20 REL Released and SAVE. Finally working.
    Thanks
    BR
    Bidhan
    Edited by: Bidhan Konar on Jun 3, 2010 8:35 PM

  • Credit Check at Sales Order Creation  & Delivery Creation levels

    Hi
    I am using Dynamic Credit check, Assigned  credit group (with block) in OVAK for Sales Orders and for delivery types also assigned credit group.
    Issue is while creating Sales Order system is doing dynamic credit check and blocking the sales order but delivery block is not happening, then i am releasing block in VKM3. but while creating Delivery system is not doing dynamic credit check.
    requirement is in both levels system should check the credit check.
    Can any plz guide me.
    Prasad

    Hi
    It is not possible in the standard. The block at different levels is configured based on the degree of risk involved with the customer. If the customer is more risky, he should be blocked at ordr livel itself. If the customer is less risky, the order should be processed , like picking, packing etc., and only Goods Issue should be stopped.
    The release will be done by a responsible person and hence it should not block again. eg., if the order is released with special approval from a higher up like Marketing - GM, then it should not block the delivery again.
    Thanks,
    Ravi

  • Disable / Deactivate Update Price button in Sales order creation

    Hi Gurus,
    My requirement is to disable the 'Price Update' button in the item --> conditions screen while creating or changing the sale sorder. A set of users should not be able to update the prices using 'Update Pricing' button. Is there any way to disable/deactivate  this button in VA01 / VA02?
    Regards,
    Sam

    Hi Sam,
    I think you can control through Authorization for the set of users to update the price in the sales Order.  I think it will solve your requirement.
    Regards,
    SK

  • Return Sales Order - And its Status

    Hello Experts,
    I have a question in the sales returns scenario.
    Step 1: I Create a sales order ( With two items and delivery full ) and perform steps till billing ( invoice ).
    Step 2: I Create Return sales order with reference to the first sales order but i take Only one item to return.
    Now the status of the return sales order is Being Processed.
    Step 3: I create a complete ( deliver full quantity of the item ) return delivery with reference to the return sales order and save the document. Now still the return sales order is in status Being Processed. Ideally i should have been Completed.
    Step 4: I do the Goods receipt for the return delivery. Now also the status of the returns sales order is Being Processed instead of Completed
    Kindly suggest any way to control the status of sales document or is this the ideal way( if so what's the functional purpose behind this ? ).
    Is this because the billing block is still set in the Return sales order ?

    Do you mean that only after credit memo creation or clearing of the credit memo from FI the status of return order is set to completed?
    If this is an ideal scenario, in one of our systems the status of return sales order is set to completed immediately after returns delivery creation.
    This behavior is same as that of normal sales order scenario, where the sales order status is set to completed once the delivery happens.
    Kindly suggest, if there is any customizing to control the oeverall status update for specific sales order types or based on the type of sales scenario.

  • Customer GL Account Updates by Creating a Sales Order

    Dear all,
    I would like to know detailed information about customer GL Account updates based on Sales Order creation.
    We have a POS system, there we are creating Sales Orders for the customers.
    As per my knowledge by creating a sales order system is performing the following jobs.
    Debiting Customer Account
    Crediting Sales Account.
    Please suggest me that my understanding is right or not.
    What else job is performed with regards to financial accounts for the customer.
    Where can I see these updations at each level starting from Sales Order creation, Delivery and Invoice.
    Please educate to get a clear idea of the process. your suggestions will be highly appreciated.
    Thank you
    Raghu Ram

    Hi,
    there will no accounting entry at sales order creation.
    Here is the sd cycle:
    sales order no accounting effect
    goods deleivery to customer
    COGS a/c dr
    to stock
    Billing to customer
    customer a/c dr
    to sales revenue
    Hope this is clear
    pls assign points if it was
    Thanks
    Vamsi

  • Sales order creation with respect to contracts

    Hi Guys,
    I am trying to create a saleorders with referece to contract for which in the background I configured so that during my sales order creation I see the pop-up box with all existing contracts for a specified sold-to party.
    This process is so painful that order entry people have to manually select from the big list (pop up box consisting of huge list).
    Is there any way so that I can automate this process insetead of selecting contracts from that list.
    Regards
    Krishna

    Hi Ravi,
    Thanks for your solution and could you please give me some more details what is the neame of the user exit.
    and welcome for some more suggestions.
    Thanks
    Krishna
    One way is to create the order with reference to the Contract and then the system will not give the pop up for the existing contracts.
    The other way to automate the process is by using a userexit. Here the system should check all the existing valid contracts for this sold to party and should select the oldest or latest valid contract, as per the client choice.
    Thanks,
    Ravi

  • Return sales order-manual item discount distribution error

    Hi All,
    I have created a sales order for an article with a quantity of 10 CS.
    At item level i gave one manual discount XXXX (Displaying charges Discount) of INR 100/-.The sales order is perfect till i billed it.
    The customer sends back 1 CS (case) for some reason.
    I created a Returns sales order and when i checked the discount XXXX, same INR 100/- is pulled from sales order.
    This discount value should have been divided by 10 and for one quantity it should have been INR 10/- in Returns sales order.
    I tried by clicking the update button in returns sales order. Nothing is changing.
    Please suggest me how do i control this functionality?
    Thanks,
    Prince.........

    Hello Prince,
    This is strange. The revaluation of the quantity based discount condition type must have happened as soon as  you modified the quantity.
    At what point in time do you modify the quantity in the returns order to reflect the actual quantity being returned? Have you verified that there is no custom pricing routine that overwrites the value determined by the standard SAP logic as a result of the quantity modification?
    You can refer to the SAP note 930870 that explains the circumstances under which SAP does not perform a revaluation of the condition type.
    Best Regards,
    Balaji

  • Apportion Excise value in Return Sales order

    Hi,
    With reference to Depot scenario, when there is a return sales order created reference to Customer Invoice, the Excise values are not getting apportioned with reference to manual change in the quantity.
    As per our customized routine the excise values are copied from Excise invoice to the customer invoice, instead of condition record. And as per the copy control settings the excise values are directly copied from Customer invoice to Return sales order. But when the quantity is changed in the return sales order only the Base price is changed, but the excise invoice (condition type - JEXP) is not changed as per the changed quantity.
    If i do the update price in return sales order(order type - ZRC) the excise value is picked from condition order, but as per requirement of the business they will not do the update price, only the quantity in the return sales order is changed by the user.
    Can you please let us now the solution how to apportion the excise value based on changed quantity.
    Regards,
    Jagadish

    but the excise invoice (condition type - JEXP) is not
      changed  as per the changed quantity.
    Assuming that the Calculation Type of your above condition type is percentage, I have a feeling that unless you wrongly assigned the From-To step number in your pricing procedure, definitely, based on the quantity, your price will vary and based on this price, your ED should also get changed.  So check your return depot pricing procedure once again.
    thanks
    G. Lakshmipathi

  • Addition of Condition type in XKOMV programmatically - Sales Order creation

    Hi,
    I need to add a condition type ( a record with whole data like Amount etc,.) in XKOMV programmatically during a Sales order creation, so that the new condition type gets automatically saved along with other data in VA01. Please suggest the better way of doing this - through Userexits or Form routines.
    Thanks in Advance,
    Sirisha.
    Edited by: hema Namuduri on Oct 20, 2011 5:12 PM
    Edited by: hema Namuduri on Oct 20, 2011 5:13 PM

    Hi E_Hinojosa / madhurao123,
    I added the below code in FORM userexit_xkomv_bewerten_end ( of Include: RV61AFZB ) which will get triggered in 'Pricing' Function Module.
          FORM USEREXIT_XKOMV_BEWERTEN_END                              *
    FORM userexit_xkomv_bewerten_end.
    DATA: l_amt1 TYPE vbak-netwr,
                v_waerk TYPE waerk.
    l_amt1 = '56000'.    " Let's say..
              READ TABLE xkomv WITH KEY kschl = 'ZF02 '.
              IF sy-subrc <> 0.
                  xkomv-stunr = '012  '.
                  xkomv-kschl = 'ZF02 '.
                  xkomv-krech = 'B    '.
                  xkomv-kwert = l_amt1.
                  xkomv-kbetr = l_amt1.
                  xkomv-ksteu = 'C'.
    Select single waerk into v_waerk from vbak where vbeln = komp-vgbel.
                  IF v_waerk <> space.
                    xkomv-waers = v_waerk. 
                  ENDIF.
                  xkomv-zaehk = 99.
                  CLEAR: xkomv-kntyp,
                         xkomv-kstat,
                         xkomv-kolnr,
                         xkomv-knumh,
                         xkomv-kopos,
                         xkomv-kinak.
                  xkomv-kherk = 'C'.
                  xkomv-kvsl1 = 'ERL  '.
                  xkomv-drukz = 'X'.
                  xkomv-kaend_loe = 'X'.
                  xkomv-updkz = 'I'.
                  APPEND xkomv. CLEAR xkomv.
                  DELETE xkomv WHERE kschl = 'ZH00 ' OR kschl = 'ZF00 '.
                  komp-netwr = l_amt1.
                ENDIF.
    ENDFORM.                    "USEREXIT_XKOMV_BEWERTEN_END
    Above is the main logic I am using, apart from other Export, Import statements etc,.The above code is getting triggered during every screen transition.
    It is automatically adding condition type 'ZF02' with all values during the creation of sales orders for some contracts, but not for other contracts. I am trying to trace what is the difference in both scenarios.
    Please suggest.
    Regards,
    Sirisha N.

  • Alert on Sales Order Creation

    Hi All,
    My client is working on SAP Business One 2007B with PL 00.
    Client's requirement is that they want alerts to be sent to the warehouse people on Sales Order creation to process the respective order,and there are 4different locations.means for every location users are different and the query need to be made that filters according to the location/Warehouse.
    Can anyone help me out to solve this issue.
    Thanx in advance.
    Regards,
    Ashish

    Hi Ashish,
    1. Save the following query (you could modify it with extra columns or conditions) 4 times, everytime with a different warehouse.
    SELECT ORDR.DocNum, ORDR.CardCode, ORDR.CardName, ORDR.DocTotal
    FROM ORDR INNER JOIN RDR1 ON ORDR.DocEntry = RDR1.DocEntry
    WHERE  CONVERT(VARCHAR(10), CreateDate, 105) = CONVERT(VARCHAR(10), GETDATE(), 105) And RDR1.WhsCode = [Fill in 1 of the 4 warehouses]
    2. Make 4 new alert and insert the queries above in the alerts.
    3. Set the frequency to popup.
    4. Add the right people to the right query.
    That is the most easy way to do it. The warehouse people will see all the orders that have been created at the present day.
    Kind regards,
    Hendri Wessels

  • Update error in  RV_SALES_DOCUMENT_ADD during Sales order creation

    I get an Update/ ABAP runtime error during Sales order creation. The error occurs during processing of the update module -RV_SALES_DOCUMENT_ADD.
    This error does not occuring always, as I am sometimes able to create a Sales order without getting update error. I am getting the error of all types of Sales orders and even contracts.
    Am I missing any configuration parameters?
    Thanks,
    Chitra

    Yes , I can see the error in ST22.
    While exceuting VA01 (Oder type OR, Entering Sold-to-party, Purchase order NO, Material, Qty, Plant),
    - I get run-time error "Run-time error "GETWA_NOT_ASSIGNED" occurred".
        Analysis of error shows:
         Update terminated in "Update module: RV_SALES_DOCUMENT_ADD"
          Fails in the Read table in one of the form
            Termination occurred in the ABAP program "SAPLV45U" - in "VBAP_BEARBEITEN"
    The main program was "RSM13000 ". In the source code you have the termination point in
    line 147 (READ TABLE FYVBAP WITH KEY VBAP_KEY.)
    of the (Include) program "LV45UF0V".
    The ABAP's say the functional module is trying to do an 'UPDATE' instead of 'INSERT" in the internal table FYVBAP.
    Thanks,
    Csuman

  • User Exit during Sales Order Creation - New Line Item needed

    I have a situation during the process of sales order creation. If a Material in a line item has say 27 EA and the Base Unit is EA. But the Sales Unit is CSE. Then whenever the user enters 27 EA and presses enter he should get two line items.
    The first line item needs to convert to maximum number of CSE posible and the rest will be the second line item with the remaining EA. The order isn't important but that is what is needed. Question is how do I approach this problem and code my user exit accordingly and where do I code it.
    I was looking at SAPMV45A and saw the program MV45AIZZ which is meant as a user exit for any PAI event handling. If anybody has encountered this kind of requirement can you please share your view on this.
    I will definitely reward points for useful answers.
    Clark

    Hello Mahendra
    The requirement is as follows :
    PART 1:
    Sales Order Enter: 
    1.     When a line item is entered on a sales order (VA01 or VA02), at enter, check the sales unit of measure (VBAP-VRKME).
    •     Do not check line items where item category (VBAP-PSTYV) = TANN, TAPS or ZTAP.  TANN are free goods that should not be considered for consolidation.  TAPS & ZTAP are lower level materials as a result of product selection.  They will be attached to a higher-level material with an item category of TAX, which is relevant for consolidation.
    •     Do not check items where VRKME <> EA
    2.     If VRKME = EA, go to MARM for MATNR.
    3.     Go to record where alternate unit of measure (MEINH) = CSE, get the value from the numerator field (UMREZ).
    4.     Divide the order quantity (VBEP-WMENG) by UMREZ.
    5.     If the result is greater than 1.0, the customer has ordered more than one case and a new line item needs to be added to the sales order for the case quantity.
    6.     Add a new line to VBAP for the same material with the case quantity.  If not a whole value, the remainder of eaches (bottles) should update the qty on the first item on VBAP.
    •     Part 1 is relevant for order types ZCA, ZOR, ZSO, RE, ZSM
    PART 2:
    Batch Job to run prior to the Delivery Due List:
    1.     Read VBUK for Delivery Status (LFSTK) = A (delivery not processed).  Get all of the document numbers (VBELN).
    2.     Go to VBEP for those document numbers to get the goods issue date for the order.  There will be many records in VBEP for the same sales order.  Look at all orders with a goods issue date (WADAT) of next day.
    3.     Go to VBAK for those document numbers to see if there are multiple sales orders for the same Sold To party (KUNNR).
    4.     For customers who have more than one order in VBAK, search all line items (for all orders).  If there are no duplicate materials across sales orders, do nothing.
    •     Do not check line items where item category (VBAP-PSTYV) = TANN, TAPS or ZTAP.  TANN are free goods that should not be considered for consolidation.  TAPS & ZTAP are lower level materials as a result of product selection.  They will be attached to a higher-level material with an item category of TAX, which is relevant for consolidation.
    •     Do not check line items where reason for rejection (VBAP-ABGRU) is not blank
    5.     If there are duplicate materials, go through the same logic as in part 1.  If the quantity across the sales orders adds up to greater than one case, add the appropriate quantity to a new line item on the first sales order.   If there is a remainder qty, update the line item on the first sales order with this qty. In this case, the quantities on the second sales order needs to be closed out with a reason for rejection code of 50, ‘Line Item Consolidation’. If there is no remainder,  update the qty on this item directly.
    •     Part 2 is relevant for order types ZOR, ZCA, ZSM
    •     This batch job will have to be run manually for Day Pick orders.  The end of this program should automatically kick off the delivery due list for Day Pick orders, shipping condition 02.
    Business Justification:
    The business requires that like order line items be consolidated to one line item prior to the order going to the warehouse for picking.  This will aid in picking at the warehouse as well as result in the customer invoice not reflecting more than one line item for the same material.  In the case where the customer has truly ordered more than a case, i.e;, 1 case, 2 bottles, the documents in SAP will still reflect 2 lines.

Maybe you are looking for