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

multiple internal table display

Former Member
0 Likes
402

Hi All,

I have query regarding the internal tables,

Is it possible to display more than one internal table in ABAP List view

one beneath another......in the same page.....?

thanks in advance.....

1 ACCEPTED SOLUTION
Read only

former_member386202
Active Contributor
0 Likes
377

Hi,

Yes, in classical do like this

loop at itab.

write:/

endloop.

loop at itab1.

write:/

endloop.

and in alv refer this code.

&----


*& Form sub_alv_display *

&----


  • This form displays the output using REUSE_ALV_GRID_DISPLAY *

  • function module *

----


FORM sub_alv_display .

*--Local Variables

DATA : lv_index LIKE sy-tabix.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

EXPORTING

i_callback_program = v_repid.

wa_layout1-colwidth_optimize = 'X'.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = wa_layout1

it_fieldcat = it_fieldcat[]

i_tabname = 'it_final'

it_events = it_events

TABLES

t_outtab = it_final

EXCEPTIONS

program_error = 1

maximum_of_appends_reached = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

LOOP AT it_fieldcat INTO wa_fieldcat.

lv_index = sy-tabix.

IF wa_fieldcat-fieldname = 'ERDAT'.

wa_fieldcat-fieldname = 'TITLE'.

wa_fieldcat-seltext_m = text-026.

wa_fieldcat-outputlen = 10.

ENDIF.

MODIFY it_fieldcat FROM wa_fieldcat INDEX lv_index TRANSPORTING

fieldname seltext_m outputlen.

CLEAR : wa_fieldcat.

ENDLOOP.

wa_layout2-no_colhead = 'X'.

wa_layout2-colwidth_optimize = 'X'.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = wa_layout2

it_fieldcat = it_fieldcat[]

i_tabname = 'it_total'

it_events = it_event1

TABLES

t_outtab = it_total

EXCEPTIONS

program_error = 1

maximum_of_appends_reached = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

wa_layout3-no_colhead = 'X'.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = wa_layout3

it_fieldcat = it_fieldcat2[]

i_tabname = 'it_ship'

it_events = it_event2

TABLES

t_outtab = it_ship

EXCEPTIONS

program_error = 1

maximum_of_appends_reached = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

IF NOT it_final IS INITIAL OR

NOT it_total IS INITIAL OR

NOT it_ship IS INITIAL.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDIF.

ENDFORM. "sub_alv_display

Regards,

Prashant

1 REPLY 1
Read only

former_member386202
Active Contributor
0 Likes
378

Hi,

Yes, in classical do like this

loop at itab.

write:/

endloop.

loop at itab1.

write:/

endloop.

and in alv refer this code.

&----


*& Form sub_alv_display *

&----


  • This form displays the output using REUSE_ALV_GRID_DISPLAY *

  • function module *

----


FORM sub_alv_display .

*--Local Variables

DATA : lv_index LIKE sy-tabix.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

EXPORTING

i_callback_program = v_repid.

wa_layout1-colwidth_optimize = 'X'.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = wa_layout1

it_fieldcat = it_fieldcat[]

i_tabname = 'it_final'

it_events = it_events

TABLES

t_outtab = it_final

EXCEPTIONS

program_error = 1

maximum_of_appends_reached = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

LOOP AT it_fieldcat INTO wa_fieldcat.

lv_index = sy-tabix.

IF wa_fieldcat-fieldname = 'ERDAT'.

wa_fieldcat-fieldname = 'TITLE'.

wa_fieldcat-seltext_m = text-026.

wa_fieldcat-outputlen = 10.

ENDIF.

MODIFY it_fieldcat FROM wa_fieldcat INDEX lv_index TRANSPORTING

fieldname seltext_m outputlen.

CLEAR : wa_fieldcat.

ENDLOOP.

wa_layout2-no_colhead = 'X'.

wa_layout2-colwidth_optimize = 'X'.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = wa_layout2

it_fieldcat = it_fieldcat[]

i_tabname = 'it_total'

it_events = it_event1

TABLES

t_outtab = it_total

EXCEPTIONS

program_error = 1

maximum_of_appends_reached = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

wa_layout3-no_colhead = 'X'.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = wa_layout3

it_fieldcat = it_fieldcat2[]

i_tabname = 'it_ship'

it_events = it_event2

TABLES

t_outtab = it_ship

EXCEPTIONS

program_error = 1

maximum_of_appends_reached = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

IF NOT it_final IS INITIAL OR

NOT it_total IS INITIAL OR

NOT it_ship IS INITIAL.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDIF.

ENDFORM. "sub_alv_display

Regards,

Prashant