You are on page 1of 10

ALV

o
Attachments:9 Added by Guest, last edited by Sandra Rossi on May 20, 2010 (view change) show comment Introduction Links Examples how to create various ALVs Documentation for developers Demo programs

Introduction
The SAP List Viewer is a generic tool that outputs data in a table form (rows and columns), with integrated functions to manipulate output (sort, totals, filter, column order, hide, etc.) and export it (Excel, Crystal report, CSV files, etc.) It is also possible to make ALV editable via ALV control. ALV name comes from "ABAP List Viewer", as named initially because it was only available in ABAP. It is now a more general concept, which is available in java too (since 7.1). ALV tool proposes 3 display types (schemes are taken from the sap library - An Overview of ALV Tools) and in several technologies: Display types: Simple list:

Hierarchical sequential list:

Tree

o o

Technologies: List Control Framework In SAP release 4.5b was introduced the Control Framework. A control was made available for ALVs, known as ALV grid. It can be used in 3 ways: Direct use of control Function module wrapper. It may be used in full screen mode, which means that the buttons are displayed in the application toolbar, and also in popup mode. Object-oriented wrapper, since basis 6.40. Full screen and popup are also available. Web Dynpro Web Dynpro for ABAP Web Dynpro for java (since NetWeaver 7.10)

o o o o o o

Links
General

note 551605 - FAQ ALV SAP List Viewer Basics Links by technology

List: Using ALV for List Display, An Introduction to the ALV Tool Family for Developers (SAP Contribution by Barbara Neumann, December 2004) Control framework: Class ALV (wiki) ALV user guides:

o o o o o

NetWeaver 7.11 sap library - Working with lists List Control Framework Web Dynpro Web Dynpro for abap Web Dynpro for java

Examples how to create various ALVs


Technology Appearance

Simple list

Hierarchical sequential list

(credit: SAP List Viewer Basics)

Tree list

Grid Control

Hierarchical sequential control

Grid full screen

Tree control

Web Dynpro for ABAP

Documentation for developers

Technology Simple list Hierarchical sequential list Tree list Grid Control

Documentation SAP documentation is provided only within function modules in workbench repository

Class ALV (wiki) ALV Object Model - Simple 2D Table - Event Handling (Community Contribution by Rich Heilman, 28 Sep 2006) sap library - alv grid control sap library - SALV

Hierarchical sequential control Grid full screen Tree control Web Dynpro for ABAP

USING HIERARCHICALLY -SEQUENTIAL TABLE Factory method (wiki)

File Utility ALV Tree sap library - SAP List Viewer in Web Dynpro for ABAP

Demo programs
Technology Simple list Hierarchical sequential list Tree list SAPMSABAPDEMOS Call FM to generate alv tree and deal with user action Grid Control Hierarchical sequential control Grid full screen BCALV_TEST_FULLSCREEN* programs below BCALV_TEST_FULLSCREEN Many (all?) aspects: Layout management Editable columns Miscellaneous: General appearance, Hotspot, Currency fields, Colors Shows all types of fields: icon, character, number, date, time, checkbox, negative number, hexadecimal, INT4, NUMC, floating point, lower case, symbol, etc. You may need to generate Flight Demo data to fill ALV Program Description

Sorting, Totals, Subtotals Print options BCALV_TEST_FULLSCREEN_EDIT Fully editable ALV (be careful, you have to select the "editable" checkbox in the middle of the selection screen, and SAVE button allows to save changed values BCALV_TEST_FULLSCREEN_EVENTS BCALV_TEST_FULLSCREEN_FILTER BCALV_TEST_FULLSCREEN_FQUAN Demo of all events filter on all types of fields, with many variations of values Quantities related to unit of measure fields (you may also see how it affects filter option); also shows the variation of the number of decimals according to the unit of measure BCALV_TEST_FULLSCREEN_HTML BCALV_TEST_FULLSCREEN_PRINT BCALV_TEST_FULLSCREEN_STATUS Tree control Web Dynpro for ABAP HTML container above and below ALV Print without displaying, or from ALV screen print button Choose GUI status, and modify its list of buttons and menus

Child Pages (11)


Hide Child Pages | View in Hierarchy ABAP Technology Add Header to ALV report ALV easy tutorial Check for changed value in ALV GRID Class ALV Disable 'Display Graphic' icon in the toolbar of ALV Gird Displaying a particular columns in multiple line in ALV List Displaying the data in different languages using ALV Individual cell coloring in dynamic alv Interactive Editable OO ALV grid with dynamic itab,FCAT and ENTER key event trigger List Of Function Modules Used In ALV Programming

Add Header to ALV report



Added by Guest, last edited by Guest on Feb 23, 2008 In order to insert a report heading in to the ALV grid you need to perform the following steps: 1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include 'top-of-page' FORM 2. Create 'top-of-page' FORM

Check the following code: call function 'REUSE_ALV_GRID_DISPLAY' exporting i_callback_program = gd_repid i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM is_layout = gd_layout it_fieldcat = fieldcatalog[] i_save = 'X' tables t_outtab = it_ekko exceptions program_error = 1 others = 2.

------------------------------------------------------------------Form TOP-OF-PAGE * ------------------------------------------------------------------ALV Report Header * ------------------------------------------------------------------Form top-of-page. *ALV Header declarations data: t_header type slis_t_listheader, wa_header type slis_listheader, t_line like wa_header-info, ld_lines type i, ld_linesc(10) type c.

Title wa_header-typ = 'H'. wa_header-info = 'EKKO Table Report'. append wa_header to t_header. clear wa_header.

Date wa_header-typ = 'S'. wa_header-key = 'Date: '. CONCATENATE sy-datum+6(2) '.' sy-datum+4(2) '.' sy-datum(4) INTO wa_header-info. "todays date append wa_header to t_header. clear: wa_header.

Total No. of Records Selected describe table it_ekko lines ld_lines. ld_linesc = ld_lines. concatenate 'Total No. of Records Selected: ' ld_linesc into t_line separated by space. wa_header-typ = 'A'.

wa_header-info = t_line. append wa_header to t_header. clear: wa_header, t_line. call function 'REUSE_ALV_COMMENTARY_WRITE' exporting it_list_commentary = t_header. i_logo = 'Z_LOGO'. endform.