Skip to content
NextLytics
Megamenü_2023_Über-uns

Shaping Business Intelligence

Whether clever add-on products for SAP BI, development of meaningful dashboards or implementation of AI-based applications - we shape the future of Business Intelligence together with you. 

Megamenü_2023_Über-uns_1

About us

As a partner with deep process know-how, knowledge of the latest SAP technologies as well as high social competence and many years of project experience, we shape the future of Business Intelligence in your company too.

Megamenü_2023_Methodik

Our Methodology

The mixture of classic waterfall model and agile methodology guarantees our projects a high level of efficiency and satisfaction on both sides. Learn more about our project approach.

Products
Megamenü_2023_NextTables

NextTables

Edit data in SAP BW out of the box: NextTables makes editing tables easier, faster and more intuitive, whether you use SAP BW on HANA, SAP S/4HANA or SAP BW 4/HANA.

Megamenü_2023_Connector

NextLytics Connectors

The increasing automation of processes requires the connectivity of IT systems. NextLytics Connectors allow you to connect your SAP ecosystem with various open-source technologies.

IT-Services
Megamenü_2023_Data-Science

Data Science & Engineering

Ready for the future? As a strong partner, we will support you in the design, implementation and optimization of your AI application.

Megamenü_2023_Planning

SAP Planning

We design new planning applications using SAP BPC Embedded, IP or SAC Planning which create added value for your company.

Megamenü_2023_Dashboarding

Dashboarding

We help you with our expertise to create meaningful dashboards based on Tableau, Power BI, SAP Analytics Cloud or SAP Lumira. 

Megamenü_2023_Data-Warehouse-1

SAP Data Warehouse

Are you planning a migration to SAP HANA? We show you the challenges and which advantages a migration provides.

Business Analytics
Megamenü_2023_Procurement

Procurement Analytics

Transparent and valid figures are important, especially in companies with a decentralized structure. SAP Procurement Analytics allows you to evaluate SAP ERP data in SAP BI.

Megamenü_2023_Reporting

SAP HR Reporting & Analytics

With our standard model for reporting from SAP HCM with SAP BW, you accelerate business activities and make data from various systems available centrally and validly.

Megamenü_2023_Dataquality

Data Quality Management

In times of Big Data and IoT, maintaining high data quality is of the utmost importance. With our Data Quality Management (DQM) solution, you always keep the overview.

Career
Megamenü_2023_Karriere-2b

Working at NextLytics

If you would like to work with pleasure and don't want to miss out on your professional and personal development, we are the right choice for you!

Megamenü_2023_Karriere-1

Senior

Time for a change? Take your next professional step and work with us to shape innovation and growth in an exciting business environment!

Megamenü_2023_Karriere-5

Junior

Enough of grey theory - time to get to know the colourful reality! Start your working life with us and enjoy your work with interesting projects.

Megamenü_2023_Karriere-4-1

Students

You don't just want to study theory, but also want to experience it in practice? Check out theory and practice with us and experience where the differences are made.

Megamenü_2023_Karriere-3

Jobs

You can find all open vacancies here. Look around and submit your application - we look forward to it! If there is no matching position, please send us your unsolicited application.

Blog
NextLytics Newsletter Teaser
Sign up now for our monthly newsletter!
Sign up for newsletter
 

Two options for error handling with SAP BW and SQLScript

SAP BW loading processes are often terminated due to incorrect data records. To avoid these terminations, appropriate error handling is useful. Basically, there are two ways to address error handling in SAP BW HANA systems. In this article, I will explain the individual scenarios in detail.

So the first thing you can do is to use the DTP Error Handling. Another approach would be to automatically correct the incorrect data records. In the first scenario, you can benefit from the automatic processes of a SAP system. However, flexible further processing is not possible in this case. The second scenario involves more development effort, but you can handle the incorrect data records more flexibly. For example, you can include automatic checks within transformation routines and make corrections.

In the following, I will first go into DTP error handling and explain how the error stack works. Then I will show you how to perform automatic corrections with SQLScript.

First scenario - DTP error handling and manual correction in the error stack

In the first scenario, we use the mechanisms of the DTP error handler. Here, we write the incorrect records into the error stack, where they can be corrected manually afterwards. 

Note that by default each transformation is executed in two iterations. First, the incorrect records are filtered out. Then the actual logic of the routine is applied to the remaining, correct data. 

Semantic grouping plays an important role in determining incorrect records. Thus, you can use the Extraction grouped by setting in the Extraction tab of the DTP to define fields that serve as keys for error handling. After an erroneous record has been identified, all records with the same key value are also moved to the error stack.

Define semantic group

In the following I explain the meaning of the semantic groups by means of an example. Let's consider the following table. This represents different orders, each of which contains several order items:

Order Order Item Record Type Amount
1337 10 F 48
1337 20 F 32
1338 10 L 74
1338 20   58
1338 30 L 20


In the purchase order with the number 1338, the record type is missing in position 20, which means that this record is considered to be incorrect:

Order Order Item Record Type Amount
1337 10 F 48
1337 20 F 32
1338 10 L 74
1338 20   58
1338 30 L 20


With the help of semantic grouping, the entire order can be marked as incorrect:

Order Order Item Record Type Amount
1337 10 F 48
1337 20 F 32
1338 10 L 74
1338 20   58
1338 30 L 20


These records are filtered out and written to the error stack:

Order Order Item Record Type Amount
1338 10 L 74
1338 20   58
1338 30 L 20


Then, in the second run, the actual logic of the routine is applied to the remaining records:

Order Order Item Record Type Amount
1337 10 F 48
1337 20 F 32


Error handling ensures that only the correct records are posted to the system. The inconsistent records can be corrected manually and posted using an error DTP.

The disadvantage of this scenario is that the data is processed twice, which can result in longer loading times. This is particularly significant for routines for individual fields, since the complete data is processed a second time. This means that the runtime is extended by a factor of n+2 for n field routines used. For this reason, you should dispense with field routines and use an end routine instead.

In addition, the error DTP is also only used with BW/4HANA 2.0. With BW/4HANA 1.0 and BW 7.5 on HANA, error handling cannot be used for the HANA runtime. If you already have a BW/4HANA 2.0 in use and want to use this solution, you should critically examine the use of this solution from a performance perspective. Alternatively, you can consider the second scenario, which we explain in the following paragraph.


Increase the performance of your BW with SQLScript

Neuer Call-to-Action



Second scenario - Automatic correction of incorrect records

This scenario is fundamentally different from the first method. Instead of collecting the erroneous records in the error stack, the aim is to be able to process the erroneous records flexibly.

For example, you can include a field in the target InfoProvider that serves as a status indicator. With this flag you can mark the incorrect data records. If necessary, you can also store the error type there to facilitate subsequent error handling.

Basically, all data records are updated, whereby the incorrect records are marked with a flag. This procedure has the advantage that reports can also include records with errors. You can use the Status indicator field to control whether the records with errors should be displayed or filtered out.

To correct the incorrect records, you can use a transformation that writes to the target InfoProvider itself and makes automatic corrections. Another option would be to post the data to another DataStore object, where you can edit the data using your own UI (such as NextTables). You can use the RSDRI_INFOPROV_READ and RSDSO_WRITE_API or RSDSO_DU_WRITE_API functions as APIs for this. Afterwards you can write the corrected data back into the actual target InfoProvider or process it in another way..

If you do not want to store the incorrect data records temporarily in a DSO, there is another alternative. You can correct the incorrect data records directly in the transformation, without storing them in a DSO. You will learn how this works with the help of SQLScript in another article that we will publish later in this series.

Error handling with SAP BW and SQLScript - Our Conclusion

Depending on the requirements profile, the first or the second scenario makes more sense.

In the first scenario, you ensure that only the consistent data records are updated. However, this scenario only comes into question as of version BW/4HANA 2.0. The deployment scenario should be tested carefully in terms of performance, as the data is processed twice. You can use SAP's standard functionality here, but you are also bound by its capabilities. For example, you can only correct the incorrect data records manually and then load them with an error DTP.

In our next article, which we will publish in this series, we will then go into detail about this scenario and provide helpful SQLScript coding snippets for implementation.

In the second scenario, you have greater flexibility - you have more options for processing the inconsistent data. Whether you first store the incorrect records in a DSO or correct them on-the-fly depends on the individual requirements. However, in doing so, you move away from the SAP standard and have to rely on your own developments. We will discuss both alternatives in detail in the following articles.

Are you planning to migrate to SQLScript and need help planning the right strategy? Or do you need experienced developers to implement your requirements? Please do not hesitate to contact us - we will be happy to assist you.

Learn more about  SAP HANA SQLScript

, ,

avatar

Chris

Chris Fidanidis has been working in the SAP BW environment since 2007. During these years he has implemented several planning projects and used various SAP tools such as SAP BSP, SAP BW-IP, SAP BPC, SAP BW Embedded BPC. He has gained experience primarily as a developer, architect, project manager and team leader. He enjoys playing basketball and barbecue whenever possible.

Got a question about this blog?
Ask Chris

Blog - NextLytics AG 

Welcome to our blog. In this section we regularly report on news and background information on topics such as SAP Business Intelligence (BI), SAP Dashboarding with Lumira Designer or SAP Analytics Cloud, Machine Learning with SAP BW, Data Science and Planning with SAP Business Planning and Consolidation (BPC), SAP Integrated Planning (IP) and SAC Planning and much more.

Subscribe to our newsletter

Related Posts

Recent Posts