SAP Knowledge Base Article - Public

3491508 - How to add the custom fields in payload for Journal Entry API - SAP HANA Cloud?

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

Resolution

  1. 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 



  2. Custom fields in payload must have the custom field namespace prefix
    For example, <yy1:YY1_CFINAccNumCOB>Test</yy1:YY1_CFINAccNumCOB>

  3. 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> 

  4. 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

SAP Blog:Extensibility _how to implement Custom Fields using Coding Block business context in SAP S/4HANA Cloud 

SAP Blog: Guidelines for Creating and Enabling Extension Field for Journal Entry API 

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 , KBA , AC-INT-2CL , Accounting Interface (Public Cloud) , Problem

Product

SAP S/4HANA Cloud Public Edition all versions ; SAP S/4HANA Cloud all versions