Application Development 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: 

Two ALV on Selection Screen

Former Member
0 Kudos

Hi Abapers,

I have small query

<b>Can we add Two ALV on the selection Screen. I am not talking about OOALV or not Block ALV</b>

Please suggest if it can be possible to create two ALV on screen using Simple ABAP.

7 REPLIES 7

Former Member
0 Kudos

Hi

chk this stndard pgm -. <b>BALVBT01</b>

Regards

Reshma

p291102
Active Contributor
0 Kudos

HI,

REPORT YMS_TWOALV .

TYPE-POOLS: slis.

DATA: BEGIN OF i_clients OCCURS 0,

mandt LIKE t000-mandt,

mtext LIKE t000-mtext,

ort01 LIKE t000-ort01.

DATA: END OF i_clients.

DATA: BEGIN OF i_industry OCCURS 0,

mandt LIKE t016t-mandt,

spras LIKE t016t-spras,

brsch LIKE t016t-brsch,

brtxt LIKE t016t-brtxt.

DATA: END OF i_industry.

DATA: i_fcat_c TYPE slis_t_fieldcat_alv,

i_fcat_i TYPE slis_t_fieldcat_alv.

DATA: i_layout_c TYPE slis_layout_alv.

DATA: i_layout_i TYPE slis_layout_alv.

DATA: i_events_c TYPE slis_t_event.

DATA: i_events_i TYPE slis_t_event.

DATA: gt_print TYPE slis_print_alv.

START-OF-SELECTION.

*BREAK-POINT.

SELECT mandt mtext ort01

FROM t000 INTO CORRESPONDING FIELDS OF TABLE i_clients.

SELECT mandt spras brsch brtxt

FROM t016t INTO CORRESPONDING FIELDS OF TABLE i_industry.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = 'ZKB_BLOCK_LIST_REPORT'

i_internal_tabname = 'I_CLIENTS'

  • I_STRUCTURE_NAME = 'T000'

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = 'ZKB_BLOCK_LIST_REPORT'

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

ct_fieldcat = i_fcat_c

EXCEPTIONS

inconsistent_interface = 1

program_error = 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.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = 'ZKB_BLOCK_LIST_REPORT'

i_internal_tabname = 'I_INDUSTRY'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = 'ZKB_BLOCK_LIST_REPORT'

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

ct_fieldcat = i_fcat_i

EXCEPTIONS

inconsistent_interface = 1

program_error = 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.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

EXPORTING

i_callback_program = 'ZKB_BLOCK_LIST_REPORT'

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • IT_EXCLUDING =

.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = i_layout_c

it_fieldcat = i_fcat_c

i_tabname = 'I_CLIENTS'

it_events = i_events_c

  • IT_SORT =

  • I_TEXT = ' '

TABLES

t_outtab = i_clients

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

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = i_layout_i

it_fieldcat = i_fcat_i

i_tabname = 'I_INDUSTRY'

it_events = i_events_i

  • IT_SORT =

  • I_TEXT = ' '

TABLES

t_outtab = i_industry

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

gt_print-reserve_lines = 2.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

is_print = gt_print

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

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

Thanks,

Sankar M

Former Member
0 Kudos

Thanks Buddy,

Both the Program executes for ''REUSE_ALV_BLOCK_LIST_APPEND''

Which I Have already implemented

I want any other alternative for displaying of the 2 ALV on screen.

Please suggest me.

former_member188685
Active Contributor
0 Kudos

Can you be more clear on your Question.

Regards

Vijay

0 Kudos

Hi Vijay,

I have small query

<b>Can we add Two ALV on the Screen. I am not talking about OOALV or not Block ALV

Please suggest if it can be possible to create two ALV on screen using Simple ABAP.</b>

Former Member
0 Kudos

Hi chidanand

What is two ALV?

Vijaya

Former Member
0 Kudos

Hi Chidanand Chauhan,

It is not possible to display 2 ALV's in the same screen without using either OOALV or Blocked ALV.