Invoice Hold API

Hi,
Trying to put an invoice on hold using ap_holds_pkg call from AP trigger. Following the creation of an invoice through forms, the trigger calls the API to apply the hold by passing the invoice id. It works as far as the invoice id is provided manually (while testing). However while testing without a hardcoded invoice id, the API does not seem to be executed.
Am i missing something on this code ? Will appreciate any hint...
Thanks
TRIGGER
CREATE OR REPLACE TRIGGER XX_AP_INVOICES_ALL
AFTER INSERT ON AP.AP_INVOICES_ALL
REFERENCING NEW AS NEW
FOR EACH ROW
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
XX_AP_HOLD_PK.ASSIGN_HOLD(:NEW.INVOICE_ID);
END;
PACKAGE
PROCEDURE ASSIGN_HOLD(invoice_id_in IN AP_INVOICES_ALL.INVOICE_ID%TYPE) IS
lv_hold_type ap_hold_codes_v.hold_type%TYPE;
lv_hold_lookup_code ap_hold_codes_v.hold_lookup_code%TYPE;
lv_hold_reason ap_hold_codes_v.description%TYPE;
lv_invoice_id PLS_INTEGER;
BEGIN
lv_invoice_id:= invoice_id_in ;
FOR cur IN(SELECT ahc.hold_type,
ahc.hold_lookup_code,
ahc.description
FROM ap_lookup_codes l1,
ap_hold_codes ahc
WHERE l1.lookup_type ='XX_HOLD_CODES'
AND UPPER(ahc.hold_lookup_code) = UPPER(l1.lookup_code)
LOOP
--dbms_output.put_line('lv_invoice_id in the loop'||lv_invoice_id);
ap_holds_pkg.insert_single_hold(
X_invoice_id => lv_invoice_id,
X_hold_lookup_code => cur.hold_lookup_code,
X_hold_type => cur.hold_type,
X_hold_reason => cur.description,
X_held_by => g_hold_user,
X_calling_sequence => NULL);
END LOOP;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
IF (SQLCODE <> -20001) THEN
FND_MESSAGE.SET_NAME('SQLAP','AP_DEBUG');
FND_MESSAGE.SET_TOKEN('ERROR',SQLERRM);
END IF;
APP_EXCEPTION.RAISE_EXCEPTION;
END ASSIGN_HOLD;
Edited by: user1853817 on Nov 17, 2009 2:37 AM

Got the solution... Needed to break the process in two stages:
- A row trigger to save the invoice id (in a plsql table)
- A statement trigger to call the API and pass the saved invoice id.
Cheers

Similar Messages

  • Is there any concurrent program to mass release AP invoice holds?

    Hi,
    Can you please let me know if there is any concurrent program to mass release AP invoice holds?
    I'm aware of ap_holds_pkg.single_hold_release API which can do this. But just wanted to know if there's any seeded program/functionality to do that?
    Mass release condition would be on pay group.

    Thanks Pillair. Let me check that option.
    Is it possible to mass release tax and price variance holds using this concurrent program?

  • Cannot resolve 'Encumbrance Acctg Fail' invoice hold in AP

    Hi,
    Does anyone know how to resolve 'Encumbrance Acctg Fail' invoice hold in AP? Have already created a journal for encumbrance in GL and posted it but still we are not able to validate the invoice (status is still in needs revalidation). Anyone has any idea?

    Hi
    We are having the same issue as well. We cannot get these invoices off this hold which is a problem for us because we have to close our books for the year this week.
    Some background on our issue (not sure if it is the same as yours). So far we have found the issue relates to invoices from a PO. In our case, we have found that invoices that upgraded (we upgraded from 11i to 12 in May 2012) but have had a redistribution done on them in the upgraded system all end up on this hold. We are still working to figure out if that is our complete listing of items related to that, but so far that is what we have found that can recreate the issue.
    If anyone has additional information on this, we would appreciate hearing.
    Thanks
    ryan

  • P_calling_sequence AP Invoice update API

    Hi
    What is the use of parameter p_calling_sequence AP Invoice update API ?
    How to use the same, any example would help a lot ?
    Regards,
    Amit

    Hi Amit,
    There are so many hits in google on how to use the respective parameter:
    Let me google that for you
    Thanks &
    Best Regards,

  • Error in Invoice Approval API

    Hi,
    We are facing the below error while using standard API (ap_approval_pkg.approve) to approve an Invoice in R12.
    The API is a part of custom workflow, which is used for the invoice approval process.
    DECLARE
    ERROR at line 1:
    ORA-20001: APP-SQLAP-10000: ORA-06502: PL/SQL: numeric or value error: NULL
    index table key value occurred
    in
    AP_APPROVAL_PKG.Approval_Init<-AP_APPROVAL_PKG.Approval<-APXAPRVL
    with parameters (&PARAMETERS)
    while performing the following operation:
    Set Options from Cache
    ORA-06512: at "APPS.APP_EXCEPTION", line 72
    ORA-06512: at "APPS.AP_APPROVAL_PKG", line 1698
    ORA-06512: at line 22
    If any one has faced similar issue please let us know.
    Regards,
    Syed

    Hi,
    I am facing the same error. Do anyone knows the solution?
    Regards,
    Hatim Ali Asgher

  • Apply credit memo to invoice using API

    Dear All ,
    my question is how to apply a credit memo to invoice .
    I want to make a credit memo then apply invoice to this credit memo , you can check this in the transaction form by creating a credit memo then check application from action menu then apply the invoice.
    So i want to simulate this process using API.
    i searche and f ound there is API called Ar_cm_application_pub.activity_application but it is not clear to me .
    So if anyone know this API and how to use it and any example for it .
    thanx in advance .

    No Answer??!!!!

  • Accounts Payable API Invoice Creation API

    Hello All,
    Is there any API available in R12 for creating Accounts Payable(AP) Invoices.
    Thanx in Advance.
    Regards,
    Deepak Arora
    +91-96500-28672

    Hi;
    All APIs are listed in Oracle Integration Repository
    http://irep.oracle.com/index.html
    API User Notes - HTML Format [ID 236937.1]
    R12.0.[3-4] : Oracle Install Base Api / Open Interface Setup Test [ID 427566.1]
    Pelase also check below:
    Api's in EBS
    Re: Api's in EBS
    http://sairamgoudmalla.blogspot.com/2009/05/script-to-find-oracle-apis-for-any.html
    API
    Fixed Asset API
    List of API
    Re: List of APIs
    Oracle Common Application Components API Reference Guide
    download.oracle.com/docs/cd/B25284_01/current/acrobat/jta115api.pdf
    Regard
    Helios

  • Vendor Invoice Holds

    My client has a process called u201CVendor Holdsu201D where in they hold newer invoices totaling up to a set amount limit. They pay only oldest of the invoices that exceed that amount limit. This process is used for safeguarding themselves against vendoru2019s debit balance. Here is an example:
    Invoice-1: $100 (Due on Oct/1)
    Invoice-2: $200 (Due on Oct/2)
    Invoice-3: $300 (Due on Oct/3)
    Invoice-4: $400 (Due on Oct/4)
    Invoice-5: $500 (Due on Oct/5)
    Vendor Hold limit: $1200
    In this example, when they process the payment run on Oct/5th, only Invoice-1 and Invoice-2 are paid because they are older and they exceed the hold limit. The remaining 3 invoices are blocked during that payment run and the block is released once that particular payment run is completed.
    (1)     Is there any standard functionality in SAP that can support this vendor hold process?
    (2)     Is there a transaction in SAP using which we can block/unblock multiple FI-AP vendor invoices?
    regards
    mohammed

    Hi,
    It is not a standard SAP functionality for vendor hold
    During invoice verification in MIRO you can hold the invoice,the person who is processing has to post the invoice  later based on the invocie number only.
    (OR)
    During payment run some one has to check and physically pay to the vendor.
    It is difficult to do  in SAP
    Best solution: The person who is posting the bills in SAP has to control
    G.Ganesh Kumar

  • AR Invoice Holds - Partial VAT Items

    This is really an enquiry more than a problem. We use a piece of third party software to scan and process our invoices. Approved invoices in that system are then transferred to Oracle via the Open Interface mechanism.
    Some of the items on these invoices don't attract the full amount of VAT and so they are coded up as 'Partial' within the 3rd Party System meaning the users can enter the amount of VAT for the item rather than it being calculated by the system.
    When the invoices get to Oracle, due to us having an invoice tolerance on TAX set up, the invoices with items for Partial VAT go on hold and the user has to spend time releasing them.
    I understand that Oracle is behaving correctly here but I wondered if there is a way to set up more complex tolerance rules that would allow us to only apply the tolerances to non Partial items?
    I can't see a way of doing this but I wondered if it was possible?
    Thanks
    Chris

    Kawish,
    1. You can hold ALT and click the database dropdown to show all tables. After that you can select the table ORDR and the DocTotal field to show document total.
    If this does not give you the correct answer, i suggest you create a UDF on the AR invoice and provide it a FMS to read document total screen variable of the SO form.
    Thereafter you can use this UDF on the AR PLD normally and do normal calculations.
    2. My meaning adding a new field, I meant to drag and drop and new field from the toolbar above to the PLD. In the properties window > Content tab - you should set the source type as Database to use the internal tables and their fields.
    to do a formula, drag another field and change the source type to formula.
    I suggest, you go through the PLD e-learning sessions to enhance your knowledge about basic PLD functions.

  • R12 AP Invoice Payment API alternative

    Hi All,
    Currently I handle a project that would require loading of payment records from a staging table to OFIN R12. The issue is, Oracle itself doesn't provide an interface or API for AP Invoice Payments that load records from staging table or flat file to OFIN R12 payment tables. Is there any alternative or available API on R12 that can be utilize to performed similar functions?
    Our working environment:
    - EBS 12.1.1
    Any help much appreciated.
    Regards,
    Cyrus

    Hello Everyone,
    Any help from you guys?
    Regards,
    Cyrus

  • AP 11i Invoice Approval API

    Hi,
    We were trying to implement Invoice Approval Workflow, but in our version 11.5.8 (on Sun SPARC) there was a bug and it was not sending emails to approving users. Then once we put a SR to Oracle Support they said that 11.5.8 is de-supported and there is no bug fix for this version and asked us to upgrade which is not possible at this moment.
    So we are finding a solution to where an Invoice Approval out of Oracle Financials. Is there any API for Oracle Invoice Approvals?
    Thanks!
    Nilaksha.

    Hi Nilaksha,
    I'd want to know the problem you're encountering to see if it can be solved through other methods. If its a core problem then you'd probably strike the same issue trying to call private APIs around Invoice Approvals. Note that the main logic is in the Workflow APINV, so you could reproduce what it does. This course of action would be unsupported.
    Regards,
    Gareth

  • AP - Invoice Holds

    Hi,
    Am i correct in assuming that a NON PO INVOICE that is placed on a mandatory or non mandatory hold reason cannot be accunted for an transfered to General Ledger ?
    Bal

    Hi,
    Yes. Generally when a invoice is in hold you can not account it.
    Regards
    Rubayat Newaz

  • Creation Of Credit Memos and Applying to Invoices Using API in Payables

    Hi Guys,
    I have a requirment that when ever I create an AP invoice with VAT . I need to create a credit memo with the vat amount aganist that invoice Line and supplier.I adopted the process to create an alert and i will write a interface for this this.I will call the interface procedure inthe alert.Here the problem is i am able to create credit memo but the amount is not applying to invoice.i.e., amount of the main invoice is not reducing. If U guys have any Idea regarding the credit memo applying to invoice using interface,please let me know.
    Thanks In Advance,
    Naresh
    Edited by: Naresh on Sep 23, 2010 5:58 AM
    Edited by: Naresh on Sep 23, 2010 6:01 AM

    we have to link the CM thru PARENT_INVOICE_ID (Parent Invoice).

  • Invoice hold workflow is not fetching the approver from ame

    Hi,
    I'm trying to get the next approver(3rd level) in wf process from ame through profile option, but it's not fetching the approver.
    my query is
    SELECT persion_id||employee_id
    FROM fnd_user
    WHERE employee_id = fnd_profile.VALUE('MG_AP09_PAYABLES_SUPERVISOR')
    other two level approvers (level1 and level 2)I'm getting , which is not through profile but direct join of tables as given below
    SELECT 'person_id:'|| rcv.EMPLOYEE_ID
    FROM ap_holds_all aph
    ,po_distributions_all pd
    ,rcv_transactions rcv
    WHERE pd.line_location_id = aph.line_location_id
    AND pd.PO_DISTRIBUTION_ID= rcv.PO_DISTRIBUTION_ID
    AND aph.hold_id = :transactionId
    AND transaction_type = 'DELIVER'
    SELECT 'person_id:'|| HR2.attribute2
    from ap_holds_all AH
    ,po_line_locations_all PLL
    ,hr_locations_all HR1
    ,hr_locations_all HR2
    where pll.line_location_id = AH.line_location_id
    AND pll.ship_to_location_id = HR1.location_id
    AND nvl(HR1.attribute1,HR1.location_id) = HR2.location_id
    AND AH.hold_id = :transactionId
    what may be the issue?

    Hi Surjith,
    Please look at the code I have written in the user exit, which is just for testing purpose. In SPRO I set workflow as 9 for all the release codes.
    IF i_eban-werks = '1000'.
      actor_tab-otype = 'US'.
      actor_tab-objid = 'S_RITESH'.
      APPEND actor_tab.
      CLEAR actor_tab.
    ENDIF.
    In PR I am getting the user name in processor coloumn correctly.
    please let me know if I am going wrong.
    Thank you.

  • Hold code on supplier invoices (Payables)

    Dear all,
    can anyone tell me how to creta a new hold code on a supplier invoice in Oracle Payables.
    Thanks in advance,
    Emmanuel
    Edited by: user642479 on 22 mai 2009 07:11
    I have my answer !
    I was connected in French and the menu item is not well translated !
    Thank you.

    Hello.
    APPS 11.5.10.2
    Navigate to Setup/Invoice/Hold and Release Names and enter a Name, Description and Type for your hold. Also choose if this new hold should allow invoice to be accounted and if it can be manually released.
    Octavio

Maybe you are looking for

  • Duplication of songs in my new I-Tunes library

    I don't know why numerous songs are duplicated in my new I-tunes library on my new Dell computer. Others have single entries. Some of the duplicated song entries have an "exclamation point" next to them. I don't know what that means. When I tried to

  • Problem in Transporting a BAPI structure

    How to transport the extended BAPI structure from D system to Q system. BAPI structure is extended by appending a new structure with two fields in Development system. I want to transport it to Q. But there is no transport request for this change. Sin

  • What type and how many gigabyte external hard drive do I get for my iMac?

    What brand and what features and how many gigabytes do I need in an external hard drive for my new imac?

  • JMS to IDOC xslt mapping

    Hi, We have a JMS to IDOC scenario. We are using PI7.1.  We are currently using XSLT Mapping . This needs to be replaced by Graphical mapping as XSLT mapping  is consuming more memory. If we remove the XSLT Mapping between source and target would we

  • Lost built in font. how to get back?

    how to get back my fonts into font book. myanmar fonts, thai fonts, including built in fonts lost a lots.