SAP Knowledge Base Article - Public

1463113 - Rounding Error for Customer Invoice Item Net Price

Symptom

The display of the net price of one or more items on the customer invoicing forms (Invoice, Credit Memo, Correction Invoice)
seems to be wrong compared to the quantity and net value of the item.

Example: The item is displayed with NetPrice = 7,43 EUR, Quantity = 6 each, NetValue = 44,50 EUR

The receiver of the invoice document would expect a net value of 44,58 EUR (6 * 7,43 EUR).

Cause

The reason for this behaviour is that the calculation of the net price follows a certain calculation schema 
using the assigned currency for the number of decimals.

For the given example this means:

Internally the net price is calculated as the value 7,425 but according to the currency 'Euro' which has only two decimals the value is rounded up to 7,43 EUR.
Only this result is available for the form template at rendering time.

Resolution

It is possible to get a more precise net price by calculating the net price from the division of the net value by the quantity.
This requires an adaption of the form templates for Customer Invoice, Credit Memo and Customer Correction Invoice in the Adobe Lifecycle Designer.

(FP2.0) - For this the following steps need to be taken

  1. Open the respective form template in the Adobe Lifecycle Designer
  2. Change the binding for element FormInvoiceRequest.bdyMain.frmTableBlock.tblTable.rowItem.frmOptionalPart.frmItem.frmPrice.decPrice
    from $.PriceAndTax.MainTotal.Rate.DecimalValue to None
    Change data binding for NetPrice.JPG
  3. Set display pattern from num{Szzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zz9.99} to num{Szzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zz9.999}
    Basically each additional 9 after the . will give you an additional decimal for the net price. Add as many 9 as you need for your use case.
    Adapt display pattern (ALD 8.0).JPG
  4. Insert the following script into the initialize event of field FormInvoiceRequest.bdyMain.frmTableBlock.tblTable.rowItem.frmOptionalPart.frmItem.frmPrice.decPrice (FP2.0)
    The script will divide the NetValue by the Quantity if it is not zero or Null. Otherwise it will just display zero.
    The script language needs to be set to 'FormCalc'
 if ( FormInvoiceRequest.bdyMain.frmTableBlock.tblTable.rowItem.frmOptionalPart.frmItem.frmQuantity.decQuantity <> null & 
      FormInvoiceRequest.bdyMain.frmTableBlock.tblTable.rowItem.frmOptionalPart.frmItem.frmQuantity.decQuantity <> 0 )
 then
   this.rawValue = ( FormInvoiceRequest.bdyMain.frmTableBlock.tblTable.rowItem.frmOptionalPart.frmItem.frmNetValue.decNetValue /
                    FormInvoiceRequest.bdyMain.frmTableBlock.tblTable.rowItem.frmOptionalPart.frmItem.frmQuantity.decQuantity )
 else
   this.rawValue = 0
 endif
Insert script for net price.JPG

(FP2.5) - For this the following steps need to be taken


  1. Open the respective form template in the Adobe Lifecycle Designer
  2. Change the binding for element FormInvoiceRequest.bdyMain.frmTableBlock.tblTable.rowItem.rowRemarkRow.frmItem.frmPrice.decPrice
    from $.PriceAndTax.MainTotal.Rate.DecimalValue to None
  3. Set display pattern from num{Szzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zz9.99} to num{Szzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zzz,zz9.999}
    Basically each additional 9 after the . will give you an additional decimal for the net price. Add as many 9 as you need for your use case.
    Adapt display pattern (ALD 8.2).JPG
  4. Insert the following script into the initialize event of field FormInvoiceRequest.bdyMain.frmTableBlock.tblTable.rowItem.rowRemarkRow.frmItem.frmPrice.decPrice
    The script will divide the NetValue by the Quantity if it is not zero or Null. Otherwise it will just display zero.
    The script language needs to be set to 'FormCalc'
 if ( FormInvoiceRequest.bdyMain.frmTableBlock.tblTable.rowItem.rowRemarkRow.frmItem.frmQuantity.decQuantity <> null & 
      FormInvoiceRequest.bdyMain.frmTableBlock.tblTable.rowItem.rowRemarkRow.frmItem.frmQuantity.decQuantity <> 0 )
 then
   this.rawValue = ( FormInvoiceRequest.bdyMain.frmTableBlock.tblTable.rowItem.rowRemarkRow.frmItem.frmNetValue.decNetValue /
                    FormInvoiceRequest.bdyMain.frmTableBlock.tblTable.rowItem.rowRemarkRow.frmItem.frmQuantity.decQuantity )
 else
   this.rawValue = 0
 endif
 

Keywords

KBA , AP-CI , Customer Invoice Processing , How To

Product

SAP BUSINESS BYDESIGN 1611 ; SAP BUSINESS BYDESIGN 1705 ; SAP BUSINESS BYDESIGN 1708 ; SAP Business ByDesign 1.0 ; SAP Business ByDesign 1302 ; SAP Business ByDesign 1305 ; SAP Business ByDesign 1308 ; SAP Business ByDesign 1311 ; SAP Business ByDesign 1402 ; SAP Business ByDesign 1405 ; SAP Business ByDesign 1408 ; SAP Business ByDesign 1411 ; SAP Business ByDesign 1502 ; SAP Business ByDesign 1505 ; SAP Business ByDesign 1508 ; SAP Business ByDesign 1511 ; SAP Business ByDesign 1602 ; SAP Business ByDesign 1605 ; SAP Business ByDesign 1608 ; SAP Business ByDesign 1702 ; SAP Business ByDesign 1711 ; SAP Business ByDesign feature pack 2.0 ; SAP Business ByDesign feature pack 2.5 ; SAP Business ByDesign feature pack 2.6 ; SAP Business ByDesign feature pack 3.0 ; SAP Business ByDesign feature pack 3.5 ; SAP Business ByDesign feature pack 4.0

Attachments

Sample_Customer Invoice_Germany (FP2.0).zip
Sample_Customer Invoice_Germany (FP2.5).zip