With this field, you can setup alignment of the column. You can use one of the following values:

  • R - Right,
  • L - Left,
  • C - Centre,
  • space – default setting for field type



Figure 42 ZDEMO_AIN_CL19 Fieldcatalog with alignment

As you can see the columns are using the settings from fieldcatalog correctly.

Figure 43 ZDEMO_AIN_CL19 Results




Add a comment

This field allows manipulation of visibility of leading zeros. One of the most common example is the material number (MATNR), when there is no letter inside the name of material, it is stored in database with leading zeros. For example material 101 would is stored as 000000000000000101 in ECC and 0000000000000000000000000000000000000101 in S/4 HANA. In order to not display this not needed zeros, you can setup LZERO to ‘X’.


Figure 44 ZDEMO_AIN_CL20 With leading zeros


Figure 45 ZDEMO_AIN_CL20 Without leading zeros




Add a comment

NO_SIGN can be used to hide the sign of the number. For example you have negative values but you want to display it as positive.

In order to show you the behaviour of this settings, I’ve manipulated the distance of the flight in the demo program by multiplying it by -1.


Figure 46 ZDEMO_AIN_CL21 Select


Figure 47 ZDEMO_AIN_CL21 Without NO_SIGN option


Figure 48 ZDEMO_AIN_CL21 With NO_SIGN option




Add a comment

Field catalog is one of most important tables that is used in ALV Grid. In most cases you’ll create it manually or at least after automatic creation, you’ll update its content, as most of the columns settings are placed here. ALV Grid field catalog should have type LVC_T_FCAT. Of course as it’s not mandatory parameter you can also omit during the displaying on grid (like I did for example in program ZDEMO_AIN_CL01), but this is only allowed if the table you would like to display is of type that is kept in dictionary. In other case, you’ll be forced to create the field catalog and pass it as parameter to SET_TABLE_FOR_FIRST_DISPLAY method.

In table below you’ll find the list of all fields used in field catalog with its dictionary type and description. Some of the fields are quite simple to explain, some are harder, but bellow you’ll find description of all of them, whenever it was possible by me to check their behaviour. Click on the link on the field name (if exists) to get the deeper description and example of usage.

Add a comment
Read more ...

I was thinking about writing a book about ALV Grid for a long time, but there was always an excuse to not to do it. One of the biggest was that SAP is now strongly advertising Fiori and UI5 as the next generation of UI in SAP world and I was thinking about when SAP will kill old ALVs. This so far didn’t happened and as there are dozens of ABAP developers who still creates reports and transactions inside the ERP systems using the good old ALV Grid, I’ve decided to finally do it. Personally I don’t see how expert users could easily switch to Fiori or UI5 apps, especially that I haven’t seen so far an editable grid or table there. But maybe I’m just blind. 

Personally I’d prefer that SAP would create new controls that would look like the one you can get in every Windows or iOS applications, which you can easily add via drag & drop in screen editor. But probably this will not happen soon, maybe even never. That’s why it’s really important to get an idea what you can do with the controls that are already available in SAP. In this tutorial I will try to show you what you can do with ALV Grid. If possible I will give you an example for each functionality, so you could really understand it easily. It will not be a story, it will be a journey through the good old ABAP days. It will not be easy to read, as this will be in most parts a technical description of possibilities that ALV Grid gives you, but I hope it will help you in your daily job. 

Add a comment
Read more ...

​​​​​​ I wrote in previous post, you can’t use this class directly without any effort. First of all, the class itself will not display anything if you’ll not create a container for it. The following containers can be used:

  • Custom container
  • Splitter container
  • Docking container
  • Dialogbox container


1. Custom container

Custom container can be created with a class CL_GUI_CUSTOM_CONTAINER, but it needs a parent container in which it could be placed or it needs an custom control area to be created in custom screen . This solution is mainly used by me in the applications I develop now. But it’s also common that you’ll mix custom containers with other in one development.

Many persons creates the custom container during the PBO event of the screen that contains custom container area, but you don’t have to do that. You can create it also before calling the screen, like in the simple example of using CL_GUI_CUSTOM_CONTAINER that you can find in Figure 1 and in demo program ZDEMO_AIN_CL01.

Don’t try to find anything in this program, that was not needed just to quickly display the data on the grid. There is no GUI Status, there is no PBO and PAI handling. I did it on purpose just to create really simple example. (As you may read it the abapGit version can differ from here)


Figure 1 ZDEMO_AIN_CL01 example of using CL_GUI_CUSTOM_CONTAINER


Of course in order to be able to display the grid I had to create a SCREEN 0100 which contains custom container area named CC which you can find in Figure 2. The only additional setting for the screen I did was to setup its size to 200 x 255 and I have given the area possibility to resize vertically and horizontally, so it will fit to all screens. 

Add a comment
Read more ...