Skip to Content
0

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

Aug 14, 2017 at 06:11 PM

106

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

ANKIT CHAUHAN
Aug 26, 2017 at 08:22 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Rajesh Khater Aug 26, 2017 at 06:53 AM
0

Is this a bug in SDK?

Share
10 |10000 characters needed characters left characters exceeded
Rajesh Khater Apr 11 at 12:53 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded