22 December, 2020

Oracle Order to Cash cycle (O2C) summary

Here is the summary of O2C cycle.

It will give you a quick overview of all the programs, tables, status changes happening in O2C cycle.



Below details gives information on GL Posting

 
 
 
Sorry for the misalignment, but really wanted to show this in tabular format in a single view.

API to Cancel Open PO

CREATE OR REPLACE PACKAGE BODY po_cancel_pkg AS
 

PROCEDURE process_po_cancel(errbuf           OUT VARCHAR2,
                              retcode          OUT VARCHAR2,
p_operating_unit_id IN NUMBER,
                              p_vendor_name    IN VARCHAR2,
                              p_vendor_site_cd IN VARCHAR2
                             ) IS

    CURSOR get_po_details IS
      SELECT pha.segment1     po_number,
             pha.po_header_id,
             pla.po_line_id ,
             plla.line_location_id,
             pha.org_id       org_id
        FROM po_headers_all        pha,
             ap_suppliers          ap,
             ap_supplier_sites_all aps,
             po_lines_all pla,
             po_line_locations_all plla
        WHERE ap.vendor_id = aps.vendor_id
         AND pha.vendor_id = ap.vendor_id
         AND pha.vendor_site_id = aps.vendor_site_id
         AND NVL(pha.closed_code, 'OPEN') = 'OPEN'
         AND NVL(pha.cancel_flag, 'N') = 'N'
         AND NVL(plla.cancel_flag, 'N') = 'N'
         AND pha.approved_flag = 'Y'
         AND pha.po_header_id = pla.po_header_id
         AND pla.po_line_id = plla.po_line_id
         AND pha.segment1 = <PO_NUMBER>
         AND pha.type_lookup_code = 'STANDARD'
AND NVL(plla.quantity_received,0) =0
         AND pha.org_id = p_operating_unit_id
         AND UPPER(ap.segment1) = NVL(UPPER(p_vendor_name), UPPER(ap.segment1)) -- segment1
         AND UPPER(aps.attribute14) = NVL(UPPER(p_vendor_site_cd), UPPER(aps.attribute14)); -- attribute14

    l_return_status VARCHAR2(20) DEFAULT NULL;

    v_user_id            NUMBER := FND_GLOBAL.USER_ID;
      v_msg           VARCHAR2(4000) DEFAULT NULL;
v_resp_id       CONSTANT NUMBER         := fnd_global.resp_id;
    v_appl_id       CONSTANT NUMBER         := fnd_global.resp_appl_id;
v_success_rec   NUMBER :=0;
v_fail_rec      NUMBER :=0;
v_total_rec     NUMBER :=0;
  BEGIN
    fnd_file.put_line(fnd_file.Log,'Start of the Open PO Cancel program');
fnd_file.put_line(fnd_file.Log,'Vendor Name = '|| p_vendor_name);
fnd_file.put_line(fnd_file.Log,'Vendor Site Code = '||p_vendor_site_cd );


FOR rec in get_po_details
    LOOP

      v_total_rec := v_total_rec +1 ;

--Intialization for API
      fnd_global.apps_initialize(v_user_id, v_resp_id, v_appl_id);
      mo_global.init('PO');
      mo_global.set_policy_context('S', rec.org_id);
      --API Call

      po_document_control_pub.control_document(p_api_version      => 1.0,
                                               p_init_msg_list    => fnd_api.g_true,
                                               p_commit           => fnd_api.g_true,
                                               x_return_status    => l_return_status,
                                               p_doc_type         => 'PO',
                                               p_doc_subtype      => 'STANDARD',
                                               p_doc_id           => rec.po_header_id,
                                               p_doc_num          => NULL,
                                               p_release_id       => NULL,
                                               p_release_num      => NULL,
                                               p_doc_line_id      => rec.po_line_id,
                                               p_doc_line_num     => NULL,
                                               p_doc_line_loc_id  => rec.line_location_id,
                                               p_doc_shipment_num => NULL,
                                               p_action           => 'CANCEL',
                                               p_action_date      => SYSDATE,
                                               p_cancel_reason    => NULL,
                                               p_cancel_reqs_flag => 'N',
                                               p_print_flag       => NULL,
                                               p_note_to_vendor   => NULL,
                                               p_use_gldate       => NULL,
                                               p_org_id           => rec.org_id);
        COMMIT;                                             
      IF l_return_status = 'S' THEN
        v_msg := 'Purchase order : ' || rec.po_number ||'location id '||rec.line_location_id ||' is now cancelled.';
  fnd_file.put_line(fnd_file.Log,v_msg);

  v_success_rec := v_success_rec +1;
      ELSE
        l_return_status := 'E';
        v_msg           := 'Below Error occured while Cancelling Purchase Order : ' ||
                           rec.po_number ||' - location id '||rec.line_location_id  ;
fnd_file.put_line(fnd_file.Log,v_msg);
        if fnd_msg_pub.count_msg > 0 then
FOR i IN 1 .. fnd_msg_pub.count_msg LOOP
v_msg := fnd_msg_pub.get(p_msg_index => i, p_encoded => 'F');
fnd_file.put_line(fnd_file.Log,v_msg);
 
END LOOP;
else
    fnd_file.put_line(fnd_file.Log,'No error');

end if;
v_fail_rec := v_fail_rec+1;
      END IF;
    END LOOP;
fnd_file.put_line(fnd_file.Log,'Number of PO Processed : '||v_total_rec);
fnd_file.put_line(fnd_file.Log,'Number of PO cancelled successfully : '||v_success_rec);
fnd_file.put_line(fnd_file.Log,'Number of PO failed to cancelled : '||v_fail_rec);
  EXCEPTION

    WHEN others THEN
      v_msg := SUBSTR('Error : Something uexpected occured ' ||
                      SQLERRM,
                      1,
                      200);
  fnd_file.put_line(fnd_file.Log,v_msg);
      retcode := 2;
      errbuf  := v_msg;
  END process_po_cancel;
END po_cancel_pkg;
/

Difference between 11i and R12

 Difference between 11i and R12


fnd_client_info.set_org_context(org_id) mo_gloal.set_policy_context(org_identifier,org_id)
   
gl_sets_of_books gl_ledgers 
  gl_ledger_Sets
   
Currency,Calendar,Chart of accounts Currency,Calendar,Chart of accounts, Accounting Convention 
  MOAC setup - access multiple operating units in single responsibility 
  TCA Architecture intorduces
   
AP, PO, PA interfaces the transactions directly to GL all the transactions are interfaced to GL through SLA (accounting hub)
   
po_vendors                  ap_suppliers
po_vendor_sites_all  ap_supplier_sites_all
po_vendor_contacts  ap_supplier_contacts
   
RA_CUSTOMERS HZ_CUST_ACCOUNTS
RA_SITE_USES_ALL HZ_PARTIES
RA_ADDRESSES_ALL HZ_CUST_SITE_USES_ALL
  HZ_CUST_ACCT_SITES_ALL
   HZ_PARTY_SITES
  HZ_LOCATIONS
   
AP_INVOICES_ALL, AP_INVOICE_DISTRIBUTIONS_ALL Ap_invoice_lines_all table added with these 2 tables
OE_ORDER_LINES_ALL does not contain item_name contain item_name
  OM/ TCA attribute extension functionality added
  oe_order_header_all_ext_b
  oe_order_lines_all_ext_b
  hz_party_sites_ext_b
  hz_location_ext_b