0 Replies Latest reply on Sep 13, 2013 12:09 PM by User393354

    How does CLOSED_CODE updated in PO_LINES_ARCHIVE_ALL table




        How does CLOSED_CODE column will be updated in PO_LINES_ARCHIVE_ALL table. We have setup "Archive On Approve" for archiving.


        Does below is a valid check to verify the line count between lines table and archive table?


        We are comparing the line count in Lines table and Archive table, and if there is difference in count, then it is assumed to be change in the Lines,

        so then direct the PO Approval Worfkflow for re-approval.


        Kindly suggest if below check is correct or not, especially check on CLOSED_CODE='OPEN'.


        In few cases, the lines in PO_LINES_ALL table has CLOSED_CODE = 'CLOSED' but, PO_LINES_ARCHIVE_ALL table has lines with CLOSED_CODE = 'OPEN' even after PO approval.

        Is this expected behavior? When Does CLOSED_CODE will get updated in archive table?



               INTO x_lines_count

               FROM po_lines_all

              WHERE closed_code = 'OPEN'

                AND po_header_id = x_po_header_id;


             SELECT COUNT(*)

               INTO x_ar_line_count

               from po_lines_archive_all

            where closed_code = 'OPEN'

              and latest_external_flag = 'Y'

              and po_header_id = x_po_header_id;



      IF x_lines_count <> x_ar_line_count THEN

           RESULT: "Change in PO Lines";