DBA Data[Home] [Help]

APPS.PO_WF_PO_NOTIFICATION SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 8

PROCEDURE update_action_history (p_action_code         IN VARCHAR2,
                              p_recipient_id           IN NUMBER,
                              p_note                   IN VARCHAR2,
                              p_po_header_id           IN NUMBER,
                              p_current_id             IN NUMBER,
                              p_doc_type               IN  po_action_history.OBJECT_TYPE_CODE%TYPE,
                              p_doc_subtype            IN po_action_history.OBJECT_SUB_TYPE_CODE%TYPE,
                              p_approval_path_id       IN po_action_history.APPROVAL_PATH_ID%TYPE, --
                              p_draft_id               IN NUMBER,
                              p_draft_type             IN VARCHAR2); -- PAR Approval
Line: 150

   Old tax select:
  SELECT nvl(sum(nonrecoverable_tax), 0)
    INTO l_tax_amt
    FROM po_lines pol,
         po_distributions pod
   WHERE pol.po_header_id = l_document_id
     AND pod.po_line_id = pol.po_line_id;
Line: 202

      SELECT sum( round (POD.nonrecoverable_tax *
                         decode(quantity_ordered,
                                NULL,
                                 --Bug16222308 Handling the quantity zero on distribution
                                (nvl(POD.amount_ordered,0) - nvl(POD.amount_cancelled,0)) / decode ( nvl(POD.amount_ordered, 1),0,1,nvl(POD.amount_ordered, 1) ) ,
                                (nvl(POD.quantity_ordered,0) - nvl(POD.quantity_cancelled,0)) / decode ( nvl(POD.quantity_ordered, 1),0,1, nvl(POD.quantity_ordered, 1) )
                               ) / X_min_acct_unit
                         ) * X_min_acct_unit
                )
      INTO l_tax_amt
      FROM po_lines pol,
           po_distributions pod
     WHERE pol.po_header_id = l_document_id
       AND pod.po_line_id = pol.po_line_id;
Line: 217

      SELECT sum( round (POD.nonrecoverable_tax *
                         decode(quantity_ordered,
                                NULL,
                                --Bug16222308 Handling the quantity zero on distribution
                                (nvl(POD.amount_ordered,0) - nvl(POD.amount_cancelled,0)) / decode ( nvl(POD.amount_ordered, 1),0,1,nvl(POD.amount_ordered, 1) ) ,
                                (nvl(POD.quantity_ordered,0) - nvl(POD.quantity_cancelled,0)) / decode ( nvl(POD.quantity_ordered, 1),0,1, nvl(POD.quantity_ordered, 1) )
                               ),
                         X_precision
                        )
                )
      INTO l_tax_amt
      FROM po_lines pol,
           po_distributions pod
     WHERE pol.po_header_id = l_document_id
       AND pod.po_line_id = pol.po_line_id;
Line: 408

SELECT pol.line_num,
       msi.concatenated_segments,
       pol.item_revision,
       pol.item_description,
--     pol.unit_meas_lookup_code, -- bug 2401933.remove
       nvl(muom.unit_of_measure_tl, pol.unit_meas_lookup_code), -- bug 2401933.add
       pol.quantity,
       pol.unit_price,
       nvl(pol.amount, pol.quantity * pol.unit_price),
       pol.CLM_OPTION_NUM,
       po2.LINE_NUM_DISPLAY --Base line num
--       ,pol.contract_type
       ,lkp1.description
       ,pol.LINE_NUM_DISPLAY
  FROM po_lines_all   pol, --CLM Apprvl
       po_lines_all   po2, -- CLM Apprvl
       po_lookup_codes lkp1,
       mtl_system_items_kfv   msi,
       mtl_units_of_measure   muom,     -- bug 2401933.add
       financials_system_parameters  fsp
 WHERE pol.po_header_id = v_document_id
   AND lkp1.lookup_code(+) = pol.contract_type
   AND lkp1.lookup_type(+) = decode(pol.order_type_lookup_code,
                    'QUANTITY', 'PO_FEDERAL_CONTRACT_TYPES_QTY',
                    'PO_FEDERAL_CONTRACT_TYPES_AMT')
   AND pol.item_id = msi.inventory_item_id(+)
   AND NVL(msi.organization_id, fsp.inventory_organization_id) =
          fsp.inventory_organization_id
/* Bug 2299484 fixed. prevented the canceled lines to be displayed
   in notifications.
*/
   AND NVL(pol.cancel_flag,'N') = 'N'
   AND muom.unit_of_measure (+) = pol.unit_meas_lookup_code  -- bug 2401933.add
   AND pol.CLM_BASE_LINE_NUM = po2.PO_LINE_ID(+)
 ORDER BY pol.LINE_NUM_DISPLAY;
Line: 475

SELECT pol.line_num,
       msi.concatenated_segments,
       pol.item_revision,
       pol.item_description,
--     pol.unit_meas_lookup_code, -- bug 2401933.remove
       nvl(muom.unit_of_measure_tl, pol.unit_meas_lookup_code), -- bug 2401933.add
       pol.quantity,
       pol.unit_price,
       nvl(pol.amount, pol.quantity * pol.unit_price),
       pol.CLM_OPTION_NUM,
       po2.LINE_NUM_DISPLAY --Base line num
--       ,pol.contract_type
       ,lkp1.description
       ,pol.LINE_NUM_DISPLAY
  FROM po_lines_draft_all   pol, --CLM Apprvl
       po_lines_draft_all   po2, -- CLM Apprvl
       po_lookup_codes lkp1,
       mtl_system_items_kfv   msi,
       mtl_units_of_measure   muom,     -- bug 2401933.add
       financials_system_parameters  fsp
 WHERE pol.po_header_id = v_document_id
   AND nvl(pol.draft_id, -1) = nvl(v_draft_id, -1)
   AND lkp1.lookup_code(+) = pol.contract_type
   AND lkp1.lookup_type(+) = decode(pol.order_type_lookup_code,
                    'QUANTITY', 'PO_FEDERAL_CONTRACT_TYPES_QTY',
                    'PO_FEDERAL_CONTRACT_TYPES_AMT')
   AND pol.item_id = msi.inventory_item_id(+)
   AND NVL(msi.organization_id, fsp.inventory_organization_id) =
          fsp.inventory_organization_id
/* Bug 2299484 fixed. prevented the canceled lines to be displayed
   in notifications.
*/
   AND NVL(pol.cancel_flag,'N') = 'N'
   AND muom.unit_of_measure (+) = pol.unit_meas_lookup_code  -- bug 2401933.add
   AND pol.CLM_BASE_LINE_NUM = po2.PO_LINE_ID(+)
 ORDER BY pol.LINE_NUM_DISPLAY;
Line: 514

SELECT pll.shipment_num,
       msi.concatenated_segments,
       pol.item_revision,
       pol.item_description,
-- Bug 2401933.start
--     nvl(pll.unit_meas_lookup_code, pol.unit_meas_lookup_code)
--         unit_meas_lookup_code,
       nvl(muom.unit_of_measure_tl, pol.unit_meas_lookup_code),
-- Bug 2401933.end
       pll.quantity,
       nvl(pll.price_override, pol.unit_price) unit_price,
       hrl.location_code,
       ood.organization_name,
       pll.need_by_date,
       pll.promised_date,
       pll.shipment_type,
       --Bug 4950850 Added pll.amount
       --Bug 5563024 AMOUNT NOT SHOWN FOR A RELEASE SHIPMENT IN APPROVAL NOTIFICATION.
       nvl(pll.amount, nvl(pll.price_override, pol.unit_price) * pll.quantity)
  FROM po_lines_all  pol,       		-- CLM apprvl
       po_line_locations_all pll,		-- CLM apprvl
       mtl_system_items_kfv msi,
       hr_locations_all hrl,
       hz_locations hz,
       org_organization_definitions ood,
       mtl_units_of_measure   muom,     -- Bug 2401933.add
       financials_system_parameters  fsp
  where  PLL.PO_RELEASE_ID = v_document_id
  and    PLL.po_line_id    = POL.po_line_id
  and    PLL.ship_to_location_id = HRL.location_id (+)
  and    PLL.ship_to_location_id = HZ.location_id (+)
  and    PLL.ship_to_organization_id = OOD.organization_id
  and    pol.item_id = msi.inventory_item_id(+)
  and    NVL(msi.organization_id, fsp.inventory_organization_id) =
          fsp.inventory_organization_id
 /* Bug 2299484 fixed. prevented the canceled shipments to be displayed
   in notifications.
*/
   AND NVL(PLL.cancel_flag,'N') = 'N'
   AND muom.unit_of_measure (+) = pol.unit_meas_lookup_code  -- Bug 2401933.add
  order by Shipment_num asc;
Line: 625

     SELECT 'Y' into l_clm_document
     FROM   po_headers_all h,
            po_doc_style_headers s
     WHERE  h.po_header_id = l_document_id
            AND h.style_id = s.style_id
            AND Nvl(s.clm_flag,'N') = 'Y';
Line: 1267

    SELECT poh.SEQUENCE_NUM,
           per.FULL_NAME,
           polc.DISPLAYED_FIELD,
           poh.ACTION_DATE,
           poh.NOTE,
           poh.OBJECT_REVISION_NUM,
           poh.employee_id, /* bug 2788683 */
           poh.created_by /* bug 2788683 */
      from po_action_history  poh,
           per_all_people_f   per, -- Bug 3404451
           po_lookup_codes    polc
     where OBJECT_TYPE_CODE = v_doc_type_code
	   and poh.object_sub_type_code = v_doc_sub_type_code
       and poh.action_code = polc.lookup_code
       and POLC.LOOKUP_TYPE IN ('APPROVER ACTIONS','CONTROL ACTIONS')
       and per.person_id(+) = poh.employee_id /* bug 2788683 */
       and trunc(sysdate) between per.effective_start_date(+)
                              and per.effective_end_date(+)
       and OBJECT_ID = v_document_id
    UNION ALL
    SELECT poh.SEQUENCE_NUM,
           per.FULL_NAME,
           NULL,
           poh.ACTION_DATE,
           poh.NOTE,
           poh.OBJECT_REVISION_NUM,
           poh.employee_id, /* bug 2788683 */
           poh.created_by /* bug 2788683 */
      from po_action_history  poh,
           per_all_people_f   per -- Bug 3404451
     where OBJECT_TYPE_CODE = v_doc_type_code
	   and poh.object_sub_type_code = v_doc_sub_type_code
       and poh.action_code is null
       and per.person_id(+) = poh.employee_id /* bug 2788683 */
       and trunc(sysdate) between per.effective_start_date(+)
                              and per.effective_end_date(+)
       and OBJECT_ID = v_document_id
   order by 1 desc;
Line: 1521

      /* if action history is updated by vendor
       *    show vendor true name(vendor name)
       * else action history is updated by buyer
       *    show buyer's true name
       */
      IF l_employee_id_tbl(i) IS NULL THEN
         BEGIN --
		SELECT fu.user_name,
		       hp.party_name
		  INTO l_user_name,
		       l_party_name
		  FROM fnd_user fu,
		       hz_parties hp
		 WHERE hp.party_id = fu.customer_id
		   AND fu.user_id = l_created_by_tbl(i);
Line: 1617

      /* if action history is updated by vendor
       *    show vendor true name(vendor name)
       * else action history is updated by buyer
       *    show buyer's true name
       */
      IF l_employee_id_tbl(i) IS NULL THEN
         BEGIN --
		SELECT fu.user_name, hp.party_name
		  INTO l_user_name, l_party_name
		  FROM fnd_user fu,
		       hz_parties hp
		 WHERE hp.party_id = fu.customer_id
		   AND fu.user_id = l_created_by_tbl(i);
Line: 1727

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 1728

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'funcmode : '||funcmode);
Line: 1743

          /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'l_action : '||l_action);
Line: 1765

           PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'Document_ID : '||l_po_header_id);
Line: 1766

           PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'Draft_id : '||l_draft_id);
Line: 1767

           PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'l_doc_type : '||l_doc_type);
Line: 1768

           PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'l_doc_sub_type : '||l_doc_sub_type);
Line: 1769

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'l_draft_type : '||l_draft_type);
Line: 1776

          	/* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'l_origsys : '||l_origsys);
Line: 1777

          	/* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'l_new_recipient_id : '||l_new_recipient_id);
Line: 1782

		SELECT  original_recipient,
			Decode(MORE_INFO_ROLE, NULL, RECIPIENT_ROLE,MORE_INFO_ROLE)
			INTO l_original_recipient, l_current_recipient_role
		FROM wf_notifications
		WHERE
			notification_id = WF_ENGINE.context_nid
			AND ( MORE_INFO_ROLE IS NOT NULL OR RECIPIENT_ROLE <> ORIGINAL_RECIPIENT );
Line: 1791

          		PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'l_original_recipient : '||l_original_recipient);
Line: 1792

          		PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'l_current_recipient_role : '||l_current_recipient_role);
Line: 1827

          /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 1832

          	   /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'Before executing update_action_history');
Line: 1855

		update_action_history(p_action_code => l_action,
                             p_recipient_id => l_new_recipient_id,
                             p_note => WF_ENGINE.CONTEXT_USER_COMMENT,
                             p_po_header_id => l_po_header_id,
                             p_current_id => l_current_recipient_id,
                             p_doc_type => l_doc_type,
                             p_doc_subtype => l_doc_sub_type,
                             p_approval_path_id => NULL, --
                             p_draft_id => l_draft_id,
                             p_draft_type => l_draft_type);
Line: 1867

          		/* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'After executing update_action_history');
Line: 1886

    SELECT fu.USER_ID
      INTO l_responder_id
      FROM fnd_user fu,
           wf_notifications wfn
     WHERE wfn.notification_id = l_nid
       AND wfn.original_recipient = fu.user_name;
Line: 1900

     PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,
                       'l_respond_action_text: ' || l_respond_action_text);
Line: 1919

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,
                       'l_orgid: ' || l_orgid);
Line: 1939

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,
                       'l_forward_to_username_response: ' || l_forward_to_username_response);
Line: 1957

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,
                       'l_forward_to_username: ' || l_forward_to_username);
Line: 1999

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,
                       'l_preparer_id: ' || l_preparer_id ||
                       ', x_user_id: ' || x_user_id);
Line: 2010

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,
                       'l_preparer_id: ' || l_preparer_id ||
                       ', x_CanOwnerApproveFlag: ' || x_CanOwnerApproveFlag);
Line: 2035

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2043

         PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2095

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2118

  ** Here the logic to update the action code in action history.
  ** The insert action is still performed in PO_DOCUMENT_ACTION_UTIL.handle_auth_action_history.
  */
  l_progress := '006 PO_WF_PO_NOTIFICATION.post_approval_notif';
Line: 2123

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2127

  ** Update action history for APPROVE_AND_FORWARD
  ** even when the forward-to person is invalid.
  */
  IF (l_respond_action_text in ('APPROVE','APPROVE_AND_FORWARD'))
     OR (l_respond_action_text = 'FORWARD' AND l_is_forward_valid = TRUE) THEN

      IF l_respond_action_text = 'FORWARD' THEN
        l_action := 'FORWARD';
Line: 2178

      l_progress := '007 start to update action history';
Line: 2180

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2181

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'l_action : ' || l_action ||
                          ', l_po_header_id: ' || l_po_header_id ||
                          ', l_draft_id: ' || l_draft_id ||
                          ', l_draft_type: ' || l_draft_type ||
                          ', l_current_recipient_id: ' || l_current_recipient_id);
Line: 2186

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'l_note: ' || l_note);
Line: 2189

      update_action_history(p_action_code => l_action,
                            p_recipient_id => NULL,
                            p_note => l_note,
                            p_po_header_id => l_po_header_id,
                            p_current_id => l_current_recipient_id,
                            p_doc_type=> l_doc_type,
                            p_doc_subtype => l_doc_sub_type,
                            p_approval_path_id => l_approval_path_id,
                            p_draft_id => l_draft_id,
                            p_draft_type => l_draft_type); -- PAR Approval
Line: 2203

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2215

          /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2222

          /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2250

          /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2270

             /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2364

             /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2419

  /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2430

  /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2442

  /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2457

     PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2468

     /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2556

  /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2599

  select type_name
  from po_document_types_tl tl, FND_LANGUAGES fl
  where fl.nls_language = p_language
  and   tl.LANGUAGE = fl.language_code
  and   tl.document_type_code = p_doc_type
  and   tl.document_subtype = p_doc_subtype;
Line: 2607

  select type_name
  from po_document_types
  where document_type_code = p_doc_type
  and   document_subtype = p_doc_subtype;
Line: 2619

  /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2643

   Deleted the previous code and revamped it.
  */
   --
   l_document_id := PO_WF_UTIL_PKG.GetItemAttrNumber
                                       (itemtype   => itemtype,
                                        itemkey    => itemkey,
                                        aname      => 'DOCUMENT_ID');
Line: 2664

        /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2686

        /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2696

        /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2700

      SELECT language_code
	INTO l_language_code
	FROM fnd_languages
       WHERE nls_language = l_language;
Line: 2732

        /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2739

       select message_text
       into l_msg_text
       from fnd_new_messages fm,fnd_languages fl
       where fm.message_name = 'PO_WF_NOTIF_REQUIRES_APPROVAL'
       and fm.language_code = fl.language_code
       and fl.nls_language = l_language
       and fm.application_id = 201;  -- Include application_id to better use PK index
Line: 2761

       select message_text
       into l_msg_text
       from fnd_new_messages fm,fnd_languages fl
       where fm.message_name = 'PO_WF_NOTIF_REQUIRES_REVIEW'
       and fm.language_code = fl.language_code
       and fl.nls_language = l_language
       and fm.application_id = 201;
Line: 2781

       select message_text
       into l_msg_text
       from fnd_new_messages fm,fnd_languages fl
       where fm.message_name = 'PO_WF_NOTIF_REQUIRES_ESIGN'
       and fm.language_code = fl.language_code
       and fl.nls_language = l_language
       and fm.application_id = 201;
Line: 2805

    /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2867

l_progress:='000'; PO_WF_DEBUG_PKG.insert_debug(p_itemtype,p_itemkey,l_log_head||':'||l_progress || 'Notification Type = ' || p_notification_type);
Line: 2878

l_progress:='010'; PO_WF_DEBUG_PKG.insert_debug(p_itemtype,p_itemkey,l_log_head||':'||l_progress||' Authorization Status = '||l_authorization_status);
Line: 2890

        PO_WF_DEBUG_PKG.insert_debug(p_itemtype,p_itemkey,l_log_head||':'||l_progress||':FALSE');
Line: 2895

    PO_WF_DEBUG_PKG.insert_debug(p_itemtype,p_itemkey,l_log_head||':'||l_progress||':TRUE');
Line: 2901

        PO_WF_DEBUG_PKG.insert_debug(p_itemtype,p_itemkey,l_log_head||':'||SQLERRM);
Line: 2936

PROCEDURE update_action_history (p_action_code         IN VARCHAR2,
                              p_recipient_id           IN NUMBER,
                              p_note                   IN VARCHAR2,
                              p_po_header_id           IN NUMBER,
                              p_current_id             IN NUMBER,
                              p_doc_type               IN  po_action_history.OBJECT_TYPE_CODE%TYPE,
                              p_doc_subtype            IN po_action_history.OBJECT_SUB_TYPE_CODE%TYPE,
                              p_approval_path_id       IN PO_ACTION_HISTORY.APPROVAL_PATH_ID%TYPE,  --
                              p_draft_id               IN NUMBER,
                              p_draft_type             IN VARCHAR2)  --PAR Approval
IS
  pragma AUTONOMOUS_TRANSACTION;
Line: 2979

  SELECT max(sequence_num)
  INTO l_sequence_num
  FROM PO_ACTION_HISTORY
  WHERE object_id = l_document_id
     AND object_type_code = p_doc_type
     AND object_sub_type_code = l_doc_sub_type;
Line: 2987

   SELECT object_revision_num,
  	 approval_path_id,
         request_id,
         program_application_id,
         program_date,
         program_id
  INTO   l_object_revision_num,
         l_approval_path_id,
         l_request_id,
         l_program_application_id,
         l_program_date,
         l_program_id
  FROM PO_ACTION_HISTORY
  WHERE object_id = l_document_id
     AND object_type_code = p_doc_type
     AND object_sub_type_code = l_doc_sub_type
     AND employee_id = p_current_id
     AND ACTION_CODE IS NULL
     AND rownum =1;
Line: 3011

  UPDATE PO_ACTION_HISTORY
  SET     last_update_date = sysdate,
          last_updated_by =  fnd_global.user_id,
          last_update_login = fnd_global.login_id ,
          action_date = sysdate,
          action_code = p_action_code,
          note = p_note,
          approval_path_id = nvl(p_approval_path_id, l_approval_path_id), --
          offline_code = NULL
   WHERE  employee_id = p_current_id
   AND	object_id = l_document_id
   AND	object_type_code = p_doc_type
   AND  object_sub_type_code = l_doc_sub_type
   AND  action_code IS NULL;
Line: 3029

    INSERT INTO PO_ACTION_HISTORY
        	(object_id,
        	object_type_code,
        	object_sub_type_code,
        	sequence_num,
        	last_update_date,
        	last_updated_by,
        	employee_id,
        	action_code,
		action_date,
        	note,
        	object_revision_num,
        	last_update_login,
        	creation_date,
        	created_by,
        	request_id,
        	program_application_id,
        	program_id,
        	program_date,
        	approval_path_id,
        	offline_code,
        	program_update_date
                )
    VALUES (l_document_id,
        	p_doc_type,
        	l_doc_sub_type,
        	l_sequence_num + 1,
        	sysdate,
        	fnd_global.user_id,
        	p_recipient_id,
        	NULL,
		NULL,
        	NULL,
        	l_object_revision_num,
        	fnd_global.login_id,
        	sysdate,
        	fnd_global.user_id,
        	l_request_id,
        	l_program_application_id,
        	l_program_id,
        	l_program_date,
        	l_approval_path_id,
        	NULL,
        	sysdate);
Line: 3079

    wf_core.context('PO_WF_PO_NOTIFICATION','update_action_history',l_progress,sqlerrm);