Below API is used to Finally Close PO Requisitions.
declare
v_returned BOOLEAN;
v_return_code_h VARCHAR2(1);
lc_return_status VARCHAR2(50);
lc_exception_msg VARCHAR2(4000);
lc_return_code VARCHAR2(50);
ln_online_report_id NUMBER;
v_error_code VARCHAR2(4000);
lc_req_control_error VARCHAR2(4000);
BEGIN
FND_GLOBAL.APPS_INITIALIZE (user_id,resp_id, 201);
mo_global.set_policy_context('S',org_id);
FOR po_req IN
(SELECT *
FROM req_closed_tbl opc
)
LOOP
po_reqs_control_sv.update_reqs_status( X_req_header_id => po_req.requisition_header_id
, x_req_line_id => po_req.requisition_line_id
, x_agent_id => po_req.preparer_id
, x_req_doc_type => po_req.type_lookup_code--TYPE_LOOKUP_CODE
, x_req_doc_subtype => po_req.document_type_code--DOCUMENT_TYPE_CODE
, X_req_control_action => 'FINALLY CLOSE'
, X_req_control_reason => 'Put your description'
, X_req_action_date => SYSDATE
, X_encumbrance_flag => 'N'
, X_oe_installed_flag => 'Y'
, X_req_control_error_rc => v_error_code);
IF v_error_code is not null then
---put logic here
END IF;
COMMIT;
END LOOP;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(' Exception closing Requisition using po_reqs_control_sv.update_reqs_status'||SQLERRM);
END;
No comments:
Post a Comment