Quantity Update in Entry View and General Ledger View

作者:郑德鼎 约 6 分钟阅读 更新日期:2024-02-22 2 年前更新 标签:ABAP, CO, Data Engineering, FI, SD, 开发, 数据工程, 财务, 销售分销

Quantity Update in Entry View and General Ledger View

Skip to end of metadata

Created by Cora Phelan, last modified on Feb 24, 2020

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)

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

...

郑德鼎

关于作者:郑德鼎

企业信息化与 SAP 技术顾问,长期专注 SAP ABAP、FI/CO、MM、SD 等模块的技术分享与实战经验总结。查看更多介绍

来源说明:本文内容由「Quantity Update in Entry View and General Ledger View.docx」整理生成,仅用于内部技术分享与学习交流。