Tuesday, December 30, 2008

ABAP List Viewer

ABAP List Viewer(ALV)

-> The ALV Grid Control (ALV = SAP List Viewer) is a flexible tool for displaying lists. The tool provides common list operations as generic functions and can be enhanced by self-defined options. This allows you to use the ALV Grid Control in a large range of application programs.
-> SAP provides a set of ALV function modules which can be used to embellish the output of the report.
-> Enhances the readability and functionality of report output.
-> Displays columns extending more than 255 characters in length.
-> Efficient tool for dynamically sorting and arranging the columns from a report.
-> Output can contain upto 90 columns in display with wide array of display options


Features
-> Display non-hierarchial lists with modern design
-> Use typical list functions like sorting,filtering dynamically with any programming efforts
-> Program responses to user actions like double-clicking.

As a minimum you need to provide the following details to display data:

1) An Internal table with the data to be displayed.

2) A description of the structure of this data that is declared to ALV Grid Control which is called the fieldcatalog

Generally,Internal Table consists of the data that is previously selected from the Database Tables

Steps to be followed
Step 1:Data Declaration
Declare Internal tables to be used for displaying data.
TYPE-POOLS:SLIS.
GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV, "FIELDCATALOG
GT_EVENTS TYPE SLIS_T_EVENT, "EVENTS

Step 2: Data Retrieval
Retrive the data to be displayed from the various database tables and store it in a n internal table

Step 3: Build Fieldcatalog
The field catalog is a table that contains information on the fields to be displayed.
For example, the ALV uses this table to identify the type of a field.
You can also use special fields of this catalog to determine the number format and column properties of the list to be output.
Eg: row_pos,col_pos,fieldname,table_name,
output_len,key,do_sum,no_sign etc.

Step 4: Build layout/events table
Next step is to build the layout,events and sort table.
Layout table will contain different layout structure like the col width,totals etc.
Events table is used to handle different events like TOP of Page,End of page etc
Sort table will define the sorting sequence.


Step 5:Display ALV List

Use the function module
'REUSE_ALV_GRID_DISPLAY‘ to display the grid.
For list display use
'REUSE_ALV_LIST_DISPLAY







1 comment:

magnific said...

This is very informative post. I had read some articles in this site and I can say it is very helpful to women. My wife surely loves reading your blogs. Thanks
http://www.sapboonlinetraining.in/

Post a Comment