Implementing Automatic Account Determination with a Custom Field
The objective of this blog is to provide a step-by-step explanation how to extend the automatic account determination in SAP S/4HANA Cloud with a custom field. First, I will describe the use case and its requirements. Second, I will explain how to setup the custom field. Third, I will explain how to include the custom field into the automatic account determination configuration.
Automatic account determination provides the functionality to retrieve specific G/L accounts for financial postings based on a rule-based framework. For example, automatic account determination for the area of Sales allows to direct revenues from billing to specific G/L accounts based on attributes related to the customer master or the material master data.
The use case: categorize revenues
The use case for this scenario is to categorize revenues and direct them to different G/L accounts. In my specific project, I wanted to implement different revenue categories in customer projects on the level of the billing item. In other words, within one customer project in professional services the revenue from one billing item should go to a different G/L account than the revenue from another billing item. In my project, we had four different revenue categories. For the purpose of this blog, let us use two categories as an example and let us call them Consulting and IT Services. Throughout this blog, I will describe how to implement the custom field on the billing item and how to include the custom field into automatic account determination.
Part 1: Setting up the custom field
The first step of this implementation is to create a custom field within the app custom fields and logic. For this example, we use the type code list and add the two categories Consulting and IT Services to the list. We require a couple of business scenarios and business contexts here to use the field the intended way. The activated business scenarios in my case were:
- Billing Document to Account Determination on Item Level
- Sales Order Item to Billing Document Item for Project Billing
- Sales Order Item to Billing Document Header for Project Billing
- Sales Order Header to Billing Document Header for Project Billing
- Sales Order Header to Billing Document Item for Project Billing
Activating these scenarios results in 6 business contexts for the custom field. Among these are the project billing element, the sales document item, the billing document item, and the account determination item.
The field should then be visible on the billing tab in the app Plan Customer Projects. It might be necessary to show the field by clicking on the settings wheel next to the button Create Billing Item. By using the value help or by typing directly into the field, it is now possible to maintain the revenue category on billing item level. This information is carried over to the subsequent billing documents and available within automatic account determination because we selected the business scenarios.
When the field is visible on the billing tab, we can test whether it is carried over to the billing document by creating a billing document request. We then convert the billing document request to a billing document using the app Create Billing Documents. Within the app Change Billing Documents we can review the field in the item details screen.
Part 2: Configuring automatic account determination
Including the custom field into automatic account determination involves a sequence of configuration activities. First, the new custom field needs to be included in the field catalog for account determination. Second, it is necessary to create a new condition table. Third, this condition table is included in a new access sequence. Fourth, the new access sequence is activated for account determination. Finally, account determination rules can be maintained that include the new field.
Let us have a look at the configuration activities step by step. First, the configuration activity Change Field Catalog for Condition Tables (ID: 103046) is used to add the custom field. By clicking on New Entries we can search for the custom field. In this example, the field is called YY1_REVENUECATEGORY_ADI where the extension ADI is added automatically by the system.
Next, we create a new condition table. For this the configuration activity Create Condition Tables for Revenue Account Determination (ID: 103044) is used. By selecting fields from the field catalog on right right, they are included in the new condition table.
After we have created the condition table, we need to include the new condition table in a new custom access sequence. For this we use the configuration activity Define Access Sequences for revenue Account Determination (ID: 102400). We can copy one of the standard access sequences such as KOFI by clicking on Copy As.
We choose a name such as YKOF. We can then insert the condition table that we created in the previous step in the new access sequence. We do that by selecting YKOF and double clicking on Accesses in the left panel. We then choose the option New Entries and add in the name of the access sequence 501 created in the previous step. We can change the order by which the system runs through the access sequences to look for determination rules by choosing a number in the first column.
We have now created a new access sequence that is available for account determination. The last step before we can maintain determination rules is to activate the new access sequence. We can do this in the configuration activity Define Account Determination Types (ID: 102175). When we open the configuration activity we will find the standard access sequence KOFI maintained for Account Determination with condition type KOFI (this is usually line 1). To activate the new access sequence, we can change the value maintained in the column access sequence to YKOF.
Finally, we can now maintain account determination rules that include the custom field. For this we use the configuration activity Automatic Account Determination (ID: 100297). We choose the area Sales, then the subarea Sales Billing, and then process Assign G/L Accounts. In step 2, we choose our chart of accounts, select the application V for Sales / Distribution and then select 501 for the condition table. This is the new condition table that we created and inserted in the access sequence. It contains our custom field. We are then able to maintain account determination rules.
Part 3: Testing and next steps
Before we roll out the new account determination to the productive system, we should thoroughly test the system behavior and whether the rules we maintained work as expected. To do so, we can create test customer projects and maintain different revenue categories on the billing items. When we create billing documents, the respective G/L account that we maintained in the determination rules should be retrieved that corresponds to the revenue category.
One additional tip from working with this configuration in practice: While we are still testing we want to prevent that the changes are transported to the productive system. However, other transports might be necessary while the configuration is not complete yet or not fully tested. In this case, we can “switch-off” the new access sequence in the configuration activity Define Account Determination Types (ID: 102175). We can switch the access sequence back to KOFI there.
The rollout and the transport of the new determination rules to production should be carefully planned. Only future postings are directed to the new G/L accounts. Hence, it makes sense to time the activation with a new financial year or at least with a new fiscal period.
We can extend the functionality of the automatic account determination in SAP S/4HANA Cloud with a custom field. This blog explained how to extend account determination for the use case to categorize revenues with a custom field. First, we create the custom field and activate the required business contexts. Then we add the custom field to a new condition table and insert the table into a new access sequence. When the new determination rules are working as expected, we can transport the changes to the productive landscape.
Please use the comment section below if you have any comments or thoughts about this topic. To always stay up to date you can follow my profile and the community tag “SAP S/4HANA Cloud” or the tag “SAP S/4HANA Cloud for Professional Services”.