7.4 Release News - Inline Declaration I.

Overview

After finishing the blog post series, called 5 Ways to Improve the Readability of Your ABAP Code, I was thinking a lot about the topic of the next blog post series.

In the last few months, I worked with many 7.4 based SAP systems, developed many ABAP programs, and thanks to this, I had chances to try out the different new features, that the SAP has implemented. Since during my works, these improvements helped me a lot, and found them very useful, I decided to share them with you.

5 Ways to Improve the Readability of Your ABAP Code Part V. - The Proper Use of Comments

Overview

In the last few posts we have talked about why to use meaningful identifier names, why to avoid magic numbers, the benefits of organizing our code with functions, and the role of formatting

Now, I want to talk about the last part of my readability puzzle, the comments.

Comments serve as annotations in our source code, usually we leave these kind of notes to make ourselves and the others remember what the given portion code is actually doing.

However there are cases when these notes creates misunderstandings, for example when it's not up to date with the associated code.

5 Ways to Improve the Readability of Your ABAP Code Part IV. - Formatting Does Matter

Overview

First of all Happy and Successful New Year to my dear readers! I hope you all had a great holiday with your family, could relax a bit, and you are ready to improve further our ABAP coding style.

I skipped two weeks of writting posts, because I didn't want to bother you with boring ABAP codes during the holidays, but today we are going to continue our work. Let me refresh what we learn until now!

In the previous posts we talked about using meaningful identifier names, why to avoid magic numbers, and the benefits of organizing our code with functions. As you have experienced, these methods require more time to invest (choosing the best identifier name, how to structure the code with functions, and so on), but at the end it pays off multiple times.

5 Ways to Improve the Readability of Your ABAP Code Part III. - Organizing with Functions

Overview

In the last two blog posts, I have showed you the benefits of using meaningful names and avoiding magic numbers. As I told you, it really does matter how readable your code is.

In the last few days, I was thinking a lot about the WHYs, why many-many developers write their source code with poor readability and transparency:

  • faster development => okay, it can be faster in the first few iterations, but then the development time increases largely, when the lines of the source code hits a certain numbers,
  • hiding information => it's my program! I don't want anybody to understand it! I want to keep that information! It's ok, but you are going to hide that info from yourself also, since a year later you won't understand neither,
  • laziness => I have no explanation :)

5 Ways to Improve the Readability of Your ABAP Code Part II. - Avoid Magic Numbers

Overview

After showing you the real benefits of using meaningful names, I want to share you another useful tip that can help you to improve the readability of your code. Usually, it's not advisable to use many hard-coded values in your source code, but there are cases when you need them. For example, you want to calculate the total working hours of a month, based on the working days, using the following formula:

total_working_hours = working_days * 8.

5 Ways to Improve the Readability of Your ABAP Code Part I. - Using Meaningful Names

Overview

Today, I'm going to start a new series of posts about improving the readability of your code. In this post series, I will share you my top 5 approaches that can help to make your and your colleagues' life easier.

In the past, I have seen many-many ABAP source codes with the lack of readability. These coders usually choose poor names for their programs, classes, methods, subroutines, function modules, variables, and so on, which makes their own and our business more complicated.

I know that in ABAP, we are a bit limited in the length of the identifiers, but usually we have enough characters to express our thoughts (depending on the type of the indentifiers). I don't think it belongs only to these length limitations, I think it's more about your exactitude. Don't be afraid using meaningful names!

Understanding Persistence Service

Overview

What is SAP Persistence Service? One of the simplest definition is that it forms a bridge between your relational database and ABAP Objects.

If you have any experiences in other programming languages, like Java or C#, then maybe you have heard about ORM (Object-Relational Mapping) frameworks. These ORM tools enable you to construct classes with attributes, and then the framework will automatically generate the corresponding database tables in your database, and represent the data like objects.

Display ALV List easily in ABAP using CL_SALV_TABLE Part VII. - Aggregations

Overview

In the previous post, we successfully set a title for our ALV and set the rows striped. Now, we have arrived to the final post of the series, where I'm going to show you another useful feature of the CL_SALV_TABLE class, called aggregations. Using aggregations, we are able to display the minimum, maximum, average or the total of a key figure column.

In order to set an aggregation on our ALV, we need to ask the CL_SALV_TABLE class via its GET_AGGREGATION method to get an object reference of the CL_SALV_AGGREGATIONS.

That's enough for now, let's jump into the middle, and implement our last setting!

Display ALV List easily in ABAP using CL_SALV_TABLE Part VI. - Display Settings

Overview

I think, we are getting closer to have a nice, feature-rich ALV list week by week. In the previous post, I showed you that how to enable the standard toolbar on the top of our ALV list.

Today, we are going to work on the appearance, namely I'm going to show you that how set the header of the ALV list, and how to set the rows striped. Alright, we have the requirements, but how to satisfy them? Easy, and you already know it, we have another subclass of the CL_SALV_TABLE, called CL_SALV_DISPLAY_SETTINGS that is responsible for the appearance of our ALV list.

Display ALV List easily in ABAP using CL_SALV_TABLE Part V. - Set Toolbar

Overview

In the previous post, we successfully performed some individual column settings, like hiding unnecessary fields, and changing the text of some fields. So now, we have a good-looking ALV list, but we cannot say that our ALV is strong in functionality.

So today, I going to share with you that how we can add additional functionality to our toolbar on the top of the list, beside the existing layout settings. To bring it to life, today we are going to use the class, CL_SALV_FUNCTIONS_LIST that is responsible for customizing the toolbar. Using this class, we are able to create custom functions and add it to the toolbar, or we can use standard ones, like sorting, filtering, and so on. In this demo, I am going to show you, how to enable the standard toolbar.