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

Problem in alv

Former Member
0 Likes
714

Hi

I want to know how can i build group of alv in one screen.

The fields in the alv's will be different.

For example:

In alv 1 i will have fields material , description.

In alv 2 i will have fields company code , plant.

In alv 3 i will have fields material , kind , unit.

i want the all the alv will be in one screen.

Thanks

have a nice day

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
689

cehck ALV blocking

Regards

Prabhu

6 REPLIES 6
Read only

Former Member
0 Likes
689

You can do it using OO abap & module pool programming.

Read only

Former Member
0 Likes
690

cehck ALV blocking

Regards

Prabhu

Read only

Former Member
0 Likes
689

Hi,

Solution is a Blocked ALV List

for example refer to

REPORT zvnm_blocked_alv.

TYPE-POOLS: slis.

DATA: BEGIN OF it_ekko OCCURS 0,

ebeln TYPE ebeln,

bukrs TYPE bukrs,

END OF it_ekko,

BEGIN OF it_ekpo OCCURS 0,

ebeln TYPE ebeln,

ebelp TYPE ebelp,

END OF it_ekpo,

it_fieldcat1 TYPE slis_t_fieldcat_alv WITH HEADER LINE,

it_fieldcat2 TYPE slis_t_fieldcat_alv WITH HEADER LINE,

it_events1 TYPE slis_t_event WITH HEADER LINE,

it_events2 TYPE slis_t_event WITH HEADER LINE,

st_layout TYPE slis_layout_alv,

v_ebeln TYPE ebeln.

SELECT-OPTIONS: s_ebeln FOR v_ebeln.

START-OF-SELECTION.

SELECT ebeln

bukrs

FROM ekko

INTO TABLE it_ekko

WHERE ebeln IN s_ebeln.

SELECT ebeln

ebelp

FROM ekpo

INTO TABLE it_ekpo

WHERE ebeln IN s_ebeln.

it_fieldcat1-fieldname = 'EBELN'.

it_fieldcat1-tabname = 'IT_EKKO'.

it_fieldcat1-seltext_l = 'PO Number'.

APPEND it_fieldcat1.

CLEAR it_fieldcat1.

it_fieldcat1-fieldname = 'BUKRS'.

it_fieldcat1-tabname = 'IT_EKKO'.

it_fieldcat1-seltext_l = 'Company Code'.

APPEND it_fieldcat1.

CLEAR it_fieldcat1.

  • Item

it_fieldcat2-fieldname = 'EBELN'.

it_fieldcat2-tabname = 'IT_EKPO'.

it_fieldcat2-seltext_l = 'PO Number'.

APPEND it_fieldcat2.

CLEAR it_fieldcat2.

it_fieldcat2-fieldname = 'EBELP'.

it_fieldcat2-tabname = 'IT_EKPO'.

it_fieldcat2-seltext_l = 'PO Item Number'.

APPEND it_fieldcat2.

CLEAR it_fieldcat2.

it_events1-name = 'TOP_OF_PAGE'.

it_events1-form = 'F_TOP_OF_PAGE_ONE'.

APPEND it_events1.

CLEAR it_events1.

it_events2-name = 'TOP_OF_PAGE'.

it_events2-form = 'F_TOP_OF_PAGE_TWO'.

APPEND it_events2.

CLEAR it_events2.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

EXPORTING

i_callback_program = sy-repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • IT_EXCLUDING = IT_EXCLUDING

.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = st_layout

it_fieldcat = it_fieldcat1[]

i_tabname = 'IT_EKKO'

it_events = it_events1[]

  • IT_SORT = IT_SORT

  • I_TEXT = ' '

TABLES

t_outtab = it_ekko[]

  • 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 = st_layout

it_fieldcat = it_fieldcat2[]

i_tabname = 'IT_EKPO'

it_events = it_events2[]

  • IT_SORT = IT_SORT

  • I_TEXT = ' '

TABLES

t_outtab = it_ekpo[]

  • 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_DISPLAY'

  • EXPORTING

  • I_INTERFACE_CHECK = ' '

  • IS_PRINT = IS_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 = E_EXIT_CAUSED_BY_CALLER

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

&----


*& Form top_of_page_one

&----


  • text

----


FORM f_top_of_page_one.

WRITE: / 'Header details'.

ENDFORM. "top_of_page_one

&----


*& Form top_of_page_one

&----


  • text

----


FORM f_top_of_page_two.

WRITE: / 'Item details'.

ENDFORM. "top_of_page_one

santhosh

Read only

former_member632991
Active Contributor
0 Likes
689

Hi,

you can have more than one ALV in the same screen using OO ALV

(basically you can create more than 1 instance of the same class and embed to differenct containers) and display different data.

<b>check this programBALVBT01</b>

and link

Regards,

Sonika

Read only

Former Member
0 Likes
689

chk this if it suits your requirement

Read only

Former Member
0 Likes
689

Hello,

Use alv block.

funtions involved are.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

Call this function three times passing three different tables as per your requirement..

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'