BAPI/IDOC to cancel the sales order ?

Hi folks,
What is BAPI /IDOC to cancel the sales order in ECC via PI .
Thanks.,
Shiva

Hi Shiva,
To my thinking you can use the BAPI for canceling and updating the sales order.
For further reference you can have a look on the below link:
BAPI SALESORDER CHANGE
In this link you will find the values to be filled for performing different function for the BAPI.
Regards
Ravi Anand

Similar Messages

  • How to cancel the sales order - header and line status are in Entered Stage

    Dears,
    I have some sales order to be cancelled in which the header and line status are in *"Entered"*. I am not able to cancel these sales order.
    Also note that these orders are for maintenance service.Once i book these orders the lines will change to closed status.
    So it is not possible to book and cancel the lines.
    Kindly me to resolve this.

    926530 wrote:
    Boss,
    If i do Action-->cancel on header, it just makes the qty to zero.But the header and line status still showing as entered.It will not cancel the order.
    The problem for me is that these lines are coming in my monthly reports. This is what your question says...be more specific as what is your issue..which in turn is your problem
    How to cancel the sales order - header and line status are in Entered Stage
    Coming to your Action-->cancel...as far as i know ...the header status will change to canceled..
    unless until you have some processing constraints in place...which is stopping you...
    HTH
    Mahendra

  • How to Cancel a Sale Order without cancelling the subsequent document.

    Dear All,
                 I want to cancel sale order but the sale order have a subsequent document is there is any soulution that when i cancel the sale order all the subsequent document, outbound delivery and invoice cancelled in jn\ust one step, if not then what is the other way to solve that problem.

    Hi
    You can reject the sales order by going to VA02
    Go to-> Item -> Enter Reason for Rejection
    and save the order.
    This will reject the order even if the subsequent documents are created so that no further open quantities can be delivered.
    Reward points if useful.
    Regards,
    Nimit
    Edited by: Nimit Raiya on Jul 3, 2008 4:03 PM

  • Where we can check the Sales order cancel reason?

    Hi,
    We are developing a custom report for Sales Order Booked Vs Cancelled. In this report we want to display the reason for canceling the order. We are selecting the reasons while canceling the sales order. But the reasons are not showing in the tables. Where we can check the reason for canceling? Is there any table?
    Regards,
    Prabhu.S.J

    Check this query:
    SELECT FLT.MEANING, OER.REASON_TYPE, OER.REASON_CODE, FLV.MEANING, OER.COMMENTS, OER.CREATION_DATE, OER.REASON_ID, OER.ENTITY_ID, OER.ENTITY_CODE, OER.VERSION_NUMBER, OER.HEADER_ID from OE_REASONS OER, FND_LOOKUP_VALUES FLV, FND_LOOKUP_TYPES_VL FLT WHERE FLV.LANGUAGE = userenv('LANG') and FLV.VIEW_APPLICATION_ID = 660 and FLT.VIEW_APPLICATION_ID = 660 and FLT.SECURITY_GROUP_ID = fnd_global.lookup_security_group(FLT.LOOKUP_TYPE, FLT.VIEW_APPLICATION_ID) and FLV.SECURITY_GROUP_ID = fnd_global.lookup_security_group(FLV.LOOKUP_TYPE, FLV.VIEW_APPLICATION_ID) and FLV.LOOKUP_TYPE=FLT.LOOKUP_TYPE and OER.REASON_TYPE=FLV.LOOKUP_TYPE and OER.REASON_CODE=FLV.LOOKUP_CODE;
    It might help you.

  • Cancellation of Sale Order

    Hi all,
    I have an issue with SD/FI.   The details are given below:
    I would like to cancel a Sales Order due to wrong sold-to-party selected. There is an existing accounting document created.
    How do I proceed with the cancellation of the Sales Order? I want to prevent this SO from being used.
    This is the first transaction.   Actually, the Accounting document generated through Billing Document and the same was cleared against down payment. 
    Is it possible to cancel the Sale Order to change the sold-to-party without affecting the Sale Order.
    As per my observation, it is not possible once the accounting document generated.
    If we want to cancel the Sale Order, is it possible?
    Reverse the clearing document, down payment document & billing document.
    Then cancel the billing document. 
    Hence, we can cancel the Sale Order.  
    It will affect the previous period balances.   Is it correct??
    Can any one give some guidelines.  Whether I am correct or not??
    Thanks & Regards,
    SAP

    Thanks for all your efforts and replies.
    As per discussion, I convinced to make JV for subsequent adjustment.  
    How to protect the concern sale order to avoid future use.
    I hv tested in SO through development after selecting "Cancel Sales Deal" in the field Reason for Rejection.
    Tried for billing and it is not allowing.
    Can I suggest this methodology??
    Pls note that there is no sales scenario.    The contract and deposit money transactions handled
    through SD.
    Please give your opinon or give some more stop to prevent the SO.
    Regards,
    SAP

  • Inbound IDoc used for updating Sales order status

    I have a requirements to set use standard IDoc to send out the Sales order to a non-SAP software as well as receiving Inbound IDoc to update the status of sales order in SAP. Could someone comment on my questions below:
    1. What are the difference between all the ORDERSxx Idoc types?
    2. What IDoc should be used for Inbound IDoc to update the sales order stataus in SAP?
    3. Can the same IDoc type be used for both Inbound and Outbound with only the difference in the segment of Direction?
    Thank you. Points will be awarded appropriately for helpful comments.

    Hi,
      1.Intially  standard IDOC types "ORDERS01"  is having limited
          segments. After few months the requirement got increased to
          add more fields to "ORDERS01".So,once you release the IDOC
          type you can not add any more fields .So SAP come up
          with "ORDERS02" with new fields.Like that all IDocs types have
          some more new seg ments.
    2.You  can use ORDER05
    3. Yes you can use same IDOC type

  • How to delete or activate the deletion flag for the sales order line item

    Hi All,
    I  have one Cust order & with referance to that cust order one production order is created . The production order user has done the Goods issue with 261 movement type  & GR wi 101 before 4 months back , & he has reverse  the GR  with 102 on todays date . but in materila master the  variable prize is maintain thats why it is showing  a differance in the cost .
    User want to delete the Production order as well as the custemer order From MDO4 , So we have make the Production order TECO & save , it is gone form the MD04 but the Custumer order still there . It is not allow us to cancell or reject . We have tried to maintain the reason for rejection but it showing the message that you can not activate the deletion flag for the order .
    Could you please Help me to find out the way how can i delete the custemer order ?
    Thanks In advance
    Regards
    Piyush

    W ehave Settele that order & then activate the deletion flag for the order & then cancel the sales order.

  • Cancellation of sales order

    Hi,
                How to cancel the sales order?
    It is very urgent.............
    Thanks in advance

    hi,
    Use BAPI_SALESORDER_CHANGE to change or delete or insert a sales order.
    check this.
    DATA: T_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    DATA: BAPISDH1X LIKE BAPISDH1X.
    PARAMETERS: P_VBELN LIKE VBAK-VBELN.
    SET THE DELETION FLAG
    BAPISDH1X-UPDATEFLAG = 'D'.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    salesdocument = P_VBELN
    order_header_inx = BAPISDH1X
    tables
    return = T_RETURN
    COMMIT WORK.
    <b>Reward Useful Points</b>
    Message was edited by:
            SivaKumar

  • How to populate the billing plan tab for the sales order inbound

    Hi Team,
    I am new to IDOCS, I have a requirement like IDOC extension of the sales order inbound.
    Can anyone explain in brief how can i add billing plan tab in  the IDOC extension for the Sales order inbound.
    Thanks, 
    Barathi

    U need to use the table vbfa or fololow thw link
    [http://www.erpgenie.com/sap-functional/sd/read-sales-document-flow-using-a-function-module]

  • Cancel a Sales Order via IDOC processing

    Hello,
    I am trying to cancel an item within a sales order using ORDERS05 (IDOC_INPUT_ORDCHG).
    My IDOC contains the following data:
    E1EDK01-ACTION = 003 (Changes in one or more items)
    E1EDK02-QUALF  = 002 (Vendor Order)
    E1EDK02-BELNR  = SAP Sales Order Number to be updated.
    E1EDP01-POSEX  = SAP Sales Order Item Number to be deleted (eg. 000010).
    E1EDP01-ACTION = 003 (Item cancelled)
    E1EDP19-QUALF  = 002 (Material number used by vendor)
    E1EDP19-IDTNR  = SAP Material Number of Item to be deleted
    However it does not seem to be working correctly. Instead of removing the item from the sales order - it actually creates a new item.
    Has anyone had any experience with successfully cancelling an item using IDOC processing?
    Any assistance would be greatly appreciated.
    Thanks and Regards,
    Corinne

    Hi Corinne,
    I don't think you'll get back the response you want from SAP.  This idoc was originally created to support the EDI scenario where your customer makes a change to their purchase order.  The EDI message would be sent to SAP to update the corresponding sales order in your system (after being mapped to an Idoc).
    As your customer does not normally not have your sales order item number in their system, they can only send their own purchase order item number.  SAP then uses this number to look up the corresponding SAP sales order item number via the VBAP-POSEX field (which in this scenario is originally populated by the Idoc which created the order from the customers original purchase order EDI message).
    So, I dont think SAP will change this functionality.  They may offer, however, a work around!
    What I still think is strange though, is that, having not found a match for your item on the POSEX field, SAP ignores the deletion flag and adds a new item to your order.  At the very least you would expect it to just ignore the item (a quick look at the code in 4.7 seems to imply that this is what SAP is trying to do - maybe a change from your version?).
    Hope that helps.
    Brad

  • Need help on IDoc for Picking, Packing and PGI against the Sale order

    Hi All,
    I am new to this IDoc stuffs. Below is the scenario for which I would like to know the details of the IDoc...
    Business Case:
    1. Storage location is a HU Managed but not WM managed.
    2. This storage locations is managed by a third party
    3. Outbound delivery document against the SO will be created by our personnels in SAP for this storage location.
    4. Picking, Packing and PGI needs to happen/post via Idoc. (By packing here, i refer to assign the HUs that are already created for the materials and is available in the storage location and not repacking)
    Is there any standard IDoc that can be used here to Pick, Pack and post PGI. We would like to have picking and packing in a first idoc and PGI on the second idoc.
    Thanks,
    Prashant

    Hi Typewriter,
    Thanks for your reply on this post..
    The business process is as below (it was changed recently to have the creation of OBD, pick HUS and then post GI via single IDOC)
    1. We have a storage loc in our enterprise structure that is HU managed but not WM managed.
    2. This storage loc is being maintained by a third party.
    3. SO will be created to be shipped out of this plant/sloc.
    3. The stocks at this storage loc will be Special stock "E" against the sales order. And the stocks will be Packed in HUs.
    4. The third party is informed to deliver the stocks (HUs - that do have the special stock number which internally refers to the the SO number and the line item number) directly to ship to party address in SO.
    5. The 3rd party will physically ship the HUs to customer and send in the details that they have shipped goods against the sales order.
    6. The details sent by the 3rd party will be received in SAP to create OBD for the sales order, Pick, Pack and post GI. This can happen via a single IDOC..
    I am now planning to create a custom IDOC type referring to the standard IDOC type DELVRY03 and message type DESADV and to use a custom BAPI/FM.
    Do you think I am using the right ones?
    Thanks,
    Prashant Kumar

  • Dates fields issue in the sales orders through IDOC

    Hi all,
    I'm trying to create a sales order through Inbound IDOC using IDOC_INPUT_ORDERS.
    I have 2 custom fields in the sales order which are date fields.
    I'm populating them from the IDOC segments(using E1EDKT1-tdid, E1EDKT2-tdline) in the user-exit just before the call trasacation statement. These dates are not coming for a few orders... but are getting populated normally for few of them.
    But the tricky part is that... if I process the same IDOC for the second time.. the order created is having the dates.
    My issue is that.. i need all the orders to be populated with the dates which IDOC have.
    Could anyone please help me with this issue.
    All the answers/replies are highly appreciated!!
    Thanks for you help!

    hi,
    the following may be of help
    There are 2 major exceptions to the batch input internal table. All text data from the segments E1EDKT1/2 and E1EDPT1/2 are not part of the batch input session. Text elements from these segments are posted directly to the data base AFTER the sales order has been created (please note: in order that item texts are posted correctly to the sales order the field POSEX from segment E1EDP01 MUST be transmitted). Also, configurable material information from the IDOC is exported to a global memory and therefore will not be part of the batch input session. Configurable material data is performed in Form CHECK_CONFIGURATION and the data is exported to global memory in the following code:
    Exportiert IDOC Daten ins globale Memory     
    export IDOC data to global memory            
      call function 'CUXC_IDOC_TO_MEMORY'          
           tables                                  
                cfg_instref = xe1curef             
                cfg_ref     = xe1cucfg             
                inst        = xe1cuins             
                part_of     = xe1cuprt             
                value       = xe1cuval             
           exceptions                              
                error       = 1                    
                others      = 2.                   
    One extra piece of useful infomartion if you wish to debug the process is to set your breakpoints at the following points
    for Function module IDOC_INPUT_ORDERS
    include LVEDAF0F..
      CALL TRANSACTION 'VA01' USING bdcdata
                                MODE  input_method
                                UPDATE 'S'
                                MESSAGES INTO xbdcmsgcoll.
    Now input_method is A foreground process and N for background processing but try changing it to P (pass through mode)
    If you have breakpoints in va01, e.g. MV45AF0B_BELEG_SICHERN,(the part where the sales document is saved)
    they will be hit, e.g
    perform userexit_save_document_prepare.
    perform userexit_save_document.
    Lastly, don't forget using program SDJEDI , see note 380603 for more information on this
    Hope this is useful
    Paul Quinn

  • Re: Printing Cancelled line items in the sales order on the packing slip

    Hi gurus,
    Currently we have a unique requirement in our company. Our wholesale customers send the Purchase order to us via EDI. Now saw they have requested an order containing 10 materials out of which we can fulfill only 8. the other 2 due to some reasons cannot be fulfilled.
    So the business wants to keep the other 2 line items to be entered in the sales order with a cancelled status.
    Now correct me if I am wrong, only the confirmed line items will be copied from a sales order to a delivery document. So thats the reason why these cancelled line items cannot be printed on the packing slip.
    However somehow the business wants the packing slip tp have the 2 line items printed on it with the reason of not being delivered. this is to facilitate the customer to know why those items couln't be fulfilled by our company. Now we cannot use a manual work-around of letting the customer know about the impossibility of not fulfilling the other 2 items as there are a lot of orders that come thru EDI per day.
    Can anyone suggest a solution to this requirement asap.
    Thanks in advance
    Vinit

    Hi Vinit,
    This requirement makes a lot of sense, that is to be able to inform your customer that some item(s) of the sales order could not be delivered, not even partially.
    A possible solution would be to allow for zero quantity in the delivery item (check customizing and mark "zero quantity allowed" in the item category).
    Then in the packing split, it would be easy to print the delivered quantity (0) and the sales order quantity (whatever it was), because you have the "null" item available in the delivery.
    Personally I am not found of having have delivery items with zero quantity, but they are useful in that case, and they can also be useful to automatically "close" the sales order item (instead of having to do it manually if the goods can't be served).
    Note: Usually in Consumer Goods, if you can't serve part of a sales order to a customer, you have to close it, because the Retailer's next Sales Order will include the remaining quantity.
    Hope it helps.
    Best Regards,
    Franck Lumpe
    Freelance SAP ERP Consultant

  • How to create the sales order using BAPI's ....?

    Hi Guru's,
    could you please provide how to create the sales order using BAPI's .....i need step by step process and please provide the details from scratch....basically  i don't have basic knowledge on this....please provide required inputs ....:)
    thanks in advance
    Srinivas......

    Hi Guru's thanks for your inouts and your valuble time...
    please find the program logic below...
    *& Report  ZAREPAS30
    REPORT  zarepas30.
    DATA : gs_vbeln                   TYPE  vbak-vbeln,
           gs_order_header_in         TYPE  bapisdhd1,
           gs_order_header_inx        TYPE  bapisdhd1x,
           gt_order_items_in          TYPE  STANDARD TABLE OF bapisditm,
           gwa_itab1                  TYPE  bapisditm,
           gt_order_items_inx         TYPE  STANDARD TABLE OF bapisditmx,
           gwa_itab2                  TYPE  bapisditmx,
           gt_order_partners          TYPE  STANDARD TABLE OF bapiparnr,
           gwa_itab3                  TYPE  bapiparnr,
           gt_return                  TYPE  STANDARD TABLE OF bapiret2,
           gwa_itab4                  TYPE  bapiret2.
    Sales document type
      PARAMETERS: p_auart TYPE auart OBLIGATORY.
    Sales organization
      PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    Distribution channel
      PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    Division.
      PARAMETERS: p_spart TYPE spart OBLIGATORY.
    Requested Delivery Date
      PARAMETERS: p_edatu  TYPE edatu OBLIGATORY.
    Sold-to
      PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    Ship-to
      PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    Material
      PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    Quantity.
      PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    Plant
      PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    Start-of-selection.
      START-OF-SELECTION.
    Header data
    Sales document type
      gs_order_header_in-doc_type = p_auart.
      gs_order_header_inx-doc_type = 'X'.
    Sales organization
      gs_order_header_in-sales_org = p_vkorg.
      gs_order_header_inx-sales_org = 'X'.
    Distribution channel
      gs_order_header_in-distr_chan  = p_vtweg.
      gs_order_header_inx-distr_chan = 'X'.
    Division
      gs_order_header_in-division = p_spart.
      gs_order_header_inx-division = 'X'.
    Reguested Delivery Date
      gs_order_header_in-req_date_h = p_edatu.
      gs_order_header_inx-req_date_h = 'X'.
      gs_order_header_inx-updateflag = 'I'.
    Partner data
    Sold to
      gwa_itab3-partn_role = 'AG'.
      gwa_itab3-partn_numb = p_sold.
      APPEND gwa_itab3 TO  gt_order_partners .
    ship to
      gwa_itab3-partn_role = 'WE'.
      gwa_itab3-partn_numb = p_ship.
      APPEND gwa_itab3 TO  gt_order_partners .
    ITEM DATA
      gwa_itab2-updateflag = 'I'.
    Line item number.
      gwa_itab1-itm_number = '000010'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    Line item number.
      gwa_itab1-itm_number = '000020'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
        order_header_in               = gs_order_header_in
        ORDER_HEADER_INX              = gs_order_header_inx
      IMPORTING
        SALESDOCUMENT                 = gs_vbeln
      tables
        RETURN                        = gt_return
        ORDER_ITEMS_IN                = gt_order_items_in
        ORDER_ITEMS_INX               = gt_order_items_inx
        order_partners                = gt_order_partners.
    Check the return table.
      LOOP AT gt_return into gwa_itab4 WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error occured while creating sales order '.
      ELSE.
    Commit the work.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        WRITE: / 'Document ', gs_vbeln, ' created'.
      ENDIF.

  • Need IDOC and segment for mappping the sales order number

    Hi,
    we need the IDOC name and segment for mapping the sales order number created by oracle in sap for transaction VA01.
    Whether the sales order number created by Oracle can be used to create the sales order in sap using the idoc ACC_SALES_ORDER01?
    . If we can do,then what is the segment and field for the sales order number in the idoc ?
    Please reply asap it's very urgent
    Thanks
    Edited by: suresh kumar nandhagopal on May 16, 2008 12:07 PM

    Hi,
    IDOC for sales order is ORDERS05. Segment E1EDKA1, for field go to SE11 and enter E1EDKA1 to find field for sales order.
    Cheers.
    ...Reward if useful.

Maybe you are looking for