Order Management

Get Involved. Join the Conversation.

Topic

    Edgar Martinez
    How to cancel a line with backordered status of a sales...
    Topic posted October 1, 2019 by Edgar MartinezBlue Ribbon: 750+ Points, last edited October 1, 2019, tagged Order Management, SCM 
    98 Views, 9 Comments
    Title:
    How to cancel a line with backordered status of a sales order using Rest API?
    Content:

    I am trying to cancel the line of a sales order that remained in backordered status. But I am trying using the PATCH method of the Rest API '/fscmRestApi/resources/11.13.18.05/salesOrdersForOrderHub/{OrderKey}/child/lines/{FulfillLineId}'

    The payload I am using is as follows:

    {
      "CancelReasonCode": "CANCELACION DEL CLIENTE",
      "CancelReason": "Cancelación",
      "CanceledFlag": true,
      "OrderedQuantity": 0
    }

    However, I get the error:

    SourceTransactionLineNumber 1, SourceScheduleNumber 1: A closed or canceled line cannot be updated
    SourceTransactionLineNumber 1, SourceScheduleNumber 1: The request failed because it doesnt include a value for attribute SourceLotSerialId, or value that it does provide isnt valid.
    The request failed because it includes lot serial details on an order line that isnt a return line. Include these details only on a return line.

    Does anyone have a Payload to cancel lines from a Sales order?

    Thank you!

    Image:

    Comment

     

    • Venkatesh Malapati

      A sample URL & payload that should be used for canceling backordered line using patch method is as follows. For the order key you should be providing the sourceordersystem:sourceorderid as shown below.

       

      https://host:port/fscmRestApi/resources/11.13.18.05/salesOrdersForOrderHub/GPR:300100181813776

      {
      "lines": [
      {
      "FulfillLineId":300100181814670,
      "OrderedQuantity": 0

      }
      ]
      }

      You may want to run through your scenarios and verify if there are changes that are getting triggered on other lines also even though only backordered line is requested to be canceled. There are some known defects that are already tracked for that case.

      • Edgar Martinez

        Hi Venkatesh,

        Thanks for the help. However, with the Payload and URL provided it shows the same error:

        SourceTransactionLineNumber 1, SourceScheduleNumber 1: The request failed because it doesnt include a value for attribute SourceLotSerialId, or value that it does provide isnt valid.
        The request failed because it includes lot serial details on an order line that isnt a return line. Include these details only on a return line.

        Will it be a configuration issue in the ERP?

         

        Thanks!

    • Venkatesh Malapati

      Which release are you trying this on? Patch of a sales order is supported only from 19C.

      • Edgar Martinez

        19C version

      • Edgar Martinez

        Hi  Venkatesh,

        Sorry!

        Do you know if the cancellation with the Rest API also works for lines with Backordered status and the order has already been partially shipped?

        Because for the other status it works correctly, as long as the line has not presented shipping activity.

        • Venkatesh Malapati

          Yes, the REST API allows the backordered line to be canceled. Even though the backordered line does get canceled, we have seem in some instances where the shipped line which is at Awaiting Billing is going into an error state upon the cancellation of the backordered line and there is a defect that is tracked for that scenario. Are you seeing the same issue in your case as well?

          • Edgar Martinez

            Hi Venkatesh,

            No, I still can't cancel the line in Backordered and partially shipped with the Rest API.

            I am trying this way:
            URL:
            https: //server/fscmRestApi/resources/11.13.18.05/salesOrdersFordersderHub/OPS: 300000023775381

            Payload:
             

            {
              "HeaderId": 300000023775381,
              "OrderNumber": "6038",
              "SourceTransactionNumber": "6038",
              "SourceTransactionSystem": "OPS",
              "SourceTransactionId": "300000023775381",
              "OrderKey": "OPS:300000023775381",
              "lines": [
                   {
                          "FulfillLineId":300000023768847,
                          "CanceledFlag": true
                   } 
                ]
            }
             

            But give this error:
            SourceTransactionLineNumber 1, SourceScheduleNumber 1: The request failed because it doesnt include a value for attribute SourceLotSerialId, or value that it does provide isnt valid.

            The request failed because it includes lot serial details on an order line that isnt a return line. Include these details only on a return line.

    • Alice Mazodier

      Hello, 

      I don't know about the REST service, but we managed to cancel a backordered line with SOAP.

       

      There is not a simple way handle that case.

      To cancel this line, we need to update the former line (before split) by decreasing the ordered quantity.

      Example :  

      • Line 1 – 10 UN

      After scheduling :

      • Line 1.1 – 6 UN
      • Line 1.2 – 4 UN

      When we need to cancel the line 1.2, the only way to do it is to send the quantity on the original line as what fulfilled on a change order.

      • The quantity on the line was sent as 10 when it was imported and then subsequently due to partial shipment it got split to 6 & 4, where by 6 was shipped and 4 was back ordered. 
      • So while canceling the back ordered line, the quantity on the order line in the webservice payload should be sent as 6. 

      So in this case, we can not even specify a cancel reason. And this way to cancel the backordered line is not at all consistent with the definition of cancellation.

      Note that I created an Idea to have a proper operation CANCEL.

      https://cloudcustomerconnect.oracle.com/posts/116c7bdc85

    • Venkatesh Malapati

      I am not seeing the same error in 19C environment where I tried as what you are running into. I suggest you follow through with support through an SR.

      The following payload works for me except where the backordered line got canceled. But the line that was at awaiting billing ran into an error for which a defect is already tracked.

      https://host:port/fscmRestApi/resources/11.13.18.05/salesOrdersForOrderHub/GPR:300100181813776

      {
      "lines": [
      {
      "FulfillLineId":300100181814670,
      "OrderedQuantity": 0

      }
      ]
      }