API for canceling AP Invoice Issue

Getting error while using AP_CANCEL_PKG.ap_cancel_single_invoice
============================================
declare
v_result_annulation boolean;
     P_last_updated_by NUMBER:=null;
     P_last_update_login NUMBER:=null;
     P_set_of_books_id NUMBER:=null;
     P_accounting_date DATE:=sysdate;
--     P_period_name VARCHAR2;
     P_message_name     VARCHAR2:=null;
     P_invoice_amount     NUMBER:=null;
     P_base_amount     NUMBER:=null;
     P_tax_amount     NUMBER:=null;
     P_temp_cancelled_amount NUMBER:=null;
     P_cancelled_by     NUMBER:=null;
     P_cancelled_amount     NUMBER:=null;
     P_cancelled_date DATE:=sysdate;
     P_last_update_date     DATE:=sysdate;
     P_original_prepayment_amount NUMBER:=null;
     P_check_id NUMBER:=null;
     P_pay_curr_invoice_amount NUMBER:=null;
     P_calling_sequence VARCHAR2:=null;
BEGIN
v_result_annulation := AP_CANCEL_PKG.ap_cancel_single_invoice
( P_invoice_id => 203924,
P_last_updated_by => 1,
P_last_update_login => 1,
P_set_of_books_id => 11,
P_accounting_date => TRUNC(SYSDATE),
P_period_name => 'P05.08-09',
P_message_name => P_message_name,
P_invoice_amount => P_invoice_amount,
P_base_amount => P_base_amount,
P_tax_amount => p_tax_amount,
P_temp_cancelled_amount => p_temp_cancelled_amount
P_cancelled_by => 1,
P_cancelled_amount => p_cancelled_amount,
P_cancelled_date => P_last_update_date ,
P_last_update_date => P_last_update_date,
P_original_prepayment_amount => p_original_prepayment_a
P_check_id => null,
P_pay_curr_invoice_amount => p_pay_curr_invoice_amou
P_calling_sequence => null
EXCEPTION
WHEN OTHERS THEN
p_message_name := SQLCODE||' '||SQLERRM;
END;
ORA-06550: line 8, column 23:
PLS-00215: String length constraints must be in range (1 .. 32767)
ORA-06550: line 20, column 27:
PLS-00215: String length constraints must be in range (1 .. 32767)
ORA-06550: line 36, column 26:
PLS-00363: expression '<expression>' cannot be used as an assignment target
ORA-06550: line 24, column 8:
PL/SQL: Statement ignored
===================================================
Thanks in Advance;
Ajit

Thanks a lot Vamsi,
i will open the period .
Message was
============
Payables cannot create invoice distributions because the invoice header GL date is in a closed period, and no open or future periods are defined.
Please ask the appropriate person in your organization to define an open or future period. Then Payables will use the next valid accounting date as the invoice distribution GL date.
=======================================

Similar Messages

  • Reason for Cancellation of Invoices

    Hi,
         Can any body tell me the possible reasons for cancellation of invoices ?
    Helpful answers will be rewared
    Thanks & Regards,
    V.Raghavender.

    In case of Incorrect Date.
    Say the pricing for a material has to be of previous year however due to year change new prices are implemented and these prices are copied in the invoice, its incorrect.
    You cancel the invoice and reinforce with correct prices.
    Secondly wrong quantity is billed. If customer received y and the invoice is for X cancel and reinforce.
    If wrong partner in invoiced.. say you have more than one bill to party and the wrong partner is invoice, cancel ...
    and you know, hehehe
    Regards

  • How to use of API for Cancel Sales Orders

    Hi....
    I want to use API for Cancel Sales Orders. Plz give me advice how we can cancel orders. I know that there is procedure provide in ORACLE APPs (i.e. OE_ORDER_PUB.process_order). But in this procedure i know the how to create and update sales order, but how to Cancel order with the use of this API.
    Plz send me soultion as soon as possible. ITS VERY VERY URGENT BASE.
    Thanks in Advance.

    Hi all,
    We are importing Sales Orders on 11.5.9 using OE_Order_PUB.Process_Order API .We have supplied most of the mandatory fields and the same data works from the front end. When we use the API it throws a Ora 20001.
    A snapshot of the error message.
    SQL> exec pk_process_object.process_order('1o');
    Message Count is :2
    Message is RA-20001: User in Package OE_Header_Util Procedure Get_Order_Number
    Message is :User-Defined Exception in Package OE_Header_Util Procedure
    Pre_Write_Process
    Return Status is ErrorU
    PL/SQL procedure successfully completed.
    --------------------------------------------------------------------------------------------

  • API to cancel AP invoice in 11i is required.

    API to cancel AP invoice in 11i is required.

    Check if you can use AP_CANCEL_PKG.ap_cancel_single_invoice
    Sandeep Gandhi

  • How can I contact the administration for cancelling an invoice?

    Hi everyone, first of all sorry for my english.
    I just bought AbodeExportPDF but I made a mistake: I clicked twice on the button "buy now", I rightly received two invoices. How can I contact the administration for cancelling one of the invoices?
    Thank you very much!
    Bye
    Carol
    Ciao a tutti,
    ho cliccato erroneamente due volte sul bottone "compra ora", ho giustamente ricevuto due fatture. come faccio a contattare l'amministrazione per annullare una delle due fatture?
    Grazie,
    ciao
    Carol

    Hi Carol,
    I wish I could speak Italian as well as you speak english, so no apologies!
    To cancel one of those subscriptions, please contact Adobe Customer Support:  Contact Customer Care. A quick chat session should get you taken care of.
    Best,
    Sara

  • Cancellation of Invoice type for all process

    we have Domestic , Deemed , Export , Scrap & Sample scenarions. do i have to create the cancellation invoice type separate for all the scenario . or it can handled with the single cancellation invoice type.
    Also How can i record the reason for cancellation of invoices?. user wants to have the dropdown for the reason.

    Hi Vishal,
    Yes.. it will work with only One invoice Type.
    Basically while cancelling you will enter the Invoice no. So its automatically posted the G/L accounts which is already exists in the Original Invoice..
    Just its reversal document..
    If you want you can test in Test system...take the invoices from VBRK table based on Sales org and the Billing Type.
    Take the different invoices based on your scenarios and try to cancel the invoice using one invoice cancellation type.
    I think it willnot have any issues.
    Regards,
    SK

  • What is the application for  'Cancellation of post goods issued'  in NACE !

    Please any one tell me the application for cancellation of goods issued tcode VL09.

    Hi,
    This is for reversal of goods issue.
    If in some case you have picked a material and done PGI then you decide that there was an error is Ship to Party or delivery date or rates etc. and we want to revert back then you dont cancel the delivery instead in the first place you reverse the goods so that the material and accounting documents that have been posted during PGI are reversed.
    Regards,
    Jn

  • Number range in cancelling excise invoice

    Hai Gurus
    wats the number range object for cancelling excise invoice???
    regrds
    Vibhu

    Dear Vibhu,
    There is no number range object for cancellation of excise invoice.
    for excise invoice number range object is for local:J_1IEXCLOC
    when cancelllation for excise invoice system geneate internal number range number.
    for internal number range object is :J_1IINTNUM
    for your better understanding find the folloing number range objects
    J1I9 Maintenance for Number Range Object
    J_1A_AAWBL Internal Way Bill Number for Asset Movements
    J_1ANUMBER Number range for additional Argentine document number
    J_1AOFFDOC Numbering Object for Official Documents
    J_1APRNTCH Number ranges for printing characters
    J_1BNFDOCN Nota Fiscal document number
    J_1BNFNUMB Nota fiscal number
    J_1I57FC 57FC Number Range Object
    J_1IARE1 ARE1 Doc No object based on Series Group
    J_1IARE3 ARE3 Doc No object based on Series Group
    J_1IBOND Excise Bonding: Bond number object
    J_1ICERT Withholding Tax Certificates (India)
    J_1ICHLNNO Internal number range for challans
    J_1ICONPLA Consolidated PLA serial no. generation
    J_1IDEPINV Excise Invoice Number for Depot Invoices
    J_1IEXCEXP Export excise invoice number range
    J_1IEXCINV Excise invoice number **
    J_1IEXCLOC Local excise invoice number range *******
    J_1IEXCTST Excise invoice with intervals
    J_1IEXINEX Excise invoice number for export
    J_1IINTNUM Internally document number to be generated
    J_1IINTPR2 Dispatch serial number
    J_1ILIC Excise Bonding: License number object
    J_1IPLA2 PLA part II number range object
    J_1IRG1 RG1 Number range object
    J_1IRG1_T No. Range for RG1 - Excise group / Material
    J_1IRG23A1 RG23A part 1 no. range object
    J_1IRG23A2 RG23A part II number range object
    J_1IRG23C1 RG23C part I number range object
    J_1IRG23C2 RG23C part II number range object
    Regards,
    NAr

  • MIRO cancel an invoice document.

    Hi,
    what are steps to cancel an Invoice Document posted with MIRO?
    Best regards

    Hi,
    Procedure to cancel an invoice document, proceed as follows:
    1. Choose Logistics Invoice Verification &#8594; Further Processing &#8594; Cancel Invoice Document.The initial screen for reversal appears.
    2. In the fields Invoice doc. number and Fiscal year, enter the data for the invoice document you want to cancel.
    3. In the Reversal reason field, select the reason for cancelling the invoice. This allows you to differentiate between different types of cancellations.
    You can display the document to check. Choose Display document to do this. You can look at the items of the document to be cancelled. Return to the initial screen by
    choosing Back.
    4. Choose Invoice document &#8594; Post reversal doc.
    Regards
    Ankit Patodi

  • BADI while Cancellation of Invoice in SRM5.0

    Hi,
    I need to fill some own data while cancellation of invoice. Which BADI will be suitable for it?
    e.g. I need to fill field REF_DOC_NO (Inv (ext) number) data for canceled new invoice with own logic instead SAP's standard one. Currently SAP is filling X in front of original invoice's field data for every cancellation of invoice.
    How could be done for it?
    Thanks in advance.
    Rahul Mandale

    Hi,
    Thanks for your reply. I was really required to bypass SAP's standard logic for entering that field "ref_doc_no" for new invoice after cancelation of old invoice.
    Scenario : While cancleation/reverse of every sucessful invoice,
    SAP's standard =>  For new invoice document (of cancelation old invoice) is with field "ref_doc_no" = X + Old invoice Ext number
    Custom requirement :  For new invoice document (of cancelation old invoice) is with field ref_doc_no = Old invoice Ext number + X
    with those BADI's, how it can be done?
    Thanks,
    Rahul Mandale

  • Update GL Date for Cancelled Invoice.

    Dear All,
    I have created an Invoice for Payment in Oracle Payables (Release 12) for Dec-2012 and was suppose to cancel the invoice with GL Date in December period. Instead of December period we have cancelled the invoice in the month of Jan-2013 and GL Date as '10-Jan-2013'. Is there any way that I can revert this cancellation or update the GL Date to prior month. I am afraid since we have cancelled this month there is a discrepancy for year end data. Since we have audit going on any help will be much appreciated.
    I tried AP_CANCEL_PKG API but no luck. Should there be any steps to be followed or any API or script to update the information kindly let me know.
    Thanks,
    Ahmed
    Edited by: 978715 on Jan 13, 2013 11:51 PM

    Hi Glenn-
    I was curious about your progress on this mission. We too have a need to accomplish exactly what you described in your original post. To the best of my knowledge after much research there aren't any simple FM's or BAPI's to update an existing line item in an Accounting Document that has been parked.
    We are attempting to use FBV2 and BDC technology to update a pre-existing line item or add a new one, or delete a pre-existing one but we have major issues trying to select the appropriate line in that table control because it is an Enjoy transaction.
    Any info you can give on your progress would be helpful and I will gladly do the same.
    Thanks,
    Andy

  • Accounting Document not posted for Cancelled Invoice -error in FI interface

    Hi,
    When I create a billing document then an accounting document gets created automatically in the background and then when I cancel the billing document no accounting document gets generated and the field Posting Status in header Detail of Billing document updated as "Errors in Financials Interface.
    I tried to release it for Posting via VFX3 but failed due to below error message in Log:
    "Incorrect doc.no.: 4900000005. Select document number between 3000000000 and 3099999999"
    I have checked the Number range assignments to the Invoice type and Accounting type.
    The number range is same for both Invoice type (Y0F2) and Cancelled Invoice type (Y0S1).
    The Accounting document type (RV) is also same for both the cases. But it is working fine for Y0F2 (Acounting document generated and cleared automatically). But not working fine for Cancelled Invoice (Y0S1).
    Can anybody please help me find out a solution to the issue.
    Thanks, Ram.

    Hi,
    The error message F5151 refers to the number range of the FI document.
    Please have a look at the note 1259505: FAQ: New cancellation procedure in SD, which covers this issue in detail.
    Question 5:
    Q5. What is the FI document type, generated by the cancellation ?
    In the old cancellation procedure, the FI document type is always
    determined in SD, and passed to FI (the same when a normal invoice  -
    not a cancellation -  is transferred to accounting).
    In transaction VOFA there is the field 'Document type' (TVFK-BLART).
    If this field is filled, then the FI document will have the document
    type maintained here.
    If TVFK-BLART is empty, then the FI document will get the default
    document type 'RV'.
    If the new cancellation procedure is performed, the FI document type is
    always determined in FI, based on the document type of the FI document
    to be reversed.
    In transaction OBA7 the FI document type has assigned the field 'Reverse
    document type' (T003-STBLA).
    If it is filled, then the FI cancellation document will get the document
    type maintained here.
    If T003-STBLA is empty, then the FI document cancellation will get the
    same document type as the cancelled FI document.
    Notice that an unexpected FI document type can cause the error message
    F5 151.
    Example:
    F2 invoice 90000001 was released, creating an accounting document with
    document type 'RV'.
    This F2 invoice is reversed by the S1 billing document 70000001.
    In customizing of SD there is:
    Billing Type    Document Type
    F2              RV
    S1
    In customizing of FI there is:
    Document Type    Number range   Reverse Document Type
    RV               00             AB
    AB               01             AB
    The FI number ranges (object RF_BELEG) are:
    No  From number    To number   Ext
    00  0090000000     0099999999  X
    01  0100000000     0199999999
    Different situations can occur, due to these customizing settings of the
    FI document type, caused by the type of cancellation.
    If the new cancellation is used:
    The FI document type 'RV' has 'Reverse Document Type' = 'AB'.
    Document type 'AB' has number range '01' set as internal.
    So the FI document will have its own number included in
    100000000-199999999.
    There is no issue.
    If the old cancellation is used:
    The cancellation billing type S1 has no 'Document type' maintained, so
    the FI document will get document type 'RV'. It has number range '00',
    set as external number range.
    So the FI document should get the same number of S1 billing document.
    But the S1 billing document has number 70000001, not included in the
    interval of number range '01'.
    This will cause error F5 151.
    I hope this information helps you.

  • Output is proposed for the original invoices when they are cancelled.

    Hi,
    I noticed an SAP issue related to the output. The output is proposed  for the original invoices when they are cancelled.
    Issue in detail:
    When you cancel an invoice (X) and create the cancellation Invoice document(Y) .The original invoice is determined with the output(1) when you enter the invoice in the change mode . This is happening  when the output condition records are set up for the Invoice (X) and when the invoice (X) is not proposed with the Output(1). I am not sure whether this is a Standard SAP issue or issue with the Z output requirements.
    Regards
    Balachandar

    This is not a "standard issue". Output works the way it's configured and according to the condition records and requirements in your own system. Review your output configuration and condition records (VV33).
    It is also possible that output is simply proposed any time you enter a document in the change mode. You may apply a requirement to the output type to avoid this. Or just change it to be proposed only once.

  • Cancel Excise Invoice for Export

    Hi all,
    can somebody let me know procedural steps to cancel Excise invoice for export consignment from end user point of view ?
    please do the needful.
    thanks in advanced

    Hi,
    Please follow the below mentioend step:
    1) Go to J1IH or in J1IIN click on cancellation tab .
    2) Enter the document number and document year and series group and press enter
    3) Check whether this is the right excise invoice ur cancelling . if its right document save it.
    If you have created it with reference to export proforma invoice than cancell the proforma and create a new proforma invoice and against the new proforma create new excise invoice as reuired.
    To cancel the proforma export invoice follow the below mentioned steps.
    1) Go to vf02 and enter the billing document number .
    2) on the main screen only click on billing document tab at the top and select complete from the drop down.
    3) once you click on complete system will automaticall cancel the proforma invoice status.
    Hope this will help you to resolve your issue.
    Regards,
    KRishna O

  • Excise Invoice Tab is not display in MIGO for Cancelled document

    Hi,
    We are execuating the incoming excise cycle then in MIGO and J1IEX.It is perfectly working.But in case of cancellation the excise tab is not dispplaying in MIGO.We are using option "Only Capture and Both Capture & Post".Whatever the excise captured and Posted , it is updated in Excise Invoice tab in MIGO.
    As per my understanding the excise tab should come for cancelled doucment also.
    Regards
    Rajev

    Hi,
    You are correct it won'y come for 102 but it will come for 101.But it is not coming for 101 .It is not coming when we cancelled the document.
    but it will come for 101
    .But it is not coming for 101
    can you explain your statement  ?
    If it is not coming for 101 movement type
    check following point
    1) tax code in PO ,all excise condition should be there
    2) Maintain chapter ID material combination in J1ID
    3) Maintain Vendor and Plant excise details in J1ID
    Regards
    Kailas Ugale

Maybe you are looking for

  • Duplicate entries in iTunes display, but both entries point to the same physical location.

    I've seen lots of discussion about how to remove duplicate copies of the same song, but my issue is different. iTunes has duplicate entries in its database, but if I do show in finder, then both entries point to the same physical location. If I delet

  • Problem when running a lex/yacc parser

    All, I am currently seeing a problem when using lex/yacc to generate my parser (I suspect that gcc is the problem), I do not have the same result than the same one I use on my linux box. I am currently using XCode 2.4. I have attached below the lexer

  • IPhoto import and metadata

    Sorry if this has been asked and answer already, but if I import my iPhoto collection into Aperture, will Aperture recognize and import the meta data I've set in iPhoto?

  • Menu Bar goes missing when I close a page/program?

    I am using a 13 MBA 2013 and whenever I close the browser of app store, iPhoto etc, the top menu bar dissapears until I click on the wallpaper at the desktop. Any ideas?

  • Characteristic Infoobject - Data type TIMS

    Hello , Please let me know in Extract Structure of Source System which data type I select for mapping to characterictic Infoobject with TIMS as data type in general tab . If I need to display time in Hours or Minutes how I need to do that , help me w