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

Alv Append list

Former Member
0 Likes
628

Hi ,

I created a Alv append list report which has more than 4 to 5 tables to display.

I have used the function module REUSE_ALV_LIST_DISPLAY and set the parameter cs_layo-list_append = 'Y' to display the list. When the first table doesn't have any data it just displaya an empty table with the information

'The list contains No data'. I do not want to display the first table if it doesnt have any data. is it possible as it is an append list?

Thanks & Regards,

Christina.

2 REPLIES 2
Read only

Former Member
0 Likes
436

Hi kinnera,

1. This simple program will give u an idea

of block alv.

(more than two internal tables)

2. It will print two alv

a) itab = table from t001

b) ptab = table from t000

3. Just copy paste in new program.

REPORT zam_temp54 .

type-pools : slis.

data : alvfc type slis_t_fieldcat_alv.

data : alvly type slis_layout_alv.

data : alvev type slis_t_event .

*----


DATA : BEGIN OF itab OCCURS 0.

include structure t001.

DATA: END OF itab.

DATA : BEGIN OF ptab OCCURS 0.

INCLUDE STRUCTURE t000.

DATA: END OF ptab..

*----


PARAMETERS : a TYPE c.

*----


start-of-selection.

*----


SELECT DATA

SELECT * FROM t001 into table itab.

select * from t000 into table ptab.

*----


INIT BLOCK ALV

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

EXPORTING

i_callback_program = sy-repid.

*----


ADD INTERNAL TABLE ITAB

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = SY-REPID

I_INTERNAL_TABNAME = 'ITAB'

I_INCLNAME = SY-REPID

CHANGING

CT_FIELDCAT = ALVFC.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = alvly

it_fieldcat = alvfc

i_tabname = 'ITAB'

it_events = alvev

TABLES

t_outtab = ITAB

EXCEPTIONS

program_error = 1

maximum_of_appends_reached = 2

OTHERS = 3.

*----


ADD INTERNAL TABLE PTAB

REFRESH ALVFC[].

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = SY-REPID

I_INTERNAL_TABNAME = 'PTAB'

I_INCLNAME = SY-REPID

CHANGING

CT_FIELDCAT = ALVFC.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = alvly

it_fieldcat = alvfc

i_tabname = 'PTAB'

it_events = alvev

TABLES

t_outtab = PTAB

EXCEPTIONS

program_error = 1

maximum_of_appends_reached = 2

OTHERS = 3.

*----


DISPLAY

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'

EXCEPTIONS

program_error = 1

OTHERS = 2.

regards,

amit m.

Read only

Former Member
0 Likes
436

Hello Amit,

I need your help in blocking the display of the list list if it doesnt have any information. If the table table doesnt have any entries it display an empty table with the text 'Table contains no info'. I do not want to display this empty table.

Regards,

Christina