본문 바로가기
ㄱWORK, ETC

closing Blanket Release - FINALLY CLOSE

by YuyU유유 2021. 11. 11.
728x90
반응형

declare

    l_return_status    varchar2(2000);
    l_return_code      varchar2(2000);
    l_exc_msg          varchar2(2000);
    l_online_report_id number;

begin

    mo_global.init('PO');
    mo_global.set_policy_context('S', org_id);

    po_document_action_pvt.do_manual_close(p_action           => 'FINALLY CLOSE',
                                           p_document_id      => 312269, --po_release_id
                                           p_document_type    => 'RELEASE',
                                           p_document_subtype => 'BLANKET', --pass BLANKET in case of a BPA
                                           p_line_id          => null, --pass a line ID if specific line is to open
                                           p_shipment_id      => null, --ass a line location ID if specific shipment line is to open 
                                           p_reason           => '', --give any free-text reason 
                                           p_action_date      => sysdate, --pass SYSDATE in specific format 
                                           p_calling_mode     => 'PO',
                                           p_origin_doc_id    => null,
                                           p_called_from_conc => false, --this should be TRUE as it is not called from the GUI 
                                           p_use_gl_date      => 'N',
                                           x_return_status    => l_return_status,
                                           x_return_code      => l_return_code,
                                           x_exception_msg    => l_exc_msg,
                                           x_online_report_id => l_online_report_id);

    if l_return_status <> 'S' then
        dbms_output.put_line('API Failed to Close/Finally Close the Purchase Order' || l_exc_msg);
    else
        dbms_output.put_line('Purchase Order which just got Closed/Finally Closed.' || po_release_id);
    end if;
    
    commit;

end;

 

 

 

----STANDARD PO

po_actions.close_po(p_docid         => po_head.po_header_id,
                                                 p_doctyp        => 'PO' --*po_head.document_type_code,
                                              p_docsubtyp     => 'STANDARD'--*po_head.document_subtype,
                                              p_lineid        => null,
                                              p_shipid        => null,
                                              p_action        => x_action,
                                              p_reason        => null,
                                              p_calling_mode  => x_calling_mode,
                                              p_conc_flag     => x_conc_flag,
                                              p_return_code   => x_return_code_h,
                                              p_auto_close    => x_auto_close,
                                              p_action_date   => sysdate,
                                              p_origin_doc_id => null
                                              );

728x90
반응형

'ㄱWORK, ETC' 카테고리의 다른 글

ORACLE ERP - DATA TYPE  (0) 2022.01.20
ON-ERROR trigger  (0) 2022.01.20
Blanket Purchase Order 참고 사이트  (0) 2021.11.16
오라클 폼즈 특정날짜 비활성화 처리  (0) 2021.04.27
SET_ITEM_INSTANCE_PROPERTY  (0) 2021.04.14