cancel
Showing results for 
Search instead for 
Did you mean: 

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

rajesh_khater
Active Participant
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

rajesh_khater
Active Participant
0 Kudos

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.

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

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

rajesh_khater
Active Participant
0 Kudos

Is this a bug in SDK?