Skip to end of metadata
Go to start of metadata

Purpose

The purpose of this page is to explain the quantity update in new general ledger

Overview

From note 1063198 - Quantity in entry view and general ledger view the following is stated under section Solution

In classic general ledger accounting the MENGE field is filled in the BSEG table as delivered by the sending application (for example, logistics). The totals record table of classic general ledger accounting (the GLT0 table) does not contain the quantity. However, in classic general ledger accounting the quantity has the character of an additional piece of information in the line items and is not a reporting criterion. From a business point of view a quantity update to specific items, which are assigned to other document items (for example, price differences), is not correct.

In new general ledger accounting there is one entry view and one general ledger view for each document. The entry view displays the quantity as delivered by the sending application (the BSEG table). The general ledger view now displays the correct quantity from a business point of view (the FAGLFLEXA table). The totals record update (the FAGLFLEXT table) is carried out with the correct quantity from a business point of view. For postings from SD (billing documents), the quantity was previously filled in the general ledger view of the generated FI documents but not in the entry view (BSEG-MENGE). With SAP Note 1477363, the quantity delivered by SD is updated for these documents both for the entry view and in the general ledger view.

If, in the general ledger view, you require the quantity update to other rows than envisaged in the standard system, you can influence the quantity update using the BAdI AC_QUANTITY_GET in the function module AC_DOCUMENT_QUANTITY_GET (module for central quantity determination and update in accounting). Note that this also affects the quantity update in FI-SL, CO-OM, CO-PA, and EC-PCA, if you do not restrict the changes to the applications. Note also that with SAP Note 1477363, the function module 'AC_DOCUMENT_QUANTITY_GET' is also used for the derivation of the quantity in the entry view for SD documents, and changes in the BAdI AC_QUANTITY_GET with no restriction to the application can also affect the entry view (BSEG).

Following the implementation of the corrections from this SAP Note, the system corrects the quantity displayed in the general ledger view in the document display (transactions FB03, FB03L). The quantity is then displayed according to the update in FAGLFLEXA and not in BSEG, as was previously the case.


In general regarding the compare of the quantities between the transactions FBL3N and FAGLL03 these cannot be the same since the update logic between the entry and g/l view are different.

The reason for the different logic is the fact that the quantity is included into the summary table structure (field-MSL). Therefore the quantity amounts are added up. If more than one line relevant to the goods movement will update quantity in the general ledger view as it is done in the entry view it this will lead to the double or more quantity amounts. Therefore the quantity update logic 

differentiates between the quantity update relevant and not relevant processes.

The quantity update in the General Ledger view of FI documents originated from Sending applications such as SD/MM is only in line items for which the indicator "Quantity update" (technical fieldname XMFRW) has been set to X.  The XMFRW indicator is only set on certain document line items since the quantity should only be transferred once per process

As referenced where the value X in field XMFRW (Quantity update) is passed to the accounting interface, an update will be made in the new gl table where it is remains empty no update in the quantity field will be made.

 

From note 1984315 - 0FI_GL_14, FAGLL03: Which fields are taken from BSEG and which from new G/L line item table (e.g. FAGLFLEXA)? the following is stated under section Solution

 

Quantity fields

The system always takes the quantity fields from the new G/L line item table (e.g. FAGLFLEXA).

This must be done because the line items must be summable in reporting. If the system took the quantities simply from BSEG (BSEG-MENGE has more or less statistical meaning) the reporting would not be correct, because then overall sum of the quantities would not be correct.

General concept of the quantity update in new G/L:

The quantity transfer for all receivers in financial accounting (except for accrued CO-PA) is controlled by means of the central function module AC_DOCUMENT_QUANTITY_GET. An existing quantity is only set if the indicator for the quantity update (I_ACCIT-XMFRW - update quantity in accounting) is active in the internal structure (i_accit). The XMFRW indicator is set by the respective application for postings from the SD or the MM. However, the XMFRW indicator is only set on certain document line items since the quantity should only be transferred once per process to the NewGL Accounting (or EC-PCA) in the standard system. For SD documents the XMFRW is typically set only on the expense lines.

 

Quantity Update in Materials Management

  • In MM-IM (Inventory Management) the flag XMFRW will be received from the control table T156W [Posting string values].  It is depends on BUSTW (Posting string for values) and KTOSL (Transaction Key)
  • When inventory management for example MIGO updates the quantity field (for example where it is a valuated goods receipt (WEPOS = X and WEUNB = 'SPACE' table EKPO) and sets the flag to XMFWR. The invoice should not set it then. Only one of the transaction should update this data for quantity, otherwise the data will be updated twice, it would be false.
  • The quantity is not updated during the goods receipt where you have not valuated the GR (Goods Receipt, Non-Valuated - EKPO-WEUNB = X )

  • The quantity is not updated for documents associated with Blank Purchase Orders or Scheduling Agreements as there is no quantity in same.

  • The quantity is not updated if the invoice is created via planned delivery costs (field XEKBZ = X table RSEG) or for subsequent Debit/Credit (TBTKZ = X table RSEG) as the quantity would have been updated in prior document.

  • The quantity is updated in the new general view of the invoice document where there is no goods receipt. (WEPOS = SPACE Table EKPO)

     

Example 1: Purchase Order with GR based IV (EKPO-WEBRE) created with transaction ME21N, Goods receipt in transaction MIGO and Invoice Receipt in transaction MIRO

PO History

 

FI document for Material Document

Entry view

General Ledger View

 

FI document for Invoice Receipt

 

Entry View

 

General Ledger View

 

In the table ACCTIT [Compressed Data from FI/CO Document]  the field XMFRW is updated for the line items associated with the goods receipt but not the invoice receipt

For this reason there is no quantity update in the general ledger view (in this case FAGLFLEXA)

 

 

In the table T156W the transaction keys BSX (Inventory posting) and WRX (GR/IR clearing account) are updated with the quantity values during the inventory management. (See table T030W [Transaction Key Names] for name of transaction keys)

 

Example 2:  Purchase Order without GR (WEPOS = SPACE Table EKPO) created with transaction ME21N,  Invoice Receipt in transaction MIRO

 

PO History

 

FI document for Invoice Receipt

Entry View

 

General Ledger View

 

In the table ACCTIT [Compressed Data from FI/CO Document]  the field XMFRW is updated for the line items associated with the invoice receipt. It is not possible to create a goods receipt for this type of purchase order. For this reason the quantity update in the general ledger view (in this case FAGLFLEXA)

 

Quantity Update in Sales and Distribution

In accounting documents originated from SD billing documents the quantity field BSEG-MENGE in the entry view is derived from field XACCIT-MENGE ("Quantity") passed from SD to the accounting interface

 

In the General Ledger View  in the standard field FAGLFLEXA-MSL ("Quantity") is filled from XACCIT-FKIMG ( "Actual Invoiced Quantity"), field FAGLFLEXA-RUNIT ("Base Unit of Measure") is filled from XACCIT-VRKME ("Sales Unit") for FI documents created from SD billing documents.

It is still the same in S/4HANA universal journal table ACDOCA (ACDOCA-MSL AND ACDOCA-RUNIT) as it was in SAP ECC General Ledger table FAGLFLEXA

 

In relation to S/4HANA, Method GET_QUANTITY_MSL of class CL_FINS_ACDOC_UTIL is the successor of/replaces the function module AC_DOCUMENT_QUANTITY_GET

 

From note 1477363 - BSEG quantity is not filled for SD billing documents the following is stated

for postings from SD (billing documents), quantities and units of measure are also determined for the application FI using the function module AC_DOCUMENT_QUANTITY_GET according to the logic implemented there, and are updated in the fields BSEG-MENGE and BSEG-MEINS.

The determination of the quantity and unit of measure in the function module AC_DOCUMENT_QUANTITY_GET is executed only if the field 'MENGE' in the FI document (that is generated internally at runtime) is still initial when the function module is called. If the "Quantity" field in your system is already filled using a (SD-BIL) user exit, substitution, BAdI implementation, source code modification, or similar, the module AC_DOCUMENT_QUANTITY_GET is not run.


Example 3: Billing document released to accounting via transaction VF02

 

Display of Function Module AC_DOCUMENT_QUANTITY_GET


Information on AC_DOCUMENT_QUANTITY_GET form QUANTITY_GET_VBRK:

 

*---------------------------------------------------------------------*

* Take over quantity from SD billing document.

* The flag ACCIT-XMFRW is set by SD by default for each first

* line of all (non-statistical)

*---------------------------------------------------------------------*



I set a breakpoint at function module AC_DOCUMENT_QUANTITY_GET to show fields internally on posted billing document using Simulation tool SAPFACC0 - Program for Testing the FI Service of FI/CO Interface (SD-FI) - see wiki Introduction Book for SAPFACC0 in relation to same)


.

From note 1477363 - BSEG quantity is not filled for SD billing documents

The following is also stated

The quantities are always written with a plus sign in BSEG-MENGE. During document display and list displays, the plus/minus sign is always determined from the debit/credit indicator if the corrections from SAP Notes 2185343, 2193694, and 2194319 have not been implemented.

FI Document for SD Billing Document

Entry View

 

Entry in Table BSEG

General Ledger View

 

Entry in FAGLFLEXA


As soon as the corrections from SAP Notes 2185343, 2193694, and 2194319 are implemented in your system, there are several new fields, including the field BSEG-SQUAN. In this field, the system will update the plus/minus sign of the quantity in the future so that the quantity can be displayed with the appropriate positive/negative sign in the document display. With this correction, the plus/minus sign of the quantity does not always necessarily correspond to the plus/minus sign or the debit/credit indicator of the amount.

The notes are only relevant for new posted documents. There is no updated of already posted documents. They will be displayed as before.


FI Document for SD Billing Document 

Entry View

 

Entry in Table BSEG

 

General Ledger View

Entry in FAGLFLEXA

 

 

Update of Quantity Sign For SD Processes

The sign of the quantity does not depend on the posting key, but on the settings in the item categories used in the billing document and the SD document type. Generally the sign of quantities in accounting documents created from SD is negative for outbound and positive for returns and reversals as when you sell the material to the customer and therefore the stock has to be reduced by the corresponding quantity. If the material is returned by the customer, then it is added again to your stock.


 

Quantity Update in BAPI

The quantities should to be transferred without a plus/minus sign. In the accounting documents, the quantities are then updated correctly according to the debit/credit indicator of the posting item

From Note 744627 - BAPI_ACC_*_POST: Quantity w/wrong +/- sign the following is stated

Solution

The interface has not been designed to transfer negative quantities. The fact whether the quantity to be posted is greater or smaller than zero is defined by the value in the corresponding line in table CURRENCYAMOUNT, this table is linked to the ACCOUNTGL line via field ITEMNO_ACC.


From Note 306504 - Collective note: BAPIs for the AC interface the following is stated

Quantity update to the accounting from the payroll (HR)

The AC interface uses the +/- sign of the amount to determine whether the line item is supposed to be posted to the debit or the credit of the specified account. If the quantity is to be updated in exactly the same way as the amount (with the same +/- sign), the AC interface expects the quantity without +/- signs.

 

Update of quantity values in General Ledger View

Quantities are always split by the same ratio as the document currency or local currency amounts. Ratios for splitting quantities are not recalculated from quantities in base items, because base items may be posted without quantities, as a document must have balance zero only in currency amounts, but not in quantities.

Example:  

A document splitting rule is defined in such a way that the Material items associated with GL account 120101 (item category 03000) are split based on the expense items  associated with GL account 400000 (item category 20000) 

Entry View


General Ledger View


 

The formula for calculating the split amount can be seen in notes 1851774 and 1703456 

Quantity of line to be split

5-

Sum of base rows on document currency:

The sum of all base lines:

Account  Profit Center     Amount        Debit/credit indicator

400000   CP-CP01            12,00             S

400000  CP-CP02             13,00             S

                                         ...........

                                         25,00

 

  • Sum of base lines with same account assignment - CP-CP01:

Account  Profit Center     Amount        Debit/credit indicator

400000   CP-CP01            12,00             S

 

  • Sum of base lines with same account assignment - CP-CP02:

Account  Profit Center     Amount        Debit/credit indicator

400000   CP-CP02          13,00             S

 

Created split lines   

Account  Profit Center                                                               Quantity       Debit/credit indicator

120101  CP-CP01   (-5   *  (12,00 /25,00 ) )  =                            2.4              H

120101 CP-CP02   (-5 *     (13,00/25,00))      =                           2.6              H

Related Content

Related Documents

Related SAP Notes/KBAs

Sap Note  2618317-New GL creates additional items for quantities

Sap Note 2645966 - FB03 - general ledger view: Negative signs in debit items

Sap Note 2631627  - Plus/minus sign of quantity copied from reversed FI document to reversal document during negative posting in SD billing

Sap Note 2618317 - New GL creates additional items for quantities

Sap Note 1063198 - Quantity in entry view and general ledger view

Sap Note 1477363 - BSEG quantity is not filled for SD billing documents

Sap Note 1423004 - Subsequent posting: Quantities in NewGL not posted as FI-SL

Sap Note 1785266 - Document splitting: Rounding of quantities

Sap KBA 2123259 - Quantity in subsequent FI accounting document of SD billing

Sap Note  619498 - Transfer of quantity and value fields

Sap Note 504675 Quantity update in Profit Center Accounting

Sap Note 1984315 - 0FI_GL_14, FAGLL03: Which fields are taken from BSEG and which from new G/L line item table (e.g. FAGLFLEXA)?

Sap Note 105747 -  Billing item: quantity is missing

SAP Note 301077 - User exits for the interface for accounting

Sap Note 744627 - BAPI_ACC_*_POST: Quantity w/wrong +/- sign

Sap Note 306504 - Collective note: BAPIs for the AC interface

Sap Note 872687 - FI-SL: too many line items were posted

Sap Note 160011 - Transfer invoiced quantity to CO document

Sap Note 866598 - FI-SL: BAdI AC_QUANTITY_GET with ledger parameter

Sap Note 2185343 - Accounting Interface: Update of plus/minus sign of quantity in entry view of FI document

Sap Note 2194319 -  FB03/overview: Plus/minus sign for quantity not always correct

Sap Note 2193694 - FAGLL03: Display of plus/minus sign of quantity is not always correct

Sap Note 2383379 - Wrong quantity sign in the new GL tables

Sap Note 2403270  - Wrong sign of Quantity in SPL Ledger due to document splitter

Sap Note 1703456 - Document splitting: Rounding of quantities

Sap KBA 1851774 - Sum of base lines equals zero in Document splitting

Sap Note 1628607 - Document splitting: Business process assigned in entry view

Sap Note 2223903 Wrong Quantity in General Ledger (table fields ACDOCA-MSL, -RUNIT),

Sap Note 2472963 - Wrong quantity reported in ACDOC-MSL

Sap Note 2645966 - FB03 - general ledger view: Negative signs in debit items