Introduction to SAP ABAP ALV with OOPs concept
August 4, 2008 by Ameya Pimpalgaonkar
- Swarna Munukoti
- L&T Infotech
In this article we will see of how to make the ABAP report an interactive one.
One way to make a report interactive is using ALV tool. I will give a brief idea of what ALV is all about using OOPs concept.
ABAP List Viewers (ALV):
The name itself indicates that the output view of a report is in the form of a list. This list can be displayed in two forms
- ALV List Form
- ALV Grid Form
This article covers only ALV grid form. This is the most preferable form because of its GUI capability. When coming to the implementation part of ALV Grid using OOPs concept, we can use the existing classes for generating ALV output: Here I am listing some of the widely used classes and its purpose:
- CL_GUI_ALV_GRI
- CL_GUI_CUSTOM_CONTANIER
- CL_GUI_SPLITTER_CONTAINER
- CL_GUI_CONTAINER
- CL_DD_DOCUMENT
- CL_GUI_HTML_VIEWER
- CL_ALV_CHANGED_DATA_PROTOCAL
CL_GUI_ALV_GRID: This class contains all the methods required to create an ALV and holds the events required for the generated ALV. The methods in this class are useful for:
- Setting the field catalog and its layout
- For assigning the ALV to the Custom container
- For changing the field catalog contents
- For adjusting the ALV display and the list goes like this.
I will explain how to use the methods and events with an example at the end of this article.
CL_GUI_CUSTOM_CONTAINER: It holds the Custom control that is created on the screen layout. The link to the custom control to the ALV will be done using this container class.
CL_GUI_SPLITTER_CONTANIER: Using this class we can split the container into several parts based on the requirement.
For instance, there may be a requirement in which top portion of the ALV Grid must hold the company logo and some other details like date and user ID and the remaining part must hold the loaded data. In this case we can use this class to split the container into two parts one for holding the company details and the other contains all the records.
CL_GUI_CONTAINER: This class is also useful while splitting a container. Each container part that is separated using the above class holds the form of this class.
CL_DD_DOCUMENT: This class is used to write text or labels or variables or logos etc., on the container layout.
CL_ALV_CHANGED_DATA_PROTOCAL: If the ALV is in edit mode then the changed values can be viewed through this class.
The following example demonstrates how to make use of the methods and events of CL_GUI_ALV_GRID.
Note: This program is not specific to any application. It will give the basic idea of implementing the double click, hotspot, data change, tool bar and user command events in ALV.
You can download the full copy of this programme at following link.
http://www.madeitsimple.com/forum/viewtopic.php?f=16&t=23
Regards,
Swarna




Good work swarna……
Thanks a lot Bhagya
Regards,
Swarna M