You are on page 1of 13

3/11/2021 Code Review, Code Inspector, Code Pushdown & Key Changes in ABAP – S/4HANA | SAP Blogs

Community

Ask a Question Write a Blog Post Login

Shakeel Ahmed
February 8, 2018 3 minute read

Code Review, Code Inspector, Code Pushdown & Key Changes


in ABAP – S/4HANA
Follow RSS feed Like

3 Likes 2,854 Views 23 Comments

# Overview

This Article will help SAP Application Consultants who have passion for ABAP coding. It will cover followings:

1. S/4HANA Conversion & Custom Code


2. Changes in ABAP Dictionary Objects
3. Essential ABAP Code Review
4. Performance Booster ABAP Code Review
5. Tools for ABAP Code Review

This article has been made with the help of SAP ABAP Training and Training Material. Thanks to SAP for this.

# S/4HANA Conversion & Custom Code

When a customer migrates an existing SAP system to S/4HANA, the standard ABAP code is migrated, and if
necessary, adjusted automatically by the migration tools in order to run optimally on SAP HANA.

Although the migration tools move custom code to the new S/4HANA target system, there is no automatic
adjustment of the code.

The good news is that, in most cases, the code will run as expected. However, an important task in a migration
to an S/4HANA project should be the detailed review of custom ABAP code in order to ensure the following:

https://blogs.sap.com/2018/02/08/code-review-code-inspector-code-pushdown-key-changes-in-abap-s4hana/ 1/13
3/11/2021 Code Review, Code Inspector, Code Pushdown & Key Changes in ABAP – S/4HANA | SAP Blogs

That the custom code still functions as expected – there are a few coding techniques and database objects
that simply do not work in S/4HANA and must be replaced.
That the custom code runs optimally with SAP HANA. Although the code may run, there are easy
adjustments to the code that can make a huge impact on performance.

# Changes in ABAP Dictionary Objects

In the past, special types of ABAP tables were used in order to overcome limitations of the underlying
databases that powered SAP applications.

The tables shown in the gure are called pool and cluster tables and are found in standard and custom ABAP
code. One of the key reasons for using special tables was to overcome design limitations of tables in certain
databases. The special tables sit in the ABAP layer on top of the physical database and act as a logical layer to
the ABAP code.

SAP S/4HANA does not need these special tables, and uses only one type of table, called a transparent table,
with no loss in performance or function. A transparent table has a one-to-one relationship with a physical table.

During migration, the special tables are converted to transparent tables. SAP standard code is automatically
adjusted to switch from calling the special tables to calling the transparent tables. Secondary indexes are
dropped during migration. Indexes are usually not required by SAP HANA. If your code refers to them, you must
make adjustments.

Customers and partners need to make their own checks and adjust their code where necessary.

However, if your custom code refers to a standard table that has now been removed, SAP provides views for all
removed tables. This means your code still works and just uses the view.

https://blogs.sap.com/2018/02/08/code-review-code-inspector-code-pushdown-key-changes-in-abap-s4hana/ 2/13
3/11/2021 Code Review, Code Inspector, Code Pushdown & Key Changes in ABAP – S/4HANA | SAP Blogs

# Essential ABAP Code Review

Issues to watch for with the ABAP code that mean the application may not function as expected are as follows:

Review of native SQL: For example, functions that only work with MS SQL Server, and database hints to
override the SQL execution plan (for example, use this aggregate if it exists).
Avoid SELECT *: This is another way of asking for all columns in a record. SAP HANA’s column-based
database works better when you ask for only columns you need.
Do not assume a sort sequence of the results: Sort sequences were usually implied by the primary key, and
SAP HANA does not pre-sort the data. You must explicitly code this sort request, if needed.

# Performance Booster ABAP Code Review

Look out for the following items in your existing ABAP code in order to improve the performance:

Avoid SELECT *

SAP HANA’s column-based database works better when you ask for only columns you need, and avoid lling
memory with unwanted columns.

Try to Send a WHERE Clause to the SAP HANA Database

https://blogs.sap.com/2018/02/08/code-review-code-inspector-code-pushdown-key-changes-in-abap-s4hana/ 3/13
3/11/2021 Code Review, Code Inspector, Code Pushdown & Key Changes in ABAP – S/4HANA | SAP Blogs

Often, developers request all data (they do not use WHERE), and then they lter the data in the application
code.

Push Down all Data-Intensive Functions to the SAP HANA Database

Examples include aggregation, lters, and sorts. You do this by calling native SAP HANA database functions.

# Tools for ABAP Code Review

SAP provides tools to speed up and automate the code review phase and ensure nothing is missed.

ABAP Code Inspector allows developers to choose the type of checks they want to make. For example, the
following:

Code Checks

Show me where I refer to pool and cluster tables


Show me where I use SELECT *
SQL Monitor identi es bottlenecks, so developers can focus on improving the most problematic code. For
example, it takes a long time to read a table: maybe table partitioning could help?

Usage and Procedure Logging (UPL) identi es dead code, or code that is rarely used. Do not waste time to
improve this if nobody uses it.

https://blogs.sap.com/2018/02/08/code-review-code-inspector-code-pushdown-key-changes-in-abap-s4hana/ 4/13
3/11/2021 Code Review, Code Inspector, Code Pushdown & Key Changes in ABAP – S/4HANA | SAP Blogs

Alert Moderator

Assigned tags

SAP S/4HANA | ABAP Connectivity | ABAP Development | SAP S/4HANA Finance | UI Web Dynpro ABAP |

View more...

Related Blog Posts

What can you do today to prepare your custom code for SAP S/4HANA
By Olga Dolinskaja , Oct 12, 2017
SAP S/4HANA System Conversion – Challenge for your custom code
By Olga Dolinskaja , Feb 15, 2017
SAP S/4HANA Custom Code Adaptation
By Barbara Bollard , Jan 11, 2021

Related Questions

ABAP Migration to S/4 HANA and the new Data Model


By Felix Fichtner , Oct 18, 2016

Migrating custom developments from ECC(Ehp0) to S/4HANA onPremise system


By Madhu B , Feb 28, 2018

Code review tool for AMDP classes in SE24?


By Vimal Sharma , Dec 28, 2016

23 Comments

https://blogs.sap.com/2018/02/08/code-review-code-inspector-code-pushdown-key-changes-in-abap-s4hana/ 5/13
3/11/2021 Code Review, Code Inspector, Code Pushdown & Key Changes in ABAP – S/4HANA | SAP Blogs

You must be Logged on to comment or reply to a post.

Michelle Crapo

February 8, 2018 at 12:59 pm

Interesting - a lot of this is a part of good coding practice for lower versions of SAP.  Some of the "tables" going
away, now that is a change. It will be a big part of revising our code.  Also we started with some analysis of if the
code is really needed. Is there something that replaced it? It is a good time to take inventory and get rid of as
many custom programs as possible. Another analysis is the business process can it be moved to a "SAP way of
doing things". This is at some point when we move to HANA . Until then I'm reading blogs, getting free training -
there was a migration class for data.  It didn't include the code.

It looks like there will be a lot of manual changes. Of course the code inspector will help.

Nice blog.  Including pictures! I have to like that.

Michelle

Like(2)

Shakeel Ahmed | Post author

February 8, 2018 at 1:47 pm

Thanks Michelle. But I could not understand the question (Is there something that replaced it?

Regards

Shakeel

Like(0)

Michelle Crapo

February 8, 2018 at 2:13 pm

No there isn't something that replaced it.   No question, I was just leaving a comment. I wanted to add that there
was a data migration tool.   There is a open course that covers the basics on how to use it.

I think  Joachim makes my point better than I do. I think good coding practices would stop things like Select *.
When I posed my question, is there something that replaced it? I meant did the new version of SAP o er
something similar to the ABAP program.  If it does, then the program is no longer needed.

Thank you for asking - I probably confused other people too!

https://blogs.sap.com/2018/02/08/code-review-code-inspector-code-pushdown-key-changes-in-abap-s4hana/ 6/13
3/11/2021 Code Review, Code Inspector, Code Pushdown & Key Changes in ABAP – S/4HANA | SAP Blogs

Michelle

Like(0)

Joachim Rees

February 8, 2018 at 1:41 pm

Hi Shakeel,

a nice, high-level overview for that target group (SAP Application Consultants) you mentioned.

This one I would oppose to:

Often, developers request all data (they do not use WHERE), and then they lter the data in the application
code.

I really hope developers don't do that! (I don't).

Another point worth mentioning: The cleanup of custom code (including elimination of no longer needed code)
can and should be done way up front of the actual conversion (the wording "migration" you use is not 100%
correct here, as SAP ERP and SAP S/4HANA are di erent products).

best
Joachim

Like(2)

Shakeel Ahmed | Post author

February 8, 2018 at 1:46 pm

Hi Joachim,

I am Functional Consultant-FICO and have limited knowledge about the ABAP. Please forgive if any
inconsistency or mistake is there.

Regards
Shakeel

Like(1)

Joachim Rees

https://blogs.sap.com/2018/02/08/code-review-code-inspector-code-pushdown-key-changes-in-abap-s4hana/ 7/13
3/11/2021 Code Review, Code Inspector, Code Pushdown & Key Changes in ABAP – S/4HANA | SAP Blogs

February 9, 2018 at 9:29 am

that's the nice part of community: you get feedback and additions by others and in the end, everyone bene ts!

Like(0)

Shakeel Ahmed | Post author

February 9, 2018 at 9:36 am

Yes, Joachim. I agree with you completely except few people.

Like(0)

Florian Henninger

February 20, 2018 at 7:39 pm

Mhh... maybe I should check on that tomorrow

Like(0)

Jelena Per ljeva

February 8, 2018 at 3:37 pm

Yep, most of these things have already been best practice for some time. And custom code should be revised
and improved constantly (ideally ).

There is a lot of information already available for the ABAPers regarding the changes in HANA or S/4HANA and
how we can start preparing. I'd suggest for the functional consultants to focus on their area of expertise and let
ABAPers do their job.

As a very high level overview, it is OK. I liked a simple explanation of the pool/cluster table concept. I sometimes
struggled to explain this in plain language to non-technical folks.

Like(4)

Shakeel Ahmed | Post author

February 8, 2018 at 3:51 pm

Dear Jelena,

https://blogs.sap.com/2018/02/08/code-review-code-inspector-code-pushdown-key-changes-in-abap-s4hana/ 8/13
3/11/2021 Code Review, Code Inspector, Code Pushdown & Key Changes in ABAP – S/4HANA | SAP Blogs

With all due rest I would like to call that ‘You are o ending’.

Who are you to suggest anyone who should do what.

In future I would expect better and positive comments from you.

Best Regards

Shakeel

Like(0)

Shakeel Ahmed | Post author

February 8, 2018 at 3:54 pm

rest= respect

Like(0)

Jelena Per ljeva

February 8, 2018 at 4:31 pm

FYI: we can edit our comments, it's not Twitter.

Like(0)

Joachim Rees

February 9, 2018 at 9:26 am

In theory yes, but in practice you often can't edit, because of this "We are unable to complete your request. You
may have been logged out from your session. Please re-login and try again."-bug!

Like(1)

Jelena Per ljeva

February 9, 2018 at 7:35 pm

Yes, you're right. Almost forgot about that, sorry!

Like(0)

https://blogs.sap.com/2018/02/08/code-review-code-inspector-code-pushdown-key-changes-in-abap-s4hana/ 9/13
3/11/2021 Code Review, Code Inspector, Code Pushdown & Key Changes in ABAP – S/4HANA | SAP Blogs

Jelena Per ljeva

February 8, 2018 at 4:30 pm

I'm confused... Which part exactly o ends you?

Like(0)

Shakeel Ahmed | Post author

February 9, 2018 at 1:00 am

Dear Jelena,

Message is loud and clear. People would have understood about you and your thought process. I am done with
you and don’t have any more time for you.

Yes, you are really confused person and that you have accepted.

PS: was editing on mobile and some error was there. So thought let post separate reply for correction.

Regards

Shakeel

Like(0)

Jelena Per ljeva

February 9, 2018 at 8:23 pm

Uhm, OK... I still remain confused how exactly my comment o ends anyone. Perhaps you didn't notice the
smiley faces? Not sure if they're rendered well on a mobile device...

Even though it clearly was meant as rather "tongue-in-cheek", in all seriousness I do believe that it's better for
everyone to do their own job. Do you disagree with that? Then please share some arguments. You were asking
who am I - well, I'm an ABAP developer who had to x too many problems that were caused by the functional
consultants writing ABAP in the situations where they did not have enough knowledge to do it right. Does that
qualify me enough to have an opinion in the matter?

By any means, I'm all for "cross-training" and believe it's bene cial both for ABAPers to know about functional
aspects and for functional folks to know something about ABAP. But we all need to understand that learning a
bit about something does not necessarily make us an expert.

I'd like to highlight that my comment did not contain a personal attack on anyone. As a matter of fact, I did not
even criticize your blog. It is just OK, neither bad nor especially great as far as SCN blogs go. This is my personal
https://blogs.sap.com/2018/02/08/code-review-code-inspector-code-pushdown-key-changes-in-abap-s4hana/ 10/13
3/11/2021 Code Review, Code Inspector, Code Pushdown & Key Changes in ABAP – S/4HANA | SAP Blogs

opinion, anyone is free to disagree. It's rather unrealistic IMHO to expect everyone to have an opinion only to
your liking.

At the same time, your responses do look very much like a personal attack on me and I feel it's  uncalled for.

Like(5)

Shakeel Ahmed | Post author

February 10, 2018 at 1:28 am

1. Very Smart this time in writing. I appreciate that


2. There are thousands of ABAPERs on the earth and all are smart, intelligent, knowledgeable and I love
working with them.
3. You words in the rst comment "I’d suggest for the functional consultants to focus on their area of expertise
and let ABAPers do their job" - Just don't get into it.
4. No personal attack. But yeah it was a t respons on comments.
5. Live and let live please. Have great time ahead in life. Bye.

Like(0)

Shakeel Ahmed | Post author

February 10, 2018 at 1:47 am

PS: response to this line (" It is just OK, neither bad nor especially great as far as SCN blogs go") about the blog.
See below, it got selected for featured content on SAP community site. I hope you got  t reply again.

https://blogs.sap.com/2018/02/08/code-review-code-inspector-code-pushdown-key-changes-in-abap-s4hana/ 11/13
3/11/2021 Code Review, Code Inspector, Code Pushdown & Key Changes in ABAP – S/4HANA | SAP Blogs

Like(0)

Joachim Rees

February 14, 2018 at 8:44 am

I can't see it featured, maybe it was there only shortly or by mistake?

(I did scroll to the right, too, it's not there either...)

Like(0)

Shakeel Ahmed | Post author

February 14, 2018 at 3:25 pm

It was there for a week my friend. Why would you make such comments with screen shot? I did not get the
intention. It was not there for good.  

Like(0)

https://blogs.sap.com/2018/02/08/code-review-code-inspector-code-pushdown-key-changes-in-abap-s4hana/ 12/13
3/11/2021 Code Review, Code Inspector, Code Pushdown & Key Changes in ABAP – S/4HANA | SAP Blogs
nabheet madan
February 16, 2018 at 8:45 am

Dear Shakeel

Thanks for writing the blog.  I am back to SCN after long and catching up on things. I too feel Jelena
Per ljeva was not rude at all. All that is written in the blog are valid practices and can be found at many places if
we google.

Please understand whenever any one provide feedback take it in a constructive way and when that feedback
comes from Mentors then we shall it more seriously.

I hope you will understand my point.

Thanks

Find us on

Privacy Terms of Use

Legal Disclosure Copyright

Trademark Cookie Preferences

Newsletter Support

https://blogs.sap.com/2018/02/08/code-review-code-inspector-code-pushdown-key-changes-in-abap-s4hana/ 13/13

You might also like