Extensibility _how to implement Custom Fields using Coding Block business context in SAP S/4HANA Cloud
2023-11-22 17:2:8 Author: blogs.sap.com(查看原文) 阅读量:59 收藏

Co-Authored by Take Zhou

Motivation

Figure%20%231%3A%20Extensibility%20Options

Figure #1: Extensibility Options

Currently SAP S/4HANA Cloud offers several extensibility options as shown in figure #1:

  • Key user Extensibility
  • Developer Extensibility
  • Side-By-Side Extensibility

However, based on the analysis of customer incidents raised to SAP, it has been observed that 10% of the incidents related to General Ledger are still associated with extensibility, particularly concerning Custom Fields, Custom Logic and RAP Service. Meaning that the technical key users still face challenges on how to apply extensibility in General Ledger Accounting. This blog aims to assist technical key users in implementing custom fields using the Coding Block business context for the following SAP Fiori Apps:

  • Post General Journal Entries
  • Upload General Journal Entries
  • Verify General Journal Entries
  • Manage Journal Entries

Before we explore this topic in depth, let’s take a look at the overview of custom fields in General Ledger Accounting.

Overview of Custom Fields in General Ledger Accounting

Figure%20%232%3A%20Overview%20of%20Custom%20Fields

Figure #2: Overview of Custom Fields in General Ledger Accounting

The extensibility options for adding new Custom Fields in General Ledger Accounting include three types of business contexts: Coding Block, Market Segment, and Journal Entry Item. Coding Block and Journal Entry Item are used for adding custom fields to Journal Entries in different purposes. For more detailed information on how to use the Coding Block and JEI, please refer to Coding Block & JEI.

It’s important to note that the values for custom fields using the Journal Entry Item business context cannot be manually entered, particularly in analytical queries. On the other hand, a custom field added using the Coding Block business context is not only included in the Journal Entry but also in related business objects outside of Finance, such as the procurement process, as shown in figure #2. Meaning that the Coding Block will carry forward the value entered in custom fields under account assignment from a purchase order to subsequent processes. This allows for seamless integration and consistent data across different business workflows.

Please note that Coding Block custom fields are only applicable to G/L account line items, but not relevant for asset accounting or items in accounts receivable or accounts payable. Additionally, the number of custom fields that can be added using the Coding Block business context is limited to 20 fields with a maximum total of 400 characters. The type of custom fields in the Coding Block business context is limited to CHAR and NUMC data types only.

To enhance Margin Analysis in Sales Accounting, custom fields can be added by using the Accounting: Market Segment business context. Please kindly refer to Market Segment for more detailed information.

Add a new Custom Business Objects_ Optional

If you wish to choose the Association to Business Object as the type while creating your custom code, but there is no existing standard business object available, it is necessary to add a new Custom Business Object. The advantage of utilizing a Custom Business Object is as follows:

  • The value maintenance is tailored to the business needs and can be easily adjusted using an automated User Interface anytime.
  • The value entered in a custom field will go through validation process, and in case of an incorrect value, an error message will be displayed.
  • Instead of manually inputting values, time and effort can be saved by selecting values from a pre-defined list.

The SAP Fiori App Custom Business Objects is used for adding a new Custom Business Object. The key steps involved in this process are as follows:

  • Open Fiori App Custom Business Objects using the standard user Extensibility Specialist.
  • Create a new business object by clicking on the New button.
  • Provide a Name for the Business Object.
  • Under General Information tab, select the necessary features such as User Interface, Back End Service, Can be Associated, System Administration Data and so on.
  • Navigate to Fields tab to add the required fields to the business objects.
  • Publish the Custom Business Object, once the necessary fields are added.
  • If User Interface option is selected during creation, the User Interface will be automatically generated after publishing the Business Object.
  • Access the generated User Interface by clicking on the Go To Generated UI link in published business object, This will allow you to maintain the value/data in the business objects, which can be selected in Custom Field.

For more comprehensive understanding, please kindly refer to the following demo on how to add a new Custom Business Object. This demo will provide detailed information and step-by-step instructions on how to successfully complete the task.

Add a new Custom Field

Once the Business Object has been created or if there is an existing standard Business Object available, you can proceed to create a new Custom Field for the type of Association to Business Object with SAP Fiori App: Custom Fields and Logic.

  • Open Fiori App Custom Fields and Logic using the standard user Extensibility Specialist.
  • Click on the ‘+’ button to add a new Custom Field.
  • Select Business Context: FINS_CODING_BLOCK
  • Choose the Type for new field: Association to Business Object
  • Business Context Capacity indicates the percentage of capacity available for the Business Context. Please note that maximal number of Coding Block is 20. It is not possible to add a Custom Field if the Business Context Capacity exceeds 100%,
  • Select either your Custom Business Object or a Standard Business Object
  • Enable the OData Service to activate the usage for the relevant SAP Fiori Applications via User Interfaces > Services by clicking on Enable Usage in column Action (e.g., Post General Journal Entries, Manage General Journal Entries)
  • Publish the Custom field.

Please kindly refer to the following system demo for a detailed demonstration on how to add a new Custom Fields using Coding Block business context for General Ledger Accounting.

Post General Journal Entries with Custom Field

Once a new Custom Field has been enabled in the OData Service for SAP Fiori App Post General Journal Entries and successfully published, it becomes visible and ready to be utilized in the SAP Fiori App Post General Journal Entries. To understand how to manually input a value for Custom Field in the Journal Entry Line Item using SAP Fiori App Post General Journal Entries, please kindly refer to the following demo. Additionally, the standard SAP user GL_Accountant is used in the Demo.

Upload General Journal Entries with Custom Field

If the Custom Field is enabled in the OData Service for SAP Fiori App Post General Journal Entries and successfully published, you can also use Upload General Journal Entries app to upload Custom Field Values for multiple Journal Entries using CSV or Excel. Please kindly refer to the following Demo on how to upload Custom Field Values for multiple Journal Entries using CSV or Excel. The Demo User is also standard SAP user GL_Accountant.

Enable Custom Fields for SOAP APIs

Furthermore, the Custom fields are accessible through the following SOAP APIs for utilization:

  • Journal Entry – Change (Asynchronous)
  • Journal Entry – Post (Synchronous/ Asynchronous)
  • Journal Entry by Ledger – Post (Asynchronous)

About how to enable the SOAP APIs for your Custom Field, please refer to the following Demo. The Demo User assigned is standard SAP user Extensibility Specialist.

Change the Value in Custom Fields via SOAP API

Once the Custom Field is activated for SOAP APIs (Journal Entry – Change, Journal Entry – Post…), the value for the Custom Field can be posted or changed via APIs. For detailed instructions on how to change the value of Custom Field using SOAP API, please kindly refer to the following Demo.

Additional Information

Additionally, SAP Note 2453614 FAQ: Universal Journal Extensibility provides the frequently asked questions and answers regarding Extensibility in General Ledger accounting. Moreover, for additional guidance on Custom Field, please kindly refer to the following:

For Custom Logic please kindly refer to the following SAP Online Help.

For RAP service, please refer to the following online help and blog.


文章来源: https://blogs.sap.com/2023/11/22/extensibility-_how-to-implement-custom-fields-using-coding-block-business-context-in-sap-s-4hana-cloud/
如有侵权请联系:admin#unsafe.sh