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

Doubt on ALVs

Former Member
0 Likes
586

Hi everybody,

I have some doubt regarding ALV's plz clarify them

What are major differences between these ALVs and when to go for this ALVs

1.SIMPLE ALVs

2.HIERARCHICAL ALVs

3. BLOCKED ALVs.

plz clarify these answers good answers will be definetly rewarded.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
542

Hi Smitha,

Some more to add the alv details are :

All the definitions of internal tables, structures and

constants are declared in a type-pool called SLIS.

<b>1. SIMPLE REPORT.</b>

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.

<b>2. BLOCK REPORT</b>

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.

<b>Here the functions</b>

REUSE_ALV_FIELDCATALOG_MERGE,

REUSE_ALV_EVENTS_GET,

REUSE_ALV_COMMENTARY_WRITE can be used.

<b>

3. Hierarchical reports :</b>

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’.

<b>

Important Attributes :</b>

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

<b>The important function modules are</b>

a. Reuse_alv_list_display:This is the function module which prints the data.

b. Reuse_alv_fieldcatalog_merge:his function module is used to

populate a fieldcatalog which is essential to display the data in ALV.

c. Reuse_alv_events_get:Returns table of possible events for a list type

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

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

blocked list: :

This is used to have multiple lists continuously.

<b>The important functions used in this report are:</b>

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

<b>Hirarcial list :</b>

if u want to display daat hirarchialy we use this.

for example if u want tp print header data and corresponding items we use this

<b>Reward pts if found usefull:)</b>

regards

Sathish

4 REPLIES 4
Read only

Former Member
0 Likes
542

hi Smitha,

Check out the below link where you will find the sample programs for the mentioned alv's

http://www.sap-img.com/abap-function.htm

Read only

Former Member
0 Likes
542

Hi Smitha,

<b>ALV</b>

http://www.geocities.com/mpioud/Abap_programs.html

http://www.sapdevelopment.co.uk/reporting/reportinghome.htm

Simple ALV report

http://www.sapgenie.com/abap/controls/alvgrid.htm

http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox

ALV

1. Please give me general info on ALV.

http://www.sapfans.com/forums/viewtopic.php?t=58286

http://www.sapfans.com/forums/viewtopic.php?t=76490

http://www.sapfans.com/forums/viewtopic.php?t=20591

http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.

2. How do I program double click in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=11601

http://www.sapfans.com/forums/viewtopic.php?t=23010

3. How do I add subtotals (I have problem to add them)...

http://www.sapfans.com/forums/viewtopic.php?t=20386

http://www.sapfans.com/forums/viewtopic.php?t=85191

http://www.sapfans.com/forums/viewtopic.php?t=88401

http://www.sapfans.com/forums/viewtopic.php?t=17335

4. How to add list heading like top-of-page in ABAP lists?

http://www.sapfans.com/forums/viewtopic.php?t=58775

http://www.sapfans.com/forums/viewtopic.php?t=60550

http://www.sapfans.com/forums/viewtopic.php?t=16629

5. How to print page number / total number of pages X/XX in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)

6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.

http://www.sapfans.com/forums/viewtopic.php?t=64320

http://www.sapfans.com/forums/viewtopic.php?t=44477

7. How can I set the cell color in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=52107

8. How do I print a logo/graphics in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=81149

http://www.sapfans.com/forums/viewtopic.php?t=35498

http://www.sapfans.com/forums/viewtopic.php?t=5013

9. How do I create and use input-enabled fields in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=84933

http://www.sapfans.com/forums/viewtopic.php?t=69878

10. How can I use ALV for reports that are going to be run in background?

http://www.sapfans.com/forums/viewtopic.php?t=83243

http://www.sapfans.com/forums/viewtopic.php?t=19224

11. How can I display an icon in ALV? (Common requirement is traffic light icon).

http://www.sapfans.com/forums/viewtopic.php?t=79424

http://www.sapfans.com/forums/viewtopic.php?t=24512

12. How can I display a checkbox in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=88376

http://www.sapfans.com/forums/viewtopic.php?t=40968

http://www.sapfans.com/forums/viewtopic.php?t=6919

Go thru these programs they may help u to try on some hands on

ALV Demo program

BCALV_DEMO_HTML

BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode

BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode

BCALV_GRID_DEMO Simple ALV Control Call Demo Program

BCALV_TREE_DEMO Demo for ALV tree control

BCALV_TREE_SIMPLE_DEMO

BC_ALV_DEMO_HTML_D0100

Regards

Sathish

Read only

Former Member
0 Likes
542

hi

the basic criteria is

1) Display quality

2) Additional functionality

3) Your Need

<b>criteria to choose between the grid and list display. </b>

Grid cannot handle high volumes.

Functions like sort, scrolling down are possible with grid

<b>block report</b>

This report is used if you have to display more than one report on the output. Technically speaking if you have multiple internal table with data to be displayed as separate blocks then we go for block report of ALV

<b>Hierarchical display</b>

Hierarchical display is used for displaying data that are related. Like sales order and item details. Here sales order details can be the header data whereas them items in the sales order can be the item data

Hope this helps

<b>if it helped, you can acknowledge the same by rewarding</b>

regards

dinesh

Read only

Former Member
0 Likes
543

Hi Smitha,

Some more to add the alv details are :

All the definitions of internal tables, structures and

constants are declared in a type-pool called SLIS.

<b>1. SIMPLE REPORT.</b>

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.

<b>2. BLOCK REPORT</b>

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.

<b>Here the functions</b>

REUSE_ALV_FIELDCATALOG_MERGE,

REUSE_ALV_EVENTS_GET,

REUSE_ALV_COMMENTARY_WRITE can be used.

<b>

3. Hierarchical reports :</b>

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’.

<b>

Important Attributes :</b>

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

<b>The important function modules are</b>

a. Reuse_alv_list_display:This is the function module which prints the data.

b. Reuse_alv_fieldcatalog_merge:his function module is used to

populate a fieldcatalog which is essential to display the data in ALV.

c. Reuse_alv_events_get:Returns table of possible events for a list type

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

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

blocked list: :

This is used to have multiple lists continuously.

<b>The important functions used in this report are:</b>

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

<b>Hirarcial list :</b>

if u want to display daat hirarchialy we use this.

for example if u want tp print header data and corresponding items we use this

<b>Reward pts if found usefull:)</b>

regards

Sathish