Sunday, August 17, 2014

API to account the AP Payments in oracle apps R12 AP_DRILLDOWN_PUB_PKG. PAYMENT_ONLINE_ACCOUNTING














In my recent project, we have a requirement to account the payment of the AP Invoices via PLSQL. 
Hence, We have used the API
 AP_DRILLDOWN_PUB_PKG.PAYMENT_ONLINE_ACCOUNTING

Script:

----------------------------------------------------------------------
  -- PROCEDURE account_payments 
  -- This procedure is to create Accounting for payments of the 
  -- invoices in AP
  ---------------------------------------------------------------------- 
  PROCEDURE account_payments (pin_invoice_id    IN  NUMBER,
                              pov_err_message OUT VARCHAR2
                              )  
  IS
    CURSOR cur_imp_invoices IS
    SELECT DISTINCT aca.check_id, aca.check_number        
      FROM ap_invoices_all xlpi,
           ap_invoice_payments_all aipa,
           ap_checks_all aca
     WHERE xlpi.invoice_id   = aipa.invoice_id
    AND xlpi.invoice_id   = pin_invoice_id
       AND aipa.check_id     = aca.check_id
       AND ap_checks_pkg.get_posting_status(aca.check_id) = 'N';  
    -- This condition is to pick invoices which are paid and unaccounted
 
    ln_processed_cnt      NUMBER DEFAULT 0;
    ln_failed_cnt         NUMBER DEFAULT 0;  
    lv_error_buf          VARCHAR2(500);
    ln_retcode            NUMBER; 
  BEGIN
 
    FOR rec_imp_inv IN cur_imp_invoices
    LOOP
      BEGIN
        DBMS_OUTPUT.put_line(rec_imp_inv.check_id);
        ln_retcode   := NULL;
        lv_error_buf := NULL;
 
        ap_drilldown_pub_pkg.payment_online_accounting 
           (
             p_check_id           => rec_imp_inv.check_id,
             p_accounting_mode    => 'F',        
             p_errbuf             => lv_error_buf,
             p_retcode            => ln_retcode,
             p_calling_sequence   => 'xxyour_package.account_payments'
           );
 
        IF ln_retcode = 0 
        THEN
          DBMS_OUTPUT.put_line('Invoice Check id: '
                  ||rec_imp_inv.check_id 
    ||'. Payment ('
    ||rec_imp_inv.check_number
    ||') Accounted Sucessfully'
        );
          ln_processed_cnt := ln_processed_cnt+1;
        ELSIF ln_retcode = 1 THEN
          DBMS_OUTPUT.put_line('Invoice Check id: '
                 ||rec_imp_inv.check_id
          ||'. Payment ('
          ||rec_imp_inv.check_number
          ||') Accounting ended in WARNING. Errbuf : '
          ||lv_error_buf
         );
          ln_processed_cnt := ln_processed_cnt+1;
        ELSIF ln_retcode = 2 THEN
          DBMS_OUTPUT.put_line('Invoice Check id: '
                  ||rec_imp_inv.check_id 
    ||'. Payment ('
    ||rec_imp_inv.check_number
    ||') Accounting ended in ERROR. Errbuf : '
    ||lv_error_buf
    );       
          ln_failed_cnt := ln_failed_cnt +1;          
        ELSE
          DBMS_OUTPUT.put_line('Invoice Check id: '
                  ||rec_imp_inv.check_id 
    ||'. Payment ('
    ||rec_imp_inv.check_number
    ||') Accounting ended in ERROR. Errbuf : '
    ||lv_error_buf
    ||' Retcode: '
    ||ln_retcode
    );
          ln_failed_cnt := ln_failed_cnt +1;
        END IF; 
 
        COMMIT;
 
      EXCEPTION
        WHEN OTHERS THEN
          DBMS_OUTPUT.put_line('Invoice Check id: ' 
                               ||rec_imp_inv.check_id
                               ||'. Payment Accounting failed with unhandled exception.Error:' 
                               ||SQLERRM);
          ln_failed_cnt := ln_failed_cnt + 1;
      END;
    END LOOP;
    pov_err_message := 'PROCESSED: '||ln_processed_cnt||' FAILED: '||ln_failed_cnt;
  END account_payments; 
 
Hope this helps!!!
 
 

8 Responses to “API to account the AP Payments in oracle apps R12 AP_DRILLDOWN_PUB_PKG. PAYMENT_ONLINE_ACCOUNTING”

Unknown said...
August 17, 2014 at 10:53 PM

I am Sridevi Koduru, Senior Oracle Apps Trainer at Oracleappstechnical.com With 8 Yrs Exp on Oracle Apps and 13 Yrs IT Exp Providing Online Training on Oracle Apps Technical, Oracle Apps Financial Functional, Oracle Apps SCM, Oracle Apps HRMS, Oracle Financial for Indian Localization, SQL, PL/SQL and D2K. I have Provided Training for 500+ Professionals Most of them are Working in Real Time now.

Contact for (One to One Personal Online Training) on Oracle Apps Technical, Oracle Apps Financial Functional, Oracle Apps SCM, Oracle Apps HRMS, Oracle Financial for Indian Localization, SQL, PL/SQL and D2K at training@oracleappstechnical.com | sridevikoduru@oracleappstechnical.com | +91-9581017828 | http://www.oracleappstechnical.com

Linkedin profile - http://in.linkedin.com/pub/sridevi-koduru/8b/76a/9b8/


Unknown said...
September 17, 2014 at 3:20 AM This comment has been removed by the author.

Unknown said...
September 17, 2014 at 3:24 AM

Hey :) .. I got a site too
Oracle Apps Today
Please refer this in additional resources


Jone Martin said...
November 23, 2021 at 11:46 AM

Yesterday, I want to get to know the account. I get guide from your post and solved it. Similarly, you can solve you website error after getting the Web Redesign Services. You can rely on us.


Anonymous said...
May 1, 2022 at 3:12 AM

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Etiam dictum tincidunt diam. Aliquam id dolor. Suspendisse sagittis ultrices augue. Maecenas fermentum, sem in pharetra pellentesque, velit turpis volutpat ante, in pharetra metus odio a lectus. Maecenas aliquet
govt jobs in himachal Pradesh


bestcommentsforgirls said...
May 9, 2022 at 7:00 AM

Govt jobs in odisha
Five recommendations for buying authorities jobs in India


Anonymous said...
May 11, 2022 at 12:28 AM

Fooz Kids

Guide’s In Child’s Growth Journey & Beyond. Many things have to be kept in mind, like baby names, motherhood, breastfeeding, newborn’s health issues, stressful days, and other parenting tips. We are here to make your journey a bit easy, if not smooth. We know that you will be the only one to suffer all the frustrations and agony. However, we have stretched our helping hand to make sure that your child’s growth is persistent and never hindered.


Moving001 said...
June 2, 2022 at 11:18 PM


Cross Country Moving
US Interstate Rail - Trusted Interstate Moving Broker
US Interstate Rail is a fully licensed, bonded, and insured to ensure that your long distance moving experience goes smoothly. We're a trusted Interstate Moving Broker with the largest network of vetted long distance movers.


Post a Comment

Disclaimer

The ideas, thoughts and concepts expressed here are my own. They, in no way reflect those of my employer or any other organization/client that I am associated. The articles presented doesn't imply to any particular organization or client and are meant only for knowledge Sharing purpose. The articles can't be reproduced or copied without the Owner's knowledge or permission.