cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

DI API- Delivery Discount Percentage

0 Kudos
1,396

Hi expert,

I m trying to create new delivery from another company with DI API.

I am saving xml with code docfrom.SaveXML(filePath);

Then i get this xml with

Documents d1 = (Documents)Initializer.oCompany.GetBusinessObjectFromXML(filePath, 0);

var c = d1.Add();

I'm succes with that. But when i look at the newly created delivery i saw the discount percentage is different from other. The first one is 3, the newly created one is 3.03

I think these value is calculated again. But i dont know how it is calculated?

Because when i write the 3,35 to discount total the discount percentage is calculated as 2,98 not 3,03. Does anybody know how is it?

fromdelivery.pngtodelivery.png?

Accepted Solutions (1)

Accepted Solutions (1)

edy_simon
Active Contributor
0 Kudos

Hi,

SAP has a few ways of calculation.
If you provide Quantity, Price and discount, the line total will be calculated.
If you provide Quantity, Price and line total, the discount will be calculated regardless of what discount you have entered.
For import from XML, all the values are provided for, and as such SBO recalculate the discount.

To workaround your problem, modify the XML file first by removing the below fields:
1. LineTotal (Doc Lines)
2. DocTotal (Doc Header)
3. PriceAfterVat (Doc Lines)

Regards
Edy

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Gul aly or Edy Simon

i have some problem using GetBusinessObjectFromXML , becouse i am traying to export from one database to another some documents

like : stocktransfer , Invoices , deliverys,

etc ,

but when use

Documents d1 = (Documents)Initializer.oCompany.GetBusinessObjectFromXML(filePath, 0);

var c = d1.Add();

i get an error : (-5002) You cannot change the total for this document

how can you solve this problem?