Symptom
Custom fields have been created and enabled the in the structure of Journal Entry - Post API and Fiori App Manage Journal Entries following blog Guidelines for Creating and Enabling Extension Field for Journal Entry API
However, there are no values in custom fields in the posted journal entry. How to add the custom fields in payload correctly when using API like Journal Entry - Post?
"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental."
Environment
SAP S/4HANA Cloud Public Edition
Resolution
- Download the WSDL/Service Metadata from app Communication Arrangement to ensure correct Envelope xmlns used.
For example, it should be like:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sfin="http://sap.com/xi/SAPSCORE/SFIN" xmlns:yy1="http://SAPCustomFields.com/YY1_">
The XML Namespace is determined in app Custom Field and Logic -> SOAP APIs - Custom fields in payload must have the custom field namespace prefix
For example, <yy1:YY1_CFINAccNumCOB>Test</yy1:YY1_CFINAccNumCOB> - Custom fields are case-sensitive. Make sure to use the exact definition from the "Field Name" in the app Custom Field and Logic, as shown in the above screenshot.
For example, <yy1:YY1_CFINACCNUMCOB>Test</yy1:YY1_CFINACCNUMCOB> is incorrect; the correct format is YY1_CFINAccNumCOB - Add the custom field to right service nodes of the payload
The Business Context determines in which part the data will appear on the screen. There are three ways in this case:
- Accounting: Coding Block
- Accounting: Journal Entry Item
- Accounting: Market Segment – customer related data
If the Business Context of custom field is Coding block, add the custom field into service node <AccountAssignment>
If the Business Context of custom field is Journal Entry Item, add the custom field into service nodes <Item>, <DebtorItem>, <CreditorItem> or <ProductTaxItem>
If the Business Context of custom field is Market Segment, add the custom field to service node <ProfitabilitySupplement>
Example payload for adding custom field YY1_CFINAccNumCOB (Accounting: Coding Block) - After the journal entry posted successfully, the custom fields can be seen only when related User Interfaces enabled in following apps
Enable FAC_FINANCIAL_DOCUMENT_SRV_01 to see custom fields in app Manage Journal Entries - Old Version (F0717)
Enable UI_JOURNALENTRY_MANAGE to see custom fields in app MJE new app Manage Journal Entries - New Version (F0717A)
See Also
Keywords
Extension Field, Custom Field, Journal Entry API, Envelope, Xmlns, YY1_, yy1, Coding block, Journal Entry Item, Market Segment, FAC_FINANCIAL_DOCUMENT_SRV_01, UI_JOURNALENTRY_MANAGE, case-sensitive , KBA , AC-INT-2CL , Accounting Interface (Public Cloud) , Problem