PO_close

API for Closing/Finally Closing PO Using po_actions.

close_po
Do we have any API for Finally Closing PO?? Yes, we are having an API for closing or finally closing the POs. In the API, there is a parameter "p_action" which we need to set as either CLOSE (if we want to close the PO) or FINALLY CLOSE (If we want to Finally Close) the PO. Another Parameter which needs to set properly is "p_auto_close". This parameter should be set to 'N'. -- R12 - PO - Script to Close / Finally Close PO using PO_ACTIONS CLOSE_PO API.sql DECLARE x_action constant varchar2(20) := 'FINALLY CLOSE'; -- Change this parameter as per requirement x_calling_mode constant varchar2(2) := 'PO'; x_conc_flag constant varchar2(1) := 'N'; x_return_code_h varchar2(100); x_auto_close constant varchar2(1) := 'N'; x_origin_doc_id number; x_returned boolean; CURSOR c_po_details IS SELECT pha.po_header_id, pha.org_id, pha.segment1, pha.agent_id, pdt.document_subtype, pdt.document_type_code, pha.closed_code, pha.closed_date FROM apps.po_headers_all pha, apps.po_document_types_all pdt WHERE pha.type_lookup_code = pdt.document_subtype AND pha.org_id = pdt.org_id AND pdt.document_type_code = 'PO' AND authorization_status = 'APPROVED' AND pha.closed_code <> 'FINALLY CLOSED' AND segment1 = '379329'; -- Enter the PO Number if one PO needs to be finally closed/Closed begin fnd_global.apps_initialize (user_id => 1805, resp_id => 20707, resp_appl_id => 201); for po_head in c_po_details

document_subtype.document_type_code). po_head. DBMS_OUTPUT. p_action_date => SYSDATE.PUT_LINE ('API Failed to Close/Finally Close the Purchase Order'). COMMIT.segment1).PUT_LINE ('Calling PO_Actions.segment1). p_shipid => NULL.LOOP mo_global. mo_global. p_origin_doc_id => NULL). p_auto_close => x_auto_close.init (po_head. ELSE DBMS_OUTPUT. p_return_code => x_return_code_h. p_docsubtyp => po_head. p_action => x_action. IF x_returned = TRUE THEN DBMS_OUTPUT. p_doctyp => po_head. . x_returned := po_actions. END.set_policy_context ('S'. p_lineid => NULL. END IF.close_po for Closing/Finally Closing PO =>' po_head.document_type_code. END LOOP.org_id).close_po( p_docid => po_head.po_header_id.PUT_LINE ('Purchase Order which just got Closed/Finally Closed is ' po_head. p_reason => NULL. p_conc_flag => x_conc_flag. p_calling_mode => x_calling_mode.

Sign up to vote on this title
UsefulNot useful