2453614_E_20240606 FAQ Universal Journal Extensibility

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

SAP Note

2453614 - FAQ: Universal Journal Extensibility


Component: FI-GL (Financial Accounting > General Ledger Accounting), Version: 67, Released On: 25.04.2024

Symptom
You use Finance transactions in SAP S/4HANA Finance or SAP S/4HANA (On-Premise or Cloud) and would like to have
more information included in journal entry and/or plan data line items.

Other Terms
Custom Fields and Logic, extensibility, custom fields, customer fields, coding block, journal entry item, OXK3, CI_COBL,
KEA5, universal journal, GGB0, GGB1, substitution, validation, BADI_FINS_ACDOC_POSTING_EVENTS,
FIN_ACDOC_EXT_SUBSTITUTION; ACDOCP, plan data line item, CO-PA, Custom Fields app, Custom Logic app

Reason and Prerequisites


You need custom fields in addition to the standard fields available for journal entry line items in the ACDOCA table and/or
for plan data line items in the ACDOCP table. You are looking for more information about the extensibility options that are
available for the different products and which option best fits your use case.

Solution
Several extensibility options are available for these 3 products:
“Classic” Coding Block extension using OXK3 transaction and CI_COBL structure
S/4HANA key user extensibility using the Custom Fields and Custom Logic apps and the Coding Block business context
S/4HANA key user extensibility using the Custom Fields and Custom Logic apps and the Journal Entry Item business
context
"Classic" CO-PA custom characteristics using KEA5 transaction
S/4HANA key user extensibility using the Custom Fields and Custom Logic apps and the Market Segment business
context
Custom fields created with any of these extensibility options are always added to both tables ACDOCA (journal entry line
items) and ACDOCP (plan data line items).
Product Availability of Extensibility Options

Extensibility Option S/4HANA Finance (sFIN) S/4HANA (On-Premise) or S/4HANA Cloud Public Edi
S/4HANA Cloud Private E tion
dition

Classic Coding Block Available Available Not available

S/4HANA key user extensibilit Not available Not recommended Available


y: Coding Block business conte
xt

S/4HANA key user extensibilit Available as of 1605 Available Available


y: Journal Entry Item business
context

Classic CO-PA custom characte Available Available Not available


ristics (KEA5 transaction)
S/4HANA key user extensibilit Not available Available as of SAP S/4HANA Available
y: Market Segment business co 2020
ntext

Features of the different extensibility options


“Classic” Coding Block extensibility using OXK3 transaction and CI_COBL structure
Widely used in SAPGUI transactions, in MM, FI and CO. You can easily extend many processes that lead to journal
entries in the ACDOCA table. On the other hand, many additional tables are also extended including MSEG, EBKN and
EKKN, which may be unnecessary for some use cases. Not available in SAP S/4HANA Cloud Public Edition.
Available in many Fiori apps that post journal entries as of SAP S/4HANA Finance 1605 and SAP S/4HANA.
Derivation and validation possible with the Validation/Substitution tool (GGB0/GGB1 transactions).
Limited to 18 fields (see SAP Note 885181 for a workaround). Only CHAR and NUMC data types allowed (see SAP Note
130174).
Not used for customer or supplier line items (account type D or K in ACDOCA table), but substitution is possible with FI
callup point 2.
Analytics: In SAP S/4HANA you can use the SCFD_EUI transaction to publish a classic Coding Block field to the
S/4HANA key user extensibility app (Custom Fields and Custom Logic apps) and subsequently use it in CDS-based
analytics, in the same way as for any field initially created in the key user app.
Interfaces: BAPI_ACC_DOCUMENT_CHECK/POST interfaces and other interfaces support CI_COBL fields.
S/4HANA key user extensibility using Custom Fields and Custom Logic apps and Coding Block business context
Successor of the “classic” Coding Block extension in SAP S/4HANA Cloud Public Edition. Extends the same tables and
most processes that lead to journal entries.
Available in Fiori Reuse UI for many transactions that post journal entries, but not available in SAPGUI transactions.
Derivation and validation possible in SAP S/4HANA Cloud Public Edition with Manage Substitution/Validation Rules
app (F4406, event Coding Block) or FIN_CODING_BLOCK_SUBSTITUTION/VALIDATION enhancement options.
Limited to 20 fields (max. 400 characters in total) for SAP S/4HANA Cloud Public Edition. Only CHAR and NUMC data
types are allowed.
Not used for customer or supplier line items (account type D or K in ACDOCA table), but derivation is possible with
FIN_CODING_BLOCK_SUBSTITUTION enhancement option.
Analytics: Custom fields available in all relevant CDS-based cubes and queries.
Interfaces: Custom fields available in BAPI_ACC_DOCUMENT_CHECK/POST in SAP S/4HANA (On-Premise) and
SAP S/4HANA Finance 1605. Custom fields also available in OData read APIs for plan and actual data in SAP S/4HANA
Cloud Public Edition and in SOAP services to post journal entries in SAP S/4HANA Cloud Public Edition.
S/4HANA key user extensibility using Custom Fields and Custom Logic apps and Journal Entry Item business context
Local extension of journal entries available in SAP S/4HANA and SAP S/4HANA Finance 1605.
Custom fields are added (via include structure INCL_EEW_ACDOC) to accounting interface structure ACCIT and to
tables ACDOCA and ACDOCP.
Derivation of custom field values is possible with the BADI_FINS_ACDOC_POSTING_EVENTS Business Add-In in
SAP S/4HANA (On-Premise) and the FIN_ACDOC_EXT_SUBSTITUTION enhancement option in SAP S/4HANA
Cloud Public Edition. Note that this derivation will only affect table ACDOCA.
As of SAP S/4HANA 2020 these custom fields are also added to table BSEG.
From then on a substitution of these custom field values is possible in GGB1 transaction with FI callup point 2 (BSEG) in
SAP S/4HANA (On-Premise) and the Manage Substitution/Validation Rules app (F4406, event Journal Entry Item) or
the FIN_ACDOC_ITEM_SUBSTITUTION enhancement option in SAP S/4HANA Cloud Public Edition. These
derivations affect BSEG, ACCIT, and ACDOCA. The derivations mentioned above still affect ACDOCA only, however.
Field values cannot be entered manually, but display is possible in Manage Journal Entries Fiori app, Display
Document (FB03) transaction overview (ALV list, General Ledger View only) and in G/L Account Line Item Browser
(FAGLL03H) transaction.
Limited to 200 fields for SAP S/4HANA Cloud Public Edition, all data types allowed. However, fields with data type
amount, quantity or number will provide limited functionality and can lead to unexpected system behavior - see
explanation at end of this text.
Can be used on any type of journal entry line item.
Analytics: Custom fields available in all relevant CDS-based cubes and queries in SAP S/4HANA (Cloud and On-
Premise).
Interfaces: Custom fields available in BAPI_ACC_DOCUMENT_CHECK/POST in SAP S/4HANA (On-Premise) and
SAP S/4HANA Finance 1605. Custom fields also available in OData read APIs for plan and actual data in SAP S/4HANA
Cloud Public Edition and in SOAP services to post journal entries in SAP S/4HANA Cloud Public Edition.
Classic CO-PA custom characteristics using KEA5 transaction
Extension of the CO-PA operating concern by custom characteristics created in KEA5 transaction. These fields are also
generated in journal entries in ACDOCA table.
Field values can be entered manually in SAPGUI transactions, but only when the account assignment is to a
profitability segment or using so-called "attributed" profitability segments (go to https://help.sap.com/S4_OP_FIN >
Financial Planning and Analysis > Controlling (CO) > Profitability Analysis (CO-PA) > Margin Analysis > Structures and
Master Data > Master Data > Profitability Characteristics in the Journal Entry).
Derivation of values possible with the CO-PA derivation tool (KEDR transaction).
Limit of 60 custom fields in operating concern. Only CHAR and NUMC data types are allowed.
Can only be used for cost or revenue G/L line items, not for balance sheet accounts.
Analytics: Custom fields are not directly available in CDS-based cubes and queries. It is possible to add them, however,
modification-free, as described in Note 3005736.
Interfaces: BAPI_ACC_DOCUMENT_CHECK/POST and other interfaces support CO-PA fields.
S/4HANA key user extensibility using Custom Fields and Custom Logic apps and Market Segment business context
Extension of CO-PA operating concern available in SAP S/4HANA Cloud Public Edition and as of SAP S/4HANA (On-
Premise) 2020.
Field values can be entered manually in Fiori apps (for example, Post General Journal Entries) and SAPGUI transactions
(for example, Create Sales Orders(VA01), but only when the account assignment is to a profitability segment or using so-
called "attributed" profitability segments (go to https://help.sap.com/S4_OP_FIN > Financial Planning and Analysis >
Controlling (CO) > Profitability Analysis (CO-PA) > Simplified Profitability Analysis > Structures and Master Data >
Master Data > Profitability Characteristics in the Journal Entry).
Derivation of values possible with the CO-PA derivation tool (KEDR transaction) in SAP S/4HANA (On-Premise). In
SAP S/4HANA Cloud Public Edition, use the Manage Substitution and Validation Rules Fiori app for the Market
Segment business context, or the FINS_MARKET_SEGMENT_SUB enhancement option.
In SAP S/4HANA (On-Premise), there is a limit of 60 custom fields in operating concern, and only CHAR and NUMC
data types are allowed. In SAP S/4HANA Cloud Public Edition, there is a limit of 200 custom fields for margin analysis,
and only CHAR and NUMC data types are allowed.
Can only be used for cost or revenue G/L line items, not for balance sheet accounts.
Analytics: Custom fields available in all relevant CDS-based cubes and queries.
Interfaces: Custom fields available in BAPI_ACC_DOCUMENT_CHECK/POST in SAP S/4HANA (On-Premise).
Custom fields also available in OData read APIs for plan and actual data in SAP S/4HANA Cloud Public Edition and in
SOAP services to post journal entries in SAP S/4HANA Cloud Public Edition.
For more detailed information about these features and functions in SAP S/4HANA Cloud Public Edition and SAP S/4HANA
(On-Premise), read the documentation published on the SAP Help Portal (https://help.sap.com). Follow the navigation
paths:
For SAP S/4HANA Cloud Public Edition:
Navigation path:
https://help.sap.com/S4_CE_FIN > Accounting and Financial Close -> General Ledger Accounting -> Business
Transactions -> Journal Entries -> Extending Journal Entries for General Ledger Accounting
For SAP S/4HANA (On-Premise) or SAP S/4HANA Cloud Private Edition:
Navigation path:
https://help.sap.com/S4_OP_FIN > Accounting and Financial Close > Financial Accounting (FI) > General Ledger
Accounting (Fi-GL) > Configuration of General Ledger Accounting > Extensibility Options for Finance > Custom Fields
in Finance
Recommendations
Extensibility using Business Contexts: Coding Block versus Journal Entry Item?
Add custom fields using the Coding Block business context if the field value is to be entered manually on the UI, or if it
needs to be entered early in the process, for example, when a purchase order is created that doesn’t lead to journal
entries immediately.
Add custom fields using the Journal Entry Item business context if it is possible to always derive the field value or
obtain it using external interfaces. This method, in contrast to using the Coding Block business context, has the
advantage that other objects like Purchase Order or Supplier Invoice are not extended unnecessarily. You can also create
more custom fields, without restrictions on data types.
Regarding analytics, there is no difference – both extensibility options are available in the same reports.
SAP S/4HANA Cloud Public Edition?
Only S/4HANA key user extensibility using the Custom Fields and Custom Logic apps is supported in SAP S/4HANA
Cloud Public Edition. Use the Coding Block, Journal Entry Item or Market Segment business context depending on
your use case. Please take into account that only SAP S/4HANA Cloud Public Edition is relevant for the restrictions
mentioned above. SAP S/4HANA Cloud Private Edition can technically be seen as the SAP S/4HANA (On-Premise)
scenario in this context.
SAP S/4HANA (On-Premise) and SAP S/4HANA Finance?
Use the “classic” Coding Block extensibility (OXK3 transaction) instead of the S/4HANA key user tool and the Coding
Block business context. In the SCFD_EUI transaction, you can publish a classic Coding Block field to the key user app
and subsequently use it like any field initially created in the key user app. Native key user app fields, however, cannot be
used in classic SAPGUI transactions and reports. This means you get the more use out of custom fields created in OXK3
since the use of custom fields created with the key user app is limited to Fiori apps only.

For more information, see https://help.sap.com/S4_OP_FIN > Accounting and Financial Close > Financial Accounting
(FI) > General Ledger Accounting (Fi-GL) > Configuration of General Ledger Accounting > Extensibility Options for
Finance > Custom Fields in Finance > Customizing Settings for Classic Coding Block Extensibility Option

If the “classic” Coding Block extensibility doesn’t suit your use case, we recommend using the Journal Entry Item
business context. For example, use this option if the field value doesn’t have to be entered on the UI or if you need
datatypes like amount or quantity. There are only slight differences to Coding Block regarding interfaces and derivation
options.
Use CO-PA custom characteristics only if your use case is clearly limited to cost or revenue items (with CO-PA account
assignment). While you can use the CO-PA derivation tool (KEDR transaction) for these fields, they are not supported by
the S/4HANA key user extensibility app. You must develop your own CDS view enhancements (EXTEND VIEW) using
ABAP in Eclipse if you want to use these fields in CDS-based analytics.
As of SAP S/4HANA (On-Premise) 2020, you have the following alternatives for creating new custom fields used in
Profitability Analysis:
1. We recommend that you use the custom fields in the Market Segment business context if possible (created using the
Custom Fields and Custom Logic apps)
2. If you need a standard data element, for example, it is possible to create your own field in an append to the include
INCL_EEW_MARKET_SEGMENT_PS via SE11 and enable this new field for the Market Segment business context
using the SCFD_EUI transaction. This field is then available in Custom Fields and Custom Logic apps. Note: This
method requires expert DDIC knowledge.
3. To create a new custom field (only if the above two variants do not work), use transaction KEA5. In this case, you must
develop your own CDS view enhancements (EXTEND VIEW) using ABAP in Eclipse if you want to use these fields in
CDS-based analytics.
SAP strongly recommends using the extensibility options listed above. In general, we do not recommend extending journal
entry line items by creating append structures direct in the SE11 transaction. In particular, you should never create an append
structure direct to the ACDOCA table as this causes issues such as the syntax error described in SAP Note 2160045.
Relevant only for the Journal Entry Item business context: If you still need to create an append structure manually, you must
append the INCL_EEW_ACDOC structure to ensure that the manually created extension fields behave like extension fields
created using the Journal Entry Item business context in the S/4HANA key user extensibility tool. Fields created in this way
can then also be published to the Custom Fields and Custom Logic apps later using the SCFD_EUI transaction.
Please do not define any customer fields with a field length greater than 45 characters (e.g. ZZ_CUST_FIELD type CHAR60)
or with a field name longer than 20 characters (e.g. ZZ_CUST_FIELD_TOO_LONG_FIELDNAME), because this may lead to
problems in several applications like e.g. balance carry forward (see note 3195918), drilldown reporting, BW extraction and
others.
Features by Topic
Analytics
To enhance CDS-based analytics in Finance by custom fields, all extensibility options (except for classic CO-PA
characteristics) provide the same functionality. Any custom fields can be published to relevant CDS-based cubes and
queries in the Custom Fields and Custom Logic apps in SAP S/4HANA (Cloud and On-Premise). In SAP S/4HANA
Finance 1605, only the I_GLACCOUNTLINEITEMCUBE and I_JOURNALENTRYITEMCUBE line item cubes are
supported.
For custom fields of the “classic” Coding Block, note that you must first use transaction SCFD_EUI to make them
available in the Custom Fields and Custom Logic apps.
To get classic CO-PA characteristics into CDS-based analytics, you have to develop your CDS view enhancements
(EXTEND VIEW) using ABAP in Eclipse. This is a modification-free development, similar to creating an append
structure in the SE11 transaction. See SAP Note 3005736.
All custom fields are available in the G/L account line item browser (FAGLL03H transaction).
To enhance SAP BPC for S/4HANA, go to https://help.sap.com/S4_OP_FIN > Financial Planning and Analysis >
Financial Planning > SAP Business Planning & Consolidation for SAP S/4HANA -> Adaptations for SAP BPC for
S/4HANA -> Adapting the Model Level.
Interfaces
BAPI_ACC_DOCUMENT_CHECK/POST supports all custom fields. For custom fields added using the Coding Block
and Journal Entry Item business contexts, use EXTENSION2 and implement the BADI_ACC_DOCUMENT Business
Add-In to map EXTENSION2 to the internal structure. For CO-PA characteristics, use CRITERIA.
“Classic”Coding Block custom fields and "classic" CO-PA characteristics are also supported in other interfaces
(unchanged from SAP Business Suite).
Many interfaces in SAP S/4HANA Cloud support custom fields using the Coding Block, Journal Entry Item, and Market
Segment business contexts. For example:
JournalEntryBulkCreationRequest_In
JournalEntryCreateRequestConfirmation_In
MaterialDocumentCreateRequest_Async_In (Coding Block only)
SupplierInvoiceS4Request_In (Coding Block only)
OData APIs to read journal entries and to read and write financial plan data also support custom fields of the Coding
Block and Journal Entry Item business contexts in SAP S/4HANA Cloud.
Manual Entry of Values
Custom fields added using the “classic” Coding Block can be manually filled in many SAPGUI transactions, just as in
SAP Business Suite (MIGO, MIRO, FB50, etc.). Values for these fields can also be entered manually in many Fiori UIs
within Finance and Purchasing.
Values for custom fields added using the Coding Block business context can be entered in Fiori UIs, but they can’t be
entered in SAPGUI transactions.
Values for custom fields added using the Journal Entry Item business context cannot be filled manually on any type of
UI.
CO-PA custom characteristics can be entered manually in SAPGUI transactions and Fiori UIs, in the popup to enter the
profitability segment, but only when the real account assignment is the profitability segment. This is relevant for both
the "classic" CO-PA characteristics and for custom fields created using the Market Segment business context.
Derivation and Validation
Values for custom fields added using the “classic” Coding Block can be derived from other values and validated using the
Validation/Substitution tool (GGB0/GGB1 transactions, CO callup point 1 and FI callup point 2).
Values for custom fields added using the Coding Block business context can be derived from other values and validated
using the Manage Substitution/Validation Rules app (F4406, event Coding Block), or using the
FIN_CODING_BLOCK_SUBSTITUTION and FIN_CODINGBLOCK_VALIDATION enhancement options in SAP
S/4HANA Cloud Public Edition. These options are not available in SAP S/4HANA (On-Premise).
Values for custom fields added using the Journal Entry Item business context can be derived from other values using
the BADI_FINS_ACDOC_POSTING_EVENTS Business Add-In in SAP S/4HANA (On-Premise) and the
FIN_ACDOC_EXT_SUBSTITUTION enhancement option in SAP S/4HANA Cloud Public Edition. Please note that this
derivation will only update ACDOCA. There is no validation as these fields aren’t filled manually.
As of SAP S/4HANA 2020 a substitution of these custom field values is also possible in the GGB1 transaction with FI
callup point 2 (BSEG) in SAP S/4HANA (On-Premise) and the Manage Substitution/Validation Rules app (F4406, event
Journal Entry Item) or the FIN_ACDOC_ITEM_SUBSTITUTION enhancement option in SAP S/4HANA Cloud Public
Edition. These derivations affects BSEG, ACCIT, and ACDOCA.
In SAP S/4HANA (On-Premise), the CO-PA derivation tool (KEDR transaction) can be used for both "classic" CO-PA
custom characteristic values and custom fields created using the Market Segment business context. In SAP S/4HANA
Cloud Public Edition, rules created using the Manage Substitution and Validation Rules Fiori app or the
FINS_MARKET_SEGMENT_SUB enhancement option can be used to derive values for custom fields
Document Splitting (S/4HANA (On-Premise) and S/4HANA Finance only)
Values for custom fields added using the “classic”Coding Block, the Coding Block business context, "classic" CO-PA
custom characteristics, and the Market Segment business context values are entered or derived before G/L document
splitting. “Classic” Coding Block fields can be used as split criteria for the G/L document split.
Values for custom fields added using the Journal Entry Item business context may be derived after G/L document
splitting and cannot be used as split criteria.
Document Summarization
You might want to use summarization (OBCY or OBCYX transaction) to clear custom fields in BSEG that are needed in
ACDOCA only. Note 3103680 describes the necessary steps. Note that as of SAP S/4HANA 2020, not only Coding
Block custom fields but also Journal Entry Item custom fields are added to BSEG.
Ledger-Specific Derivation
Values for custom fields added using the “classic” Coding Block, the Coding Block business context, "classic" CO-PA
custom characteristics, and the Market Segment business context are populated to all ledgers posted.
Values for custom fields added using the Journal Entry Item business context can be derived specifically for each ledger
if needed. You do this in your implementation of the BADI_FINS_ACDOC_POSTING_EVENTS Business Add-In (On-
Premise) or the FIN_ACDOC_EXT_SUBSTITUTION enhancement option (Cloud).
Allocation / Assessment / Distribution
G/L assessments and distributions in SAP S/4HANA (On-Premise) support custom fields using the "classic" Coding
Block, the Coding Block business context, and the Journal Entry Item business context. To enable a custom field in G/L
assessments or distributions, use the GLGCA1 or GLGCA6 transaction. These transactions are not available in SAP
S/4HANA Cloud Public Edition.
CO-OM allocations do not support custom fields.
CO-PA allocations support custom fields using the "classic" CO-PA custom characteristics and the Market Segment
business context.
For the Coding Block and Journal Entry Item business contexts, custom field values are automatically copied from
sender to receiver items by cost center and profit center allocations
For the Market Segment business context, custom fields can be used as receivers in allocations for margin analysis
(Cloud and On-Premise). The same behavior is possible for "classic" CO-PA custom characteristics but only for SAP
S/4HANA (On-Premise).
Group Reporting
Custom fields of the Coding Block business context can be used in Group Reporting by enabling the Accounting: Coding
Block to Consolidation Journal Entry business scenario in the Custom Fields and Custom Logic apps. For SAP S/4HANA
(On-Premise), this is also possible for custom fields created with the “classic” Coding Block extensibility (OXK3 transaction)
once they are enabled in the SCFD_EUI transaction. If such a "classic" Coding Block custom field refers to a check table in
CI_COBL, however, the Accounting: Coding Block to Consolidation Journal Entry business scenario must not be used. A
CI_COBL custom field added to the Group Reporting table ACDOCU through the business scenario would not refer to a check
table and no data validation would take place, for example, in flexible upload. In this case, proceed as follows to get a
CI_COBL custom field with check table into the Group Reporting table ACDOCU:
Create an append structure to CJE_S_INCL_EEW_PS in transaction SE11.
Add the field with a name different from the name used in CI_COBL, for example, with an additional suffix. If you chose
the same field name, SCFD_EUI would refuse to link the two fields.
Maintain the same check table as in CI_COBL for the field.
Use transaction SCFD_EUI for table ACDOCU to enable the field. Here you choose the option “Attach Field to Existing
Custom Field” to attach it to the Coding Block custom field.
These steps are needed for "classic" Coding Block custom fields with check table only. In case of domain fixed values or if the Coding Block custom field was
created in the Custom Fields and Custom Logic apps, you can just enable the Accounting: Coding Block to Consolidation Journal Entry business scenario.

In case you have configured Integration with Group Reporting Preparation Ledger (see https://help.sap.com/S4_OP_FIN >
Accounting and Financial Close > Group Reporting (FIN-CS) > Focus Topics), you have the possibility to additionally transfer
custom fields, which have been added to ACDOCA by using the Journal Entry Item business context or the Market Segment
business context, to the Group Reporting table ACDOCU. More information on how to configure this can be found at
https://help.sap.com/S4_OP_FIN > Accounting and Financial Close > Group Reporting (FIN-CS) > Data Preparation > Data
Monitor > Release Universal Journals > Release of Universal Journals with Preparation Ledger Integration > Release
Universal Journals for Nonstandard Group Journal Entry Fields.
Central Finance
Coding Block business context and Classic Coding Block: Custom fields are transferred to the Central Finance system for FI
and CO documents
Journal Entry Item business context: Custom fields are transferred to the Central Finance system only for FI documents, not
for CO documents
In case of different technical naming for same business purpose in source system and Central Finance system a technical field
mapping has to be implemented.
Limitations for custom fields of type amount, quantity or number
In most applications, custom fields of type amount (datatype 'CURR'), quantity (datatype 'QUAN') or number (datatype
'DEC') are treated as characteristics, not as key figures. This can lead to unexpected system behavior. Here are some
examples:
The balance carry forward transaction FAGLGVTR in standard treats custom fields of
type amount, quantity and number as characteristics, which leads to multiple records with e.g. quantity 1, 2, 3... and not
to the total quantity being carried forward. If you want custom fields of type amount and quantity to be treated as key
figures, please have a look at modification note 2978607 (please note that custom fields of type number will then still be
treated as as characteristics).
In document splitting, the full amounts and quantities of custom fields are copied to each split line.
Example for customer defined quantity field ACDOCA-ZZQUAN: A customer item with ACDOCA-ZZQUAN = '100'
is split by two revenue items with a ratio of 60:40. The two resulting split customer items would then have both
ACDOCA-ZZQUAN = '100' (instead of one having 60 and the other 40) which is incorrect. This problem exists
normally only for balance sheet accounts because normally only they are split.
In theory you could correct split custom amounts and quantities in BADI_FINS_ACDOC_POSTING_EVENTS
or FIN_ACDOC_SUBSTITUTION, but this requires rather complex coding.
In ACDOCA summarization/posting and automatic balance carry forward, custom fields of type number are treated
as characteristics and custom fields of type amount and quantity are aggregated as key figures. If you want to change
this behavior, please proceed as described in note 3018427.
In document cancellation, the custom field value is copied directly to the cancellation document, in contrast to standard
amounts and quantities that are inverted. You can implement BADI_FINS_ACDOC_POSTING_EVENTS
or FIN_ACDOC_SUBSTITUTION to invert a custom amount, quantity or number if needed.
These are some examples only. In general, you can use custom amount and quantity fields as additional information on line
item level only. In CDS-based analytics, values for custom amount and quantity fields are aggregated, so here you get a key
figure behavior. But in other applications, this is not the case and the result can be unexpected.
Use of BSEG/ACCIT standard fields in ACDOCA
The ACDOCA table doesn’t contain all fields from the BSEG table or the ACCIT accounting interface structure, as many of
these fields are relevant for Financial Operations only and not in general needed in G/L Accounting, Management
Accounting, or Profitability Analysis.
If you require such a field in the ACDOCA table, use the Journal Entry Item business context to add a custom field to the
ACDOCA table and fill the value of this custom field in your implementation of
the BADI_FINS_ACDOC_POSTING_EVENTS Business Add-In or in the FIN_ACDOC_EXT_SUBSTITUTION enhancement
option. The following code snippet shows an example implementation of BADI_FINS_ACDOC_POSTING_EVENTS to fill a
YY1_XREF3_JEI custom field from the XREF3 standard field:
Option 1:
********
METHOD if_badi_fins_acdoc_post_events~subst_acdoca_extension_fields.
LOOP AT it_acdoc REFERENCE INTO DATA(lr_acdoc).
* Lookup the corresponding item in IT_ACDOC_ITEM to access fields not available in ACDOCA, in this case XREF3
READ TABLE it_acdoc_item REFERENCE INTO DATA(lr_acdoc_item)
WITH KEY rldnr = lr_acdoc->rldnr
bukrs = lr_acdoc->rbukrs
gjahr = lr_acdoc->gjahr
belnr = lr_acdoc->belnr
buzei = lr_acdoc->buzei.
CHECK sy-subrc = 0.
CHECK lr_acdoc_item->xref3 IS NOT INITIAL.
APPEND INITIAL LINE TO et_acdoc_subst ASSIGNING FIELD-SYMBOL(<ls_subst>).
* Fill ET_ACDOC_SUBST key fields from IT_ACDOC so the custom fields are filled for the correct item
MOVE-CORRESPONDING lr_acdoc->* TO <ls_subst>.
* Substitute customer defined field within structure incl_eew_acdoc
<ls_subst>-yy1_xref3_jei = lr_acdoc_item->xref3.
ENDLOOP.
ENDMETHOD.
*****
Please note that in option 1 in the coding mentioned above the runtimes might be very high for big data volumes and the
correct access to split data in it_acdoc_item (e.g. to r_origin_accit)
is not possible since the correct link between it_acdoc and it_acdoc_item is missing.
Therefore we recommend implementing technical prerequisite Note 2827405 and using the following coding instead:
Option 2:
********
METHOD if_badi_fins_acdoc_post_events~subst_acdoca_extension_fields.
loop at it_acdoc reference into data(lr_acdoc).

* Lookup the corresponding item in IT_ACDOC_ITEM to access fields not available in ACDOCA, in this case XREF3
read table it_acdoc_item reference into data(lr_acdoc_item)
WITH KEY ACDOCA_KEY COMPONENTS
rldnr = lr_acdoc->rldnr
bukrs = lr_acdoc->rbukrs
gjahr = lr_acdoc->gjahr
belnr = lr_acdoc->belnr
buzei = lr_acdoc->buzei
docln = lr_acdoc->docln.
check sy-subrc = 0.
check lr_acdoc_item->xref3 is not initial.
append initial line to et_acdoc_subst assigning field-symbol(<ls_subst>).

* Fill ET_ACDOC_SUBST key fields from IT_ACDOC so the custom fields are filled for the correct item
move-corresponding lr_acdoc->* to <ls_subst>.

* Substitute customer defined field within structure incl_eew_acdoc


<ls_subst>-yy1_xref3_jei = lr_acdoc_item->xref3.

endloop.
ENDMETHOD.
*****
With Note 2827405, the lines in it_acdoc and it_acdoc_item are also linked via temporary DOCLN to retrieve also split data
(e.g. in r_origin_accit) in it_acdoc_item.
Furthermore it_acdoc_item has also a secondary key ACDOCA_KEY with the following fields:
RLDNR BUKRS GJAHR BELNR BUZEI DOCLN
Via this secondary key the data in it_acdoc_item can be found very quickly.
Note that the access to it_acdoc_item via a simple READ with bukrs gjahr belnr buzei (without secondary key ACDOCA_KEY,
mentioned in option 1) still works if Note 2827405 is implemented (for example, by support package), but might be slow for
huge data volumes as already mentioned in option 1.
Attributes
Key Value

Other Components AC - Accounting > Coding Block (AC-COB)

Other Components Controlling > Profitability Analysis (CO-PA)

Other Components Controlling > Overhead Cost Controlling (CO-OM)

Software Components
Software Component From To And subsequent

SAP_FIN 720 720 X

SAP_FIN 730 730 X

SAPSCORE 110 110 X

S4CORE 100 100 X

S4CORE 101 101 X

S4CORE 102 102 X

S4CORE 103 103 X

S4CORE 104 104 X

S4CORE 105 105 X

S4CORE 106 106 X

S4CORE 107 107 X

S4CORE 108 108 X

This document refers to


SAP Component Title
Note/KBA

3103680 FI-GL-GL-J How to activate summarization of customer fields in BSEG

3005736 CO-PA User-defined fields/characteristics in business context "Accounting: Market Segment" in SAP
S/4HANA

2827405 FI-GL-GL BADI_FINS_ACDOC_POSTING_EVENTS: Performance problems / No access to split data in


it_acdoc_item

2819508 CO-PA-MD Custom fields in Realignment Results App

2462725 FI-SL-VSR FAQ: Validation and Substitution for Journal Entries in S/4 HANA Cloud

This document is referenced by


SAP Component Title
Note/KBA

3076579 Runtime Errors SAPSQL_PARSE_ERROR in ABAP Program


CL_FINS_GET_BSEG==============CP

2928190 FI-GL-GL-G FAGL_YEC_POSTINGS_EHP4 - include the ZZ customer fields

2880462 BC-SRV-APS- Error enabling Custom Field for Accounting: Coding Block
EXT-FLD

2714344 FIN-MIG Financial data migration to SAP S/4HANA: Most frequent Error Messages – Information and
Recommendations

2750969 CO-PA-ACT S/4H: User defined characteristic picked from COBL is not filled in ACDOCA / is not filled in the
profitability segment

2628881 FI-FIO-GL Add extended fields as carry forward dimension and further display them in app Carry Forward
Balances

3293485 CO-PA-2CL Customer fields in coding block and FI SAP Fiori apps
3291346 FI-GL-GL ACDOCA-ZUONR is initial for BSTAT = 'U' documents

3120758 CO-FIO-OM-PL Extensibility Option for CO-PA fields in S/4HANA Finance Planning

3116807 CO-FIO-OM-PL SAC Write Back API_FINANCIALPLANDATA_SRV does not store values of new created
extensibility fields and of standard field Segment

3071445 CO-FIO-PA Migrate Custom Characteristics from the Product Profitability app (W0053) to the Product
Profitability with Production Variances app (W0182)

3005736 CO-PA User-defined fields/characteristics in business context "Accounting: Market Segment" in SAP
S/4HANA

2904313 FI-GL FI-Substitution ( Line Item) for processes having BSTAT = 'U'

2842890 FI-GL FAQ SAP S/4HANA Finance

2490888 FIN-RTC Enhance ACDOCC to Support End-User Extension

You might also like