How to determine the hierarchy of the billing documents generated in an SAP System using KTern?

Digital Maps Aug 9, 2023

Your organization would have been using SAP for the past several decades to run your business. It is the lifeline that holds your business together. As a result, you must have generated several orders and billing documents over the past several decades. These orders and bills are linked to one or several modules in SAP such as Sales and Distribution (SD), Material Management (MM), Production Planning (PP) etc.

Before moving from SAP ECC to S/4HANA, it is imperative to have a clear picture of the various bills generated, the currency in which they were created, the type of billing document and the company codes they are related to. Without this critical information and data, your organization cannot take important decisions like the most important company codes, the company codes to be archived etc. Besides, deciding on the most relevant organizational units and processes will help you during the test case scenarios and execution phase, business process optimization phase and in simplifying your business as a whole.

In the previous articles, we explained how you can unearth your enterprise structure in SAP Sales and Distribution (SD), SAP Material Management (MM)modules using KTern. We also explained how KTern can provide the hierarchy of the orders generated. In addition, KTern’s “Enterprise Structure Mining – Billing Documents Generation” can provide the hierarchy of the various types of bills generated in an SAP system. You can gain several crucial insights by mapping the bills to the company codes and users. This will help you to re-engineer your business processes accordingly. We’ll explain precisely that in this article.

Table of Contents

Types of billing documents in an SAP system

Billing documents contain billing related information for one or more business transactions. They are created as a result of the billing process and are sent to the customers in physical or electronic format. A billing document is always linked to one or more preceding transactions. The preceding documents are listed in the transaction history. You can also create follow-up transactions to a billing document.

There are several types of billing documents that can be created in an SAP system. They are:

  1. Order related billing document
  2. Order related billing document for rebate settlement
  3. Order related billing document for partial rebate settlement
  4. Periodic billing document
  5. Periodic billing with active invoice accrual
  6. Accrual
  7. Delivery related billing document for inter-company billing
  8. Order related billing document for rebate connection
  9. Delivery related billing document
  10. Down payment request
  11. Invoice list
  12. Billing request
  13. POS billing document
  14. Billing using general interface
  15. CRM billing document

How can KTern help your Business by unearthing the bills generated?

So far, we have discussed only the types of bills that can be created in an SAP landscape. But, when you plan your move from SAP ECC to SAP S/4HANA, it is necessary to have a clear picture of your bills generated and the type of those bills. This is a tedious task and involves a lot of manual effort. Now, we will discuss how KTern automates this process and gives a comprehensive overview, thus helping the transition process.

KTern covers the Enterprise Structure Mining feature in the Discover phase of the Activate methodology (before the conversion) and is part of the Impact Analysis module.

KTern is an all-in-one product suite built for SAP Digital Transformations. With decades worth of SAP Tribal knowledge combined with automation, governance and collaboration capabilities, KTern is built to help the existing ECC customers migrate to S/4HANA before 2025. KTern covers the entire lifecycle and guides you before, during and after the conversion.

Overview of Enterprise Structure Mining

Enterprise structure mining is a process of analyzing and extracting valuable information from the complex enterprise data structures of an organization. This process can be used to uncover hidden relationships and patterns in the data, providing organizations with valuable insights into their operations.

Enterprise structure mining can be applied to various types of data such as financial, sales, or customer data, as well as data from different systems such as ERP, CRM, and other business-critical systems.

There are several methods and techniques used in enterprise structure mining, including data visualization, data clustering, association rule mining, and predictive modeling. These techniques can be used to uncover patterns in the data, identify areas for improvement, and make better decisions.

Some of the benefits of enterprise structure mining include:

  • Improved business intelligence
  • Increased efficiency
  • Better customer understanding
  • Reduced costs
  • Better forecasting

The Objective of Enterprise Structure Mining – Billing Documents Generation

As discussed above, an SAP system contains several types of bills associated with various company codes. They would have been generated over the past several years of using SAP. The main purpose of Enterprise Structure Mining before moving S/4HANA is to find out the relevant and active company codes, the types & number of bills generated in each company code, and the user who generated the billing document.

Most of these enterprise units and generated bills would have been created long back and the documentation might not be relevant today. The organizational units might have gone through several changes since the last update. And the ageing workforce of SAP does not make the situation any better.

It is necessary to give proper training and handover to the millennial workforce. However, with the disparate information and inconsistent documentation, it is not always possible. KTern can help you here by continuous monitoring and providing materiality of where the consultants should focus.

Mostly this information or knowledge is with a privileged few or in the System Integrator's privy. KTern helps you to unearth the various bills generated and provides the information in an easy-to-consume format, thus eliminating the grunt work and the chaos involved.

The findings from this tool, KTern, will help you determine the most useful/most used organizational units with respect to the bills generated. Such insights can and will help you in your business process re-engineering. Therefore, business stakeholders will have better clarity and can make data-driven decisions with confidence.

Features of Enterprise Structure Mining – Billing Documents Generation

Typically, in most S/4HANA assessments, as the first step, organizations aim to find out the enterprise structure in SAP and drill down the hierarchy of each functional module. They find out answers to questions like – How many company codes are present in the system? What are the most used company codes? How many billing documents were generated? Which user created the highest number of billing documents? Which type of billing document was the most generated? In which currency was the most number of billing documents generated? And much more.

Finding out answers to these questions is a very manual task. Many functional consultants are deployed for this purpose. The functional consultants then go through each T-Code, table and report to map the hierarchy of the enterprise structure in SAP and find out the complexity of the system. Sounds tiring, right? But this step is mandatory and cannot be skipped.

Selecting a configuration where the sizing characteristic of the moment matches the top of the performance range will leave enough room for subsequent iterative sizing changes without forcing a premature hardware replacement. Although this has a direct negative impact on total cost of ownership in the short term, it may be the right decision for the long term, as there will be enough capacity for future increases in workload.

As seen in the above picture, KTern’s Enterprise Structure Mining feature drills down the various company codes present in an SAP Landscape. It drills down the company codes, currency, the user who created the document and the type & number of billing documents generated.

In this way, KTern provides a clear hierarchy and evidently maps the orders generated with its functional module.

The hierarchy is as follows:

Company Code -> Currency -> Created by user -> Type and number of billing documents

KTern can automate this task and provide the hierarchy in just a span of a few minutes.

Advantages of Enterprise Structure Mining

An important feature of KTern’s Enterprise Structure Mining is that you can sort and search the company codes, purchasing organizations, purchasing groups, plant, storage location, and the number of purchase documents.

This enables you to determine the most active company codes, purchasing organizations and so on.


If only two purchase documents are generated for the past 5 years in one of the plants, then it can be inferred that that particular plant is not active. After taking a call with the business stakeholders, you need not move that particular plant to S/4HANA.

KTern's Observations helps the MM functional consultants, business stakeholders from both the System Integrator side and the customer side, and the Solution Architects to have a clear picture of the landscape and take better data-driven decisions.


KTern also provides the option of downloading this report. In addition, you can also post it in the forum, assign stakeholders and collaborate. You can upload the files in KTern and subsequently use it any other stage of the system conversion process. Thus, KTern provides a platform to join forces and work together in determining the relevant enterprise structures in SAP and plan the path to S/4HANA.

Pre-Go-Live Check

One more important use case of this feature is that you that perform a pre-Go-Live check in a greenfield implementation. In a greenfield implementation, the customer usually provides the configuration requirement. The System Integrator then maps the enterprise structure according to the configuration and tests them accordingly. Enterprise Structure Mining feature of KTern can be used to audit the configured landscape. This allows the customer to Go-Live with the system without any apprehensions.

How is KTern’s Enterprise Structure Mining different from that of its competitors?

Most of the organizations today do this task of mapping the enterprise structure in SAP manually. More often than not, they rely upon the consultants and business stakeholders to provide the right information. The reliability of such information can only be left to anyone’s imagination. However, there are few products in the market which aim to automate the process of Enterprise Structure mining. SNP and Celonis are some examples. However, they also do not go into the level of detail that KTern does. KTern provides both a visual and tabular representation of the enterprise structure in SAP which makes it easier to have clarity and make decisions.

The most important factor which makes an SAP HANA migration challenging is how HANA organizes the data within itself. The HANA database is columnar based, whereas the traditional RDBMS is row-based. The columnar database loads only the relevant columns making it faster than the traditional database. And, SAP HANA shrinks the data footprint, but requires high CPU and memory.

Enterprise Mining - KTern.AI

KTern also provides additional insights such as the most used company codes, the least used company codes, the company code with most and least billing documents generated etc. All the above insights combined with the productivity and collaboration features make KTern a leader in the market when it comes to SAP Digital Transformations.

Next Steps

Now that you know how to automate the Enterprise Structure Mining using KTern, you might want to get a first-hand feel of KTern and its other features which help automate and govern SAP projects from start to finish. You can get started with the same at Getting Started. Alternatively, if you would like a guided demo of the product from one of our product engineers, kindly get in touch with us by submitting a message at Contact Us.


Sabareesh S R

Helping organizations undergo smooth and effortless SAP Digital Transformation.