SAP ALV Insight
Insight of ALV
Alv is an abbreviation of SAP List Viewer. It is a very useful tool for developers to deliver a unified UI to display data. Actually alv is a custom control which is implemented using SAP control framework. Below is the SAP standard document about the control framework. It is a rare case that you need to develop your custom control, but it is a good way to get the insight view about the alv.
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIGOF/BCCIGOF.pdf
The custom control can be either an ActiveX control or JavaBean. In R/3, we can use ABAP to control to control desktop applications(custom controls). Please find below diagram for detail information about SAP custom control framework.
SAP control framework
Different ways of alv programming
Gernerally, SAP provides three different ways of alv programming. As more and more programmers join into the ABAP development, these people are trained using object-oriented concept to think about the progaram, SAP provides more options for these people. The traditional funtion module concept is also very useful for those who get used to it. Below list these ways and add some description.
1. Function module programming.
This method is released after basis 4.6. Some very useful funciton module will be help us to create alv easily.
REUSE_ALV_VARIANT_DEFAULT_GET ” get the default layout
REUSE_ALV_VARIANT_F4 ” allow user to choose a saved layout
REUSE_ALV_FIELDCATALOG_MERGE ” generate the field catalog according to the supplied table,strcture or internal table.
REUSE_ALV_GRID_DISPLAY ” alv grid display
2. OO programming – directly use the custom control implementation.
Some useful classes:
CL_GUI_ALV_GRID ” alv grid implementation
CL_GUI_ALV_TREE ” alv tree implementation
3. OO programming – encapsulation of custom control implementation.
This method is delivered from basis 6.40. Some useful classes:
CL_SALV_TABLE ” alv grid display
CL_SALV_TREE ” alv tree display
This article gives an overview of SAP alv as well as some deep insight. In futher posts, we will give some useful examples of alv programming using different methods. You can choose the way you like to calling the SAP ALV.