Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Reports

Former Member
0 Likes
826

Hi Friends,

Why ALV reports are better than normal reports?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
764

Hi,

using the alv the report headers will automatically be shown based on the attributes of the field..The output length of the column, field allignment everything is taken care by the alv ..

normal reports..you have to take care of the alignment , report headings..

A classical report is a program that generates a single list, which must contain all of the required detail information.

1) This procedure may result in extensive lists from which the user has to pick the relevant data.

2) For background processing, this is the only possible method. After starting a background job, there is no way of influencing the program.

3) The desired selections must be made beforehand and the list must provide detailed information.

4) For dialog sessions, there are no such restrictions.

5) The user is present during the execution of the program and can control and manipulate the program flow directly.

6) To be able to use all advantages of the online environment, classical reporting was developed into interactive reporting.

ALV is Application List viewer. Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length. In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output. The report output can contain up to 90 columns in the display with the wide array of display options.

Advantages.

Collapse multiple reports into one, drastically cutting down your report development time

Save many hours using built-in ALV sorting, subtotaling and filtering capabilities

Add conditional structures into your ALV report: No programming required!

Combine ALV with display variants to meet a wide range of reporting requirements more easily

Dynamically reorder column layouts and add/subtract fields

Enable users and analysts to save their own personalized variants

All the definitions of internal tables, structures and constants are declared in a type-pool called SLIS.

1. SIMPLE REPORT.

The important function modules are

a. Reuse_alv_list_display

b. Reuse_alv_fieldcatalog_merge

c. Reuse_alv_events_get

d. Reuse_alv_commentary_write

e. Reuse_alv_grid_display

A. REUSE_ALV_LIST_DISPLAY : This is the function module which prints the data.

The important parameters are :

I. Export :

i. I_callback_program : report id

ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the functionality of the existing pf status

iii. I_callback_user_command : routine where the function codes are handled

iv. I_structure name : name of the dictionary table

v. Is_layout : structure to set the layout of the report

vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function module REUSE_ALV_FIELDCATALOG_MERGE

vii. It_events : internal table with a list of all possible events of ALV and their corresponding form names.

II. Tables :

i. t_outtab : internal table with the data to be output

B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.

The Important Parameters are :

I. Export :

i. I_program_name : report id

ii. I_internal_tabname : the internal output table

iii. I_inclname : include or the report name where all the dynamic forms are handled.

II Changing

ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is

declared in the type pool SLIS.

C. REUSE_ALV_EVENTS_GET : Returns table of possible events for a list type

Parameters :

I. Import :

Et_Events : The event table is returned with all possible CALLBACK events

for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV.

II. Export :

I_List_type :

0 = simple list REUSE_ALV_LIST_DISPLAY

1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY

2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND

3 = hierarchical-sequential block list

REUSE_ALV_BLOCK_LIST_HS_APPEND

D. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.

Parameters :

I. it_list_commentary : internal table with the headings of the type slis_t_listheader.

This internal table has three fields :

Typ : ‘H’ – header, ‘S’ – selection , ‘A’ - action

Key : only when typ is ‘S’.

Info : the text to be printed

E. REUSE_ALV_GRID_DISPLAY : A new function in 4.6 version, to display the results in grid rather than as a preview.

Parameters : same as reuse_alv_list_display

This is an example for simple list.

2. BLOCK REPORT

This is used to have multiple lists continuously.

The important functions used in this report are:

A. REUSE_ALV_BLOCK_LIST_INIT

B. REUSE_ALV_BLOCK_LIST_APPEND

C. REUSE_ALV_BLOCK_LIST_HS_APPEND

D. REUSE_ALV_BLOCK_LIST_DISPLAY

A. REUSE_ALV_BLOCK_LIST_INIT

Parameters:

I. I_CALLBACK_PROGRAM

II. I_CALLBACK_PF_STATUS_SET

III. I_CALLBACK_USER_COMMAND

This function module is used to set the default gui status etc.

B. REUSE_ALV_BLOCK_LIST_APPEND

Parameters :

Export :

I. is_layout : layout settings for block

II. it_fieldcat : field catalog

III. i_tabname : internal table name with output data

IV. it_events : internal table with all possible events

Tables :

i. t_outtab : internal table with output data.

This function module adds the data to the block.

Repeat this function for all the different blocks to be displayed one after the other.

C. REUSE_ALV_BLOCK_LIST_HS_APPEND

This function module is used for hierarchical sequential blocks.

D. REUSE_ALV_BLOCK_LIST_DISPLAY

Parameters : All the parameters are optional.

This function module display the list with data appended by the above function.

Here the functions REUSE_ALV_FIELDCATALOG_MERGE, REUSE_ALV_EVENTS_GET, REUSE_ALV_COMMENTARY_WRITE can be used.

3. Hierarchical reports :

Hierarchical sequential list output.

The function module is

A. REUSE_ALV_HIERSEQ_LIST_DISPLAY

Parameters:

I. Export:

i. I_CALLBACK_PROGRAM

ii. I_CALLBACK_PF_STATUS_SET

iii. I_CALLBACK_USER_COMMAND

iv. IS_LAYOUT

v. IT_FIELDCAT

vi. IT_EVENTS

vii. i_tabname_header : Name of the internal table in the program containing the

output data of the highest hierarchy level.

viii. i_tabname_item : Name of the internal table in the program containing the

output data of the lowest hierarchy level.

ix. is_keyinfo : This structure contains the header and item table field

names which link the two tables (shared key).

II. Tables

i. t_outtab_header : Header table with data to be output

ii. t_outtab_item : Name of the internal table in the program containing the

output data of the lowest hierarchy level.

slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be populated automatically by using ‘REUSE_ALV_FIELDCATALOG_MERGE’.

Important Attributes :

A. col_pos : position of the column

B. fieldname : internal fieldname

C. tabname : internal table name

D. ref_fieldname : fieldname (dictionary)

E. ref_tabname : table (dictionary)

F. key(1) : column with key-color

G. icon(1) : icon

H. symbol(1) : symbol

I. checkbox(1) : checkbox

J. just(1) : (R)ight (L)eft (C)ent.

K. do_sum(1) : sum up

L. no_out(1) : (O)blig.(X)no out

M. outputlen : output length

N. seltext_l : long key word

O. seltext_m : middle key word

P. seltext_s : short key word

Q. reptext_ddic : heading (ddic)

R. ddictxt(1) : (S)hort (M)iddle (L)ong

S. datatype : datatype

T. hotspot(1) : hotspot

Regards,

Raj.

7 REPLIES 7
Read only

Former Member
0 Likes
764

this is because there are several formatting options in field catalog and many events like hotspot,double click and moreover in menu options there are so many options like sorting ,choosing layout,summation,and view as excel sheet.

SAP provides a set of ALV (ABAP List Viewer) & function modules, which can be used to enhance the readability and functionality of any report output.

ALV is a flexible tool used for displaying lists.The tool provides common list functions & can be enhanced by self-defined options.

ALV makes things better for you, your organization, and the people you need to communicate with.

ALV lets you:

‣ Fonts and format text elements

‣ Sorting and filtering without extra programming.

‣ Totals & Subtotals

‣ Apply and modify built-in functions

‣ Add a response to a user-action (double-clicking,hotspots).

‣ Print lists or export them to other applications.

‣ Define and save custom output settings.

Built-in functionality

Sorting

Summing

Subtotals

Filtering

Download to external applications

Excel, Word, Text, .csv

Navigation to SAP transactions

Reduced Report Development Time and Cost

Developer doesn’t have to spend as much time on report layout (columns, spacing, sorting, totals, subtotals).

Coding is reduced.

ALV lets you emphasize, hide, and reformat list items; add graphic elements.

Future enhancements are minimized

User can select report fields, sort criteria, totals and subtotals usually without the need to request an ABAP enhancement.

User can save a report with a display variant

plz reawrd if useful

vivek

Edited by: Vivek Gaur on Apr 16, 2008 12:46 PM

Read only

Former Member
0 Likes
764

In alv user can use his own filters, ascending / descending orders, Coumns can be displayed according to variants.

Easily can get subtotals and grand totals

Read only

Former Member
0 Likes
764

Hi,

Normal reports need extensive coding for formatting and alignment whereas ALV have the advantage of good look and feel and also need minimal coding.Also ALV reports can be made interactive and the fields can be made editable.

Using the alv the report headers will automatically be shown based on the attributes of the field..The output length of the column, field allignment everything is taken care by the alv. Normal reports you have to take care of the alignment , report headings.

Regards,

Satish

Read only

Former Member
0 Likes
764

Hi,

ABAP List Viewer

The common features of report are column alignment, sorting, filtering, subtotals, totals etc. To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV).

Using ALV, we can have three types of reports:

1. Simple Report

2. Block Report

3. Hierarchical Sequential Report

Interactive Reports

As the name suggests, the user can Interact with the report. We can have a drill down into the report data.

Purpose

Interactive report provides you with comfortable functions for navigating through your data.

Use

Interactive report are used to display multiple list in one single report

It has basic list and then you can navigate to one or other screens in one single report

Enhance the efficiency & transparency of Business Processes

Example : Column one of the report displays the material numbers, and the user feels that he needs some more specific data about the vendor for that material, he can HIDE that data under those material numbers.

And when the user clicks the material number, another report (actually sub report/secondary list) which displays the vendor details.

Advantage of ALV over Interactive:--

1> Graphic Can be added

2> Less Amount Of coding

OR

Interactive reports are the normal reports in which we can have upto 20 lists.

classical report can have only one list.

alv report is the one which does not use write statements for the list display, instead uses function modules which looks very better than normal list.

1.

Interactive and ALV are not two different reports types.

2.

Interctive reports means user can Intercat with the report output.

examples:

a.Double clicking on the report output.

b.Clicking on the buttons

3.

Interactive report can be a Classical report or ALV report

4.

ALV is List presentation tool with generic functionality(Std Functions).

Technically If we pass Internal table to Function module or Methods it displays as Report

ALV interactive report gives many advantages than interactive report like sorting, summing and getting graphics.

An interactive report generally basic list displayed. User double clicks on any valid line or user selects a line and presses as button on the tool bar. Then the corresponding event is triggered.

Regards,

Nehru.

Read only

Former Member
0 Likes
765

Hi,

using the alv the report headers will automatically be shown based on the attributes of the field..The output length of the column, field allignment everything is taken care by the alv ..

normal reports..you have to take care of the alignment , report headings..

A classical report is a program that generates a single list, which must contain all of the required detail information.

1) This procedure may result in extensive lists from which the user has to pick the relevant data.

2) For background processing, this is the only possible method. After starting a background job, there is no way of influencing the program.

3) The desired selections must be made beforehand and the list must provide detailed information.

4) For dialog sessions, there are no such restrictions.

5) The user is present during the execution of the program and can control and manipulate the program flow directly.

6) To be able to use all advantages of the online environment, classical reporting was developed into interactive reporting.

ALV is Application List viewer. Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length. In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output. The report output can contain up to 90 columns in the display with the wide array of display options.

Advantages.

Collapse multiple reports into one, drastically cutting down your report development time

Save many hours using built-in ALV sorting, subtotaling and filtering capabilities

Add conditional structures into your ALV report: No programming required!

Combine ALV with display variants to meet a wide range of reporting requirements more easily

Dynamically reorder column layouts and add/subtract fields

Enable users and analysts to save their own personalized variants

All the definitions of internal tables, structures and constants are declared in a type-pool called SLIS.

1. SIMPLE REPORT.

The important function modules are

a. Reuse_alv_list_display

b. Reuse_alv_fieldcatalog_merge

c. Reuse_alv_events_get

d. Reuse_alv_commentary_write

e. Reuse_alv_grid_display

A. REUSE_ALV_LIST_DISPLAY : This is the function module which prints the data.

The important parameters are :

I. Export :

i. I_callback_program : report id

ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the functionality of the existing pf status

iii. I_callback_user_command : routine where the function codes are handled

iv. I_structure name : name of the dictionary table

v. Is_layout : structure to set the layout of the report

vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function module REUSE_ALV_FIELDCATALOG_MERGE

vii. It_events : internal table with a list of all possible events of ALV and their corresponding form names.

II. Tables :

i. t_outtab : internal table with the data to be output

B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.

The Important Parameters are :

I. Export :

i. I_program_name : report id

ii. I_internal_tabname : the internal output table

iii. I_inclname : include or the report name where all the dynamic forms are handled.

II Changing

ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is

declared in the type pool SLIS.

C. REUSE_ALV_EVENTS_GET : Returns table of possible events for a list type

Parameters :

I. Import :

Et_Events : The event table is returned with all possible CALLBACK events

for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV.

II. Export :

I_List_type :

0 = simple list REUSE_ALV_LIST_DISPLAY

1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY

2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND

3 = hierarchical-sequential block list

REUSE_ALV_BLOCK_LIST_HS_APPEND

D. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.

Parameters :

I. it_list_commentary : internal table with the headings of the type slis_t_listheader.

This internal table has three fields :

Typ : ‘H’ – header, ‘S’ – selection , ‘A’ - action

Key : only when typ is ‘S’.

Info : the text to be printed

E. REUSE_ALV_GRID_DISPLAY : A new function in 4.6 version, to display the results in grid rather than as a preview.

Parameters : same as reuse_alv_list_display

This is an example for simple list.

2. BLOCK REPORT

This is used to have multiple lists continuously.

The important functions used in this report are:

A. REUSE_ALV_BLOCK_LIST_INIT

B. REUSE_ALV_BLOCK_LIST_APPEND

C. REUSE_ALV_BLOCK_LIST_HS_APPEND

D. REUSE_ALV_BLOCK_LIST_DISPLAY

A. REUSE_ALV_BLOCK_LIST_INIT

Parameters:

I. I_CALLBACK_PROGRAM

II. I_CALLBACK_PF_STATUS_SET

III. I_CALLBACK_USER_COMMAND

This function module is used to set the default gui status etc.

B. REUSE_ALV_BLOCK_LIST_APPEND

Parameters :

Export :

I. is_layout : layout settings for block

II. it_fieldcat : field catalog

III. i_tabname : internal table name with output data

IV. it_events : internal table with all possible events

Tables :

i. t_outtab : internal table with output data.

This function module adds the data to the block.

Repeat this function for all the different blocks to be displayed one after the other.

C. REUSE_ALV_BLOCK_LIST_HS_APPEND

This function module is used for hierarchical sequential blocks.

D. REUSE_ALV_BLOCK_LIST_DISPLAY

Parameters : All the parameters are optional.

This function module display the list with data appended by the above function.

Here the functions REUSE_ALV_FIELDCATALOG_MERGE, REUSE_ALV_EVENTS_GET, REUSE_ALV_COMMENTARY_WRITE can be used.

3. Hierarchical reports :

Hierarchical sequential list output.

The function module is

A. REUSE_ALV_HIERSEQ_LIST_DISPLAY

Parameters:

I. Export:

i. I_CALLBACK_PROGRAM

ii. I_CALLBACK_PF_STATUS_SET

iii. I_CALLBACK_USER_COMMAND

iv. IS_LAYOUT

v. IT_FIELDCAT

vi. IT_EVENTS

vii. i_tabname_header : Name of the internal table in the program containing the

output data of the highest hierarchy level.

viii. i_tabname_item : Name of the internal table in the program containing the

output data of the lowest hierarchy level.

ix. is_keyinfo : This structure contains the header and item table field

names which link the two tables (shared key).

II. Tables

i. t_outtab_header : Header table with data to be output

ii. t_outtab_item : Name of the internal table in the program containing the

output data of the lowest hierarchy level.

slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be populated automatically by using ‘REUSE_ALV_FIELDCATALOG_MERGE’.

Important Attributes :

A. col_pos : position of the column

B. fieldname : internal fieldname

C. tabname : internal table name

D. ref_fieldname : fieldname (dictionary)

E. ref_tabname : table (dictionary)

F. key(1) : column with key-color

G. icon(1) : icon

H. symbol(1) : symbol

I. checkbox(1) : checkbox

J. just(1) : (R)ight (L)eft (C)ent.

K. do_sum(1) : sum up

L. no_out(1) : (O)blig.(X)no out

M. outputlen : output length

N. seltext_l : long key word

O. seltext_m : middle key word

P. seltext_s : short key word

Q. reptext_ddic : heading (ddic)

R. ddictxt(1) : (S)hort (M)iddle (L)ong

S. datatype : datatype

T. hotspot(1) : hotspot

Regards,

Raj.

Read only

Former Member
0 Likes
764

hi because

1 .it is easy to built the catalog

2. you can get a better output in different formats

3. you can rearrange the layout and fields and you can hide some fields with out changing the code

4. you can get the default colours for the output

ex for totals and subtotals.

5. you can display the logo on the selection screen

many uses r there ...if you works with the alv you came to know...check this for testing...

http://www.saptechnical.com/Tutorials/ALV/ALVMainPage.htm

regards,

venkat

Read only

Former Member
0 Likes
764

ALV means ABAP List Viewer.ALV is available in two modes:

list and grid.

List mode is good old list processing with

standard functionnalities, and grid mode is using a new OCX

object displaying grids.

introduce a type group with type-pool.

maintain a type group via abap dictionary.

for simple alv:

slis_alv_fieldcatalog : populate the fieldcatalog

slis_layout_alv : it is for layout

slis_alv_events : it is for internal tables events

we use simple function modules for displaying ALV grid.can have sorting facility with ALV grid

i hope its useful..

reward points if useful.