Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Setting the Total field in a Down Payment Request

Hello, all

Is  it possible via the DI API explicitly to set the
Total field in an A/R Down Payment Request (DPR)?

According to the SDK documentation, only the Percent
may  be  set via the Document.DownPaymentPercentage,
the Total being calculated automatically.   In  cer-
tain  cases,  however, B1's rounding mechanism won't
let the programmer specify an arbitrary value of the
Total,  even if it is small and well within the per-
cents precision.  For examle, if the base document's
Total Before Tax is 25.00 and the Tax is 4.50 (18%),
and one needs to create a Down Payment  Request  for
10.00, the DPM percent will be:

         10.00 / 29.50 * 100 = 33.898305 .

So the Total before tax in the DPR will be:

          25.00 * 33.898305 / 100 = 8.47 ,

and the Tax

                8.47 * 0.18 = 1.52 ,

which makes for a Total of

                 8.47 + 1.52 = 9.99

instead of the desired 10.00!  While I see no way of
setting it to 10.00 exactly via the DI  API,  it  is
easily  achievable via the UI by simply typing 10.00
into the Total field:

  a.  Initial DPR form: ,

  b.  Same form with modified Total: .

It seems that some B1 documents may be  created  via
the  UI, but not via the DI API, which is wrong.  Or
is there a way around this limitation?
Former Member replied

Hi Anton,

I should have better read the question and to have done the test before...

To do what you want, "just" fill the DocTotal property of the DownPayment object with the exact amount you want.

Every thing will be calculated correctly.



0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question