Skip to Content

Internal error -5002 while posting AP Invoice with edited tax amount

Hi,

Using DI API, I am able to post an AP invoice with auto-calculated tax amount. But when I try to edit the tax amount, I get Internal error (-5002) occurred.

I have tried multiple permutations and combinations of the following lines of code:

apInvoice.Lines.SetCurrentLine(0);
apInvoice.Lines.TaxJurisdictions.LineNumber = 0;
apInvoice.Lines.TaxJurisdictions.SetCurrentLine(apInvoice.Lines.TaxJurisdictions.Count - 1);
apInvoice.Lines.TaxJurisdictions.JurisdictionCode = "VAT4";    //also tried with VAT@4
apInvoice.Lines.TaxJurisdictions.JurisdictionType = 1;    //also tried by commenting this line

apInvoice.Lines.TaxJurisdictions.TaxAmount = (double)1201.00;
                        
apInvoice.Lines.TaxJurisdictions.Add();    //also tried by commenting this line


What is the right way to update the tax amount at line level? I am using 9.2 PL08 India localization. If I try to edit the tax amount manually in SBO application AP invoice screen in the Tax Amount Distribution window, it works. But through the DI API, it does not work.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Aug 26, 2017 at 08:22 AM

    Hi Rajesh,

    Updating Line Level Tax amount by DI API is only possible when localization has TaxJurisdictions in SAP Business One. For example: TaxJurisdictions can be used in United States Database however it cannot be used in Brazil Localization.

    Refer to SAP Note 2258267 for the same. As a workaround use the SAP Business One client to add the A/P Invoice or A/P Invoice draft.

    Kind regards,

    ANKIT CHAUHAN

    SAP SME Support

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 26, 2017 at 06:53 AM

    Is this a bug in SDK?

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 11 at 12:53 PM

    Hi Ankit,

    I am using the India localization. I can not do this using the SBO client directly, because I have to upload a very large no. of AP invoices from their existing accounting software to SAP, and many of them require edited tax amounts.

    Please provide a solution using DI API.

    Thanks,

    Rajesh.

    Add comment
    10|10000 characters needed characters exceeded