1 Reply Latest reply on Nov 26, 2010 9:02 AM by 813340

    Issue in Purchase Order approval

      Hi All,

      I am facing an issue in purchase order approval process . Need suggestion from your end.

      Purchase order approval gor failed in the work flow stage 'Get PO Attributes'.

      I could find that this is because one of the line distribution has quantity ordered as 0 .

      And the proc (PO_POAPPROVAL_INIT1.GET_PO_ATTRIBUTES) which is attached to the node 'Get PO Attributes' is ending in error (Divide mby zero error in the proc )

      Workflow is failing on the node 'Get PO Attributes' .
      Function which is getting called : PO_POAPPROVAL_INIT1.GET_PO_ATTRIBUTES

      Since the quantity_ordered in one line Distribution is zero, the function is giving error (while trying to divide by zero).

      Query which is failing is

      " SELECT SUM( ROUND (POD.nonrecoverable_tax * DECODE(quantity_ordered, NULL, (NVL(POD.amount_ordered,0) - NVL(POD.amount_cancelled,0)) / NVL(POD.amount_ordered, 1), (NVL(POD.quantity_ordered,0) - NVL(POD.quantity_cancelled,0)) / NVL(POD.quantity_ordered, 1) ), X_precision ) )
      INTO l_tax_amount
      FROM po_distributions_all POD
      WHERE po_header_id = POHdr_rec.po_header_id;"

      My question is that, how to fix this issue now (any data fix possible? ). As far as I know I will not able to amend the PO now. Kindly give me a work around for this.

        • 1. Re: Issue in Purchase Order approval
          There is a generic datafix script shipped as a patch. This script will help in resetting the document to Incomplete / Requires Reapproval status. There after you can adjust the PO to have correct quantities and re-approve it.

          The datafix script is $PO_TOP/sql/poxrespo.sql. Please read the documentation and try out in test instance first.