I faced a scenario where I had an ALV grid where all columns were made generic of type (let’s make it simple) CHAR255. Each column has its name in field catalog in format TABNAME-FIELDNAME (+ more human readable column header texts of course). What I needed to achieve was to make validation of data that user entered in the ALV cells. Since the cell validation is not available by default (because of type CHAR255) I had to make it dynamically.
In this article I’d like to share my solution Continue reading
Category Archives: ALV
ABAP – ALV custom toolbar button + Import data from clip board
In this code example I’ll show how to add custom button to your ALV toolbar. This custom button will import data from clipboard into the ALV grid. This can solve issue with classic Ctrl+C and Ctrl+V where there’s a problem that new rows are NOT created in the ALV grid automatically – this will be solved by the extra toolbar button Continue reading
ABAP – ALV Context menu + keep row selection after a filter is applied
Standard functionality of an ALV grid offers row selection by clicking on the row headers. You can also use Ctrl or Shift keys to do mutliple row selection. Drawback of this is when you need to select some rows and apply some filters at the same time. Setting or deleting filter (or any operation which does grid refresh) clears the row selection. If you need to keep the row selection together with functionality of filter (and others), you can follow my little suggestion Continue reading
ALV tutorial 11 – Edit & Save changes
In this tutorial I’ll show how to enable only the specific cells of a grid to be editable. Continue reading
ALV – Dynpro controlled by a global class
In this article I’ll present an approach how to handle a screen with a global ABAP class. The idea is simple – we will create a class which will listen to PAI and PBO events raised by the screen. All data processing and screen element manipulation is done in the class code. Let’s check out how exactly it is done Continue reading
ALV – Keep selection and scroll position after ALV refresh
There is an issue with ALV grid that if you refresh the grid being in edit mode using method REFRESH_TABLE_DISPLAY (in case you use CL_GUI_ALV_GRID) after you have changed some data, it may happen the cursor and/or scroll goes to the first (top left) cell of the grid. It might be a little confusing for user, but you can avoid this issue by using the following methods (and attached piece of code) Continue reading