Financial Management Blogs by SAP
Get financial management insights from blog posts by SAP experts. Find and share tips on how to increase efficiency, reduce risk, and optimize working capital.
cancel
Showing results for 
Search instead for 
Did you mean: 
AngelikaHuber
Product and Topic Expert
Product and Topic Expert

You may have read our blog post Custom fields are now available for "Manage Customer Line Items" and "Manage Supplier Line Items", in which we introduced custom fields for the Manage Customer Line Items app and the Manage Supplier Line Items app. In this blog post, we’d like to give you a more detailed example and use case for custom fields.
Please note that at time of writing, this feature is only available in SAP S/4HANA Cloud Public Edition. 

Let’s assume you want to display profit center information in the Manage Customer Line Items app. As explained in our blog post on How to Display Profit Center Assignments for AR/AP Line Items, you may need this because the Manage Customer Line Items app usually shows exactly one line item per invoice, but revenue postings can be distributed over different profit centers. You would see this as separate line items in the Manage Journal Entries app.

In our example, you want to display the profit center with the highest amount in the Responsible Unit custom field in the Manage Customer Line Items app. To do so, you must simply follow this five-step procedure:

Step 1: Create a custom field

You open the Custom Fields app and create the Responsible Unit custom field in the Accounting: Journal Entry Item business context.
The following screenshot shows the dialog box in which you enter your details to create the custom field:

CustomFields_CreateResponsibleUnit.png


Step 2: Enable field usage

You then enable the field for the Manage Customer Line Items app and publish your custom field. For more information, see How to Enable Custom Fields.
The following screenshot shows the search result for Customer Line Item on the User Interface tab. The Enable Usage column is highlighted.

CustomFields_EnableResponsibleUnitField.png

 

The following screenshot shows that the field usage has been enabled in the OData service and the related usage in the relevant CDS view:

CustomFields_EnableResponsibleUnitField02.png


The custom field has now been defined and is available in the
Manage Customer Line Items app. The following screenshot shows the field in the Settings dialog box.

CustomFields_ShowResponsibleUnitFieldInMCLI.png


Step 3: Create and publish the custom logic to fill the Responsible Unit custom field

To set a value in the newly-created custom field, you can implement a custom logic that determines a value for the custom field.
To do so, you open the Custom Logic app to create your implementation of the Journal Entry Substitution (FIN_ACDOC_SUBSTITUTION) extension point. For more information, see Creating Implementations.
The following screenshot shows the extension point search result:


CustomFields_ExtensionPointCustomLogic.png


Step 4: Write custom code

Once you’ve published the implementation, you can write your custom code.
The following code snippet gives you an idea of how you can define which data you want to display in your Responsible Unit custom field in the Manage Customer Line Items app. Note that this code snippet is for demonstration purposes only.
In our example, you want to display the profit center from the G/L line item that has the amount.

CustomFields_CodeSnippet.png

Step 5: Test custom field in the Manage Customer Line Items app

This new custom logic is applied to all new and changed items only. To test the custom logic, simply select an existing line item, use the Edit Line Item function, and change the item.

CustomFields_ResponsibleUnitField_Filled_in_MCLI.png


Thanks for reading this blog post. We hope that it gave you an idea of how you can use custom fields to enhance the Manage Customer Line Items app. The same is possible for the Manage Supplier Line Items app, too.
Feel free to leave any comments you may have below.

For more information about the apps, see:
Manage Customer Line Items
Manage Supplier Line Items

3 Comments