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: 

Alv interactive reporting

Former Member
0 Kudos

What is Alv interactive reporting ? what r the events used in it?

Can I get a sample program.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI

ALV interactive means its same as intercative report

when you click on the basic list it will display a secondary list or detailed list

events are same as interactive report TOP-OF-page , END-OF-PAGE, START-OF-SELECTION, INITIALIZATION,AT SELECTION

example code to diplay a logo on the top-of-page

&----


*& Report ZTEST_ALV_LOGO

*&

&----


*&

*&

&----


REPORT ztest_alv_logo.

TYPE-POOLS : slis.

*ALV Formatting tables /structures

DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.

DATA: gt_events TYPE slis_t_event.

DATA: gs_layout TYPE slis_layout_alv.

DATA: gt_page TYPE slis_t_listheader.

DATA: gs_page TYPE slis_listheader.

DATA: v_repid LIKE sy-repid.

*ALV Formatting work area

DATA: w_fieldcat TYPE slis_fieldcat_alv.

DATA: w_events TYPE slis_alv_event.

DATA: gt_bsid TYPE TABLE OF bsid WITH HEADER LINE.

INITIALIZATION.

PERFORM build_events.

PERFORM build_page_header.

START-OF-SELECTION.

*perform build_comment. "top_of_page - in initialization at present

SELECT * FROM bsid INTO TABLE gt_bsid UP TO 10 ROWS.

*perform populate_for_fm using '1' '3' 'BUKRS' '8' 'GT_BSID' 'Whee'.

*USING = Row, Column, Field name, display length, table name, heading

*OR

PERFORM build_fieldcat.

gs_layout-zebra = 'X'.

*top of page event does not work without I_callback_program

v_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = v_repid

i_structure_name = 'BSID'

  • i_background_id = 'ALV_BACKGROUND'

i_grid_title = 'This is the grid title'

  • I_GRID_SETTINGS =

is_layout = gs_layout

it_fieldcat = gt_fieldcat[]

it_events = gt_events[]

TABLES

t_outtab = gt_bsid.

************************************************************************

  • Form..............: populate_for_fm

  • Description.......: Populates fields for function module used in ALV

************************************************************************

FORM populate_for_fm USING p_row

p_col

p_fieldname

p_len

p_table

p_desc.

w_fieldcat-row_pos = p_row. "Row Position

w_fieldcat-col_pos = p_col. "Column Position

w_fieldcat-fieldname = p_fieldname. "Field name

w_fieldcat-outputlen = p_len. "Column Lenth

w_fieldcat-tabname = p_table. "Table name

w_fieldcat-reptext_ddic = p_desc. "Field Description

w_fieldcat-input = '1'.

APPEND w_fieldcat TO gt_fieldcat.

CLEAR w_fieldcat.

ENDFORM. " populate_for_fm

&----


*& Form build_events

&----


FORM build_events.

DATA: ls_event TYPE slis_alv_event.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = gt_events.

READ TABLE gt_events

WITH KEY name = slis_ev_user_command

INTO ls_event.

IF sy-subrc = 0.

MOVE slis_ev_user_command TO ls_event-form.

APPEND ls_event TO gt_events.

ENDIF.

READ TABLE gt_events

WITH KEY name = slis_ev_top_of_page

INTO ls_event.

IF sy-subrc = 0.

MOVE slis_ev_top_of_page TO ls_event-form.

APPEND ls_event TO gt_events.

ENDIF.

ENDFORM. " build_events

&----


*& Form USER_COMMAND

&----


  • When user command is called it uses 2 parameters. The itab

  • passed to the ALV is in whatever order it currently is on screen.

  • Therefore, you can read table itab index rs_selfield-tabindex to get

  • all data from the table. You can also check r_ucomm and code

  • accordingly.

&----


FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

READ TABLE gt_bsid INDEX rs_selfield-tabindex.

  • error checking etc.

SET PARAMETER ID 'KUN' FIELD gt_bsid-kunnr.

CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.

ENDFORM. "user_command

&----


*& Form top_of_page

&----


  • Your own company logo can go here if it has been saved (OAOR)

  • If the logo is larger than the size of the headings in gt_page,

  • the window will not show full logo and will have a scroll bar. Thus,

  • it is a good idea to have a standard ALV header if you are going to

  • use logos in your top of page.

&----


FORM top_of_page.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = gt_page

i_logo = 'ENJOYSAP_LOGO'.

ENDFORM. "top_of_page

&----


*& Form build_fieldcat

&----


*Many and varied fields are available here. Have a look at documentation

*for FM REUSE_ALV_LIST_DISPLAY and REUSE_ALV_FIELDCATALOG_MERGE

----


FORM build_fieldcat.

w_fieldcat-fieldname = 'BUDAT'.

w_fieldcat-seltext_m = 'Dte pst'.

w_fieldcat-ddictxt(1) = 'M'.

w_fieldcat-edit = 'x'.

  • Can change the position of fields if you do not want them in order

  • of the DDIC or itab

  • w_fieldcat-row_pos = '1'.

  • w_fieldcat-col_pos = '10'.

APPEND w_fieldcat TO gt_fieldcat.

CLEAR w_fieldcat.

ENDFORM. " build_fieldcat

&----


*& Form build_page_header

&----


  • gt_page is used in top of page (ALV subroutine - NOT event)

  • *H = Header, S = Selection, A = Action

----


FORM build_page_header.

  • For Headers, Key is not printed and is irrelevant. Will not cause

  • a syntax error, but is not used.

gs_page-typ = 'H'.

gs_page-info = 'Header 1'.

APPEND gs_page TO gt_page.

gs_page-typ = 'H'.

gs_page-info = 'Header 2'.

APPEND gs_page TO gt_page.

  • For Selections, the Key is printed (bold). It can be anything up to 20

  • bytes. It gets printed in order of code here, not by key value.

gs_page-typ = 'S'.

gs_page-key = 'And the winner is:'.

gs_page-info = 'Selection 1'.

APPEND gs_page TO gt_page.

gs_page-typ = 'S'.

gs_page-key = 'Runner up:'.

gs_page-info = 'Selection 2'.

APPEND gs_page TO gt_page.

  • For Action, Key is also irrelevant.

gs_page-typ = 'A'.

gs_page-info = 'Action goes here'.

APPEND gs_page TO gt_page.

ENDFORM. " build_page_header

3 REPLIES 3

Former Member
0 Kudos

HI

ALV interactive means its same as intercative report

when you click on the basic list it will display a secondary list or detailed list

events are same as interactive report TOP-OF-page , END-OF-PAGE, START-OF-SELECTION, INITIALIZATION,AT SELECTION

example code to diplay a logo on the top-of-page

&----


*& Report ZTEST_ALV_LOGO

*&

&----


*&

*&

&----


REPORT ztest_alv_logo.

TYPE-POOLS : slis.

*ALV Formatting tables /structures

DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.

DATA: gt_events TYPE slis_t_event.

DATA: gs_layout TYPE slis_layout_alv.

DATA: gt_page TYPE slis_t_listheader.

DATA: gs_page TYPE slis_listheader.

DATA: v_repid LIKE sy-repid.

*ALV Formatting work area

DATA: w_fieldcat TYPE slis_fieldcat_alv.

DATA: w_events TYPE slis_alv_event.

DATA: gt_bsid TYPE TABLE OF bsid WITH HEADER LINE.

INITIALIZATION.

PERFORM build_events.

PERFORM build_page_header.

START-OF-SELECTION.

*perform build_comment. "top_of_page - in initialization at present

SELECT * FROM bsid INTO TABLE gt_bsid UP TO 10 ROWS.

*perform populate_for_fm using '1' '3' 'BUKRS' '8' 'GT_BSID' 'Whee'.

*USING = Row, Column, Field name, display length, table name, heading

*OR

PERFORM build_fieldcat.

gs_layout-zebra = 'X'.

*top of page event does not work without I_callback_program

v_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = v_repid

i_structure_name = 'BSID'

  • i_background_id = 'ALV_BACKGROUND'

i_grid_title = 'This is the grid title'

  • I_GRID_SETTINGS =

is_layout = gs_layout

it_fieldcat = gt_fieldcat[]

it_events = gt_events[]

TABLES

t_outtab = gt_bsid.

************************************************************************

  • Form..............: populate_for_fm

  • Description.......: Populates fields for function module used in ALV

************************************************************************

FORM populate_for_fm USING p_row

p_col

p_fieldname

p_len

p_table

p_desc.

w_fieldcat-row_pos = p_row. "Row Position

w_fieldcat-col_pos = p_col. "Column Position

w_fieldcat-fieldname = p_fieldname. "Field name

w_fieldcat-outputlen = p_len. "Column Lenth

w_fieldcat-tabname = p_table. "Table name

w_fieldcat-reptext_ddic = p_desc. "Field Description

w_fieldcat-input = '1'.

APPEND w_fieldcat TO gt_fieldcat.

CLEAR w_fieldcat.

ENDFORM. " populate_for_fm

&----


*& Form build_events

&----


FORM build_events.

DATA: ls_event TYPE slis_alv_event.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = gt_events.

READ TABLE gt_events

WITH KEY name = slis_ev_user_command

INTO ls_event.

IF sy-subrc = 0.

MOVE slis_ev_user_command TO ls_event-form.

APPEND ls_event TO gt_events.

ENDIF.

READ TABLE gt_events

WITH KEY name = slis_ev_top_of_page

INTO ls_event.

IF sy-subrc = 0.

MOVE slis_ev_top_of_page TO ls_event-form.

APPEND ls_event TO gt_events.

ENDIF.

ENDFORM. " build_events

&----


*& Form USER_COMMAND

&----


  • When user command is called it uses 2 parameters. The itab

  • passed to the ALV is in whatever order it currently is on screen.

  • Therefore, you can read table itab index rs_selfield-tabindex to get

  • all data from the table. You can also check r_ucomm and code

  • accordingly.

&----


FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

READ TABLE gt_bsid INDEX rs_selfield-tabindex.

  • error checking etc.

SET PARAMETER ID 'KUN' FIELD gt_bsid-kunnr.

CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.

ENDFORM. "user_command

&----


*& Form top_of_page

&----


  • Your own company logo can go here if it has been saved (OAOR)

  • If the logo is larger than the size of the headings in gt_page,

  • the window will not show full logo and will have a scroll bar. Thus,

  • it is a good idea to have a standard ALV header if you are going to

  • use logos in your top of page.

&----


FORM top_of_page.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = gt_page

i_logo = 'ENJOYSAP_LOGO'.

ENDFORM. "top_of_page

&----


*& Form build_fieldcat

&----


*Many and varied fields are available here. Have a look at documentation

*for FM REUSE_ALV_LIST_DISPLAY and REUSE_ALV_FIELDCATALOG_MERGE

----


FORM build_fieldcat.

w_fieldcat-fieldname = 'BUDAT'.

w_fieldcat-seltext_m = 'Dte pst'.

w_fieldcat-ddictxt(1) = 'M'.

w_fieldcat-edit = 'x'.

  • Can change the position of fields if you do not want them in order

  • of the DDIC or itab

  • w_fieldcat-row_pos = '1'.

  • w_fieldcat-col_pos = '10'.

APPEND w_fieldcat TO gt_fieldcat.

CLEAR w_fieldcat.

ENDFORM. " build_fieldcat

&----


*& Form build_page_header

&----


  • gt_page is used in top of page (ALV subroutine - NOT event)

  • *H = Header, S = Selection, A = Action

----


FORM build_page_header.

  • For Headers, Key is not printed and is irrelevant. Will not cause

  • a syntax error, but is not used.

gs_page-typ = 'H'.

gs_page-info = 'Header 1'.

APPEND gs_page TO gt_page.

gs_page-typ = 'H'.

gs_page-info = 'Header 2'.

APPEND gs_page TO gt_page.

  • For Selections, the Key is printed (bold). It can be anything up to 20

  • bytes. It gets printed in order of code here, not by key value.

gs_page-typ = 'S'.

gs_page-key = 'And the winner is:'.

gs_page-info = 'Selection 1'.

APPEND gs_page TO gt_page.

gs_page-typ = 'S'.

gs_page-key = 'Runner up:'.

gs_page-info = 'Selection 2'.

APPEND gs_page TO gt_page.

  • For Action, Key is also irrelevant.

gs_page-typ = 'A'.

gs_page-info = 'Action goes here'.

APPEND gs_page TO gt_page.

ENDFORM. " build_page_header

Former Member
0 Kudos

Hi,

Events in alv and their FM The main events in alv and their FM and why we use these:

1. SLIS_PRINT_ALV.

2. SLIS_T_LISTHEADER.

3. SLIS_T_EVENT.

4. SLIS_T_SORTINFO_ALV.

5. SLIS_T_LAYOUT_ALV.

6. SLIS_T_FIELDCAT_ALV.

and in classic reports what is the sequence of events: === Events are

At selection-screen output.

Initialization.

At selection-screen on field

At selection-screen on end of field

At selection-screen on Radiobutton Group R1. (If you have any radio buttons)

At selection-screen on block b1. (If you have any blocks)

Start-of-selection.

Get node. (if the data is retreived from a logical database)

Get node late. (if the data is retreived from a logical database)

Top-of-page. (if the write statement is in the end-of-selection event or we can say that before the first write statement)

end-of-selection.

and fuction modules are

LISTHEADER - Is used to print the header information in the ALV List. Name, Date, Time, ALV Name and other details are called as Header information. EVENT - Basically this is the FM to handle Event's. When the user needs to do some event operation like when double clicking the a particular field we need to perform some operation. These events are captured by this FM. LAYOUT - This FM is used to define the layout of the List. There are many options available in this FM to define the Layout style. FIELDCAT - These are used to populate the List header. We can change them according to our req.

User-defined Text Output Event

Application

print_end_of_list

Define output text to be printed at the end of the entire list

print_top_of_list

Define output text to be printed at the beginning of the entire list

print_end_of_page

Define output text to be printed at the end of each page

print_top_of_page

Define output text to be printed at the beginning of each page

subtotal_text

Define self-defined subtotals texts

Mouse-controlled Actions in the Grid Control Event

Application

button_click

Query a click on a pushbutton in the ALV Grid Control

double_click

Query a double-click on a cell of the ALV Grid control

hotspot_click

Query a hotspot click on columns defined for this purpose in advance

onDrag

Collect information when elements of the ALV Grid Control are dragged

onDrop

Process information when elements of the ALV Grid Control are dropped

onDropComplete

Perform final actions after successful Drag&Drop

onDropGetFlavor

Distinguish between options for Drag&Drop behavior

Processing of Self-defined and Standard Functions Event

Application

before_user_command

Query self-defined and standard function codes

user_command

Query self-defined function codes

after_user_command

Query self-defined and standard function codes

Definition of Self-defined Functions Event

Application

toolbar

Change, delete or add GUI elements in the toolbar

menu_button

Define menus for menu buttons in the toolbar

context_menu_request

Change context menu

onf1

Define self-defined F1 help

All of these can be found under type group SLIS.

  • Events

SLIS_EV_ITEM_DATA_EXPAND TYPE SLIS_FORMNAME VALUE 'ITEM_DATA_EXPAND',

SLIS_EV_REPREP_SEL_MODIFY TYPE SLIS_FORMNAME VALUE 'REPREP_SEL_MODIFY', SLIS_EV_CALLER_EXIT_AT_START TYPE SLIS_FORMNAME VALUE 'CALLER_EXIT',

SLIS_EV_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND',

SLIS_EV_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',

SLIS_EV_DATA_CHANGED TYPE SLIS_FORMNAME VALUE 'DATA_CHANGED',

SLIS_EV_TOP_OF_COVERPAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_COVERPAGE',

SLIS_EV_END_OF_COVERPAGE TYPE SLIS_FORMNAME VALUE 'END_OF_COVERPAGE',

SLIS_EV_FOREIGN_TOP_OF_PAGE TYPE SLIS_FORMNAME

VALUE 'FOREIGN_TOP_OF_PAGE', SLIS_EV_FOREIGN_END_OF_PAGE TYPE SLIS_FORMNAME

VALUE 'FOREIGN_END_OF_PAGE',

SLIS_EV_PF_STATUS_SET TYPE SLIS_FORMNAME VALUE 'PF_STATUS_SET',

SLIS_EV_LIST_MODIFY TYPE SLIS_FORMNAME VALUE 'LIST_MODIFY',

SLIS_EV_TOP_OF_LIST TYPE SLIS_FORMNAME VALUE 'TOP_OF_LIST',

SLIS_EV_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE',

SLIS_EV_END_OF_LIST TYPE SLIS_FORMNAME VALUE 'END_OF_LIST',

SLIS_EV_AFTER_LINE_OUTPUT TYPE SLIS_FORMNAME VALUE 'AFTER_LINE_OUTPUT', SLIS_EV_BEFORE_LINE_OUTPUT TYPE SLIS_FORMNAME VALUE 'BEFORE_LINE_OUTPUT',

SLIS_EV_SUBTOTAL_TEXT TYPE SLIS_FORMNAME VALUE 'SUBTOTAL_TEXT'.

Former Member
0 Kudos

hi,

try this.

&----


*& Report ZINT_ALV

*&

&----


*&

*&

&----


REPORT zint_alv.

TYPE-POOLS:slis.

TABLES:mara,

makt,

mseg.

DATA:BEGIN OF itab OCCURS 0,

matnr LIKE mara-matnr,

maktx LIKE makt-maktx,

END OF itab.

DATA:BEGIN OF itab1 OCCURS 0,

mblnr LIKE mseg-mblnr,

menge LIKE mseg-menge,

meins LIKE mseg-meins,

werks LIKE mseg-werks,

END OF itab1.

DATA:fcat TYPE slis_t_fieldcat_alv,

fcat1 TYPE slis_t_fieldcat_alv,

eve TYPE slis_t_event,

eve1 TYPE slis_t_event.

DATA:t_mat LIKE mara-matnr.

SELECTION-SCREEN:BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.

SELECT-OPTIONS:mat FOR mara-matnr.

SELECTION-SCREEN:END OF BLOCK blk1.

INITIALIZATION.

PERFORM build_fcat USING fcat.

PERFORM build_eve.

START-OF-SELECTION.

PERFORM get_data.

PERFORM dis_data.

&----


*& Form build_fcat

&----


  • text

----


  • -->T_FCAT text

----


FORM build_fcat USING t_fcat TYPE slis_t_fieldcat_alv.

DATA:wa_fcat TYPE slis_fieldcat_alv.

wa_fcat-tabname = 'ITAB'.

wa_fcat-fieldname = 'MATNR'.

wa_fcat-seltext_m = 'Material'.

  • wa_fcat-hotspot = 'X'.

APPEND wa_fcat TO t_fcat.

CLEAR wa_fcat.

wa_fcat-tabname = 'ITAB'.

wa_fcat-fieldname = 'MAKTX'.

wa_fcat-seltext_m = 'Description'.

APPEND wa_fcat TO t_fcat.

CLEAR wa_fcat.

ENDFORM. "build_fcat

&----


*& Form build_eve

&----


  • text

----


FORM build_eve.

DATA:t_eve TYPE slis_alv_event.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = eve

  • EXCEPTIONS

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

ENDFORM. "build_eve

&----


*& Form get_data

&----


  • text

----


FORM get_data.

SELECT maramatnr maktmaktx INTO CORRESPONDING FIELDS OF TABLE itab

FROM mara INNER JOIN makt

ON maramatnr = maktmatnr

WHERE mara~matnr IN mat.

ENDFORM. "get_data

&----


*& Form dis_data

&----


  • text

----


FORM dis_data.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = 'ZINT_ALV'

i_callback_user_command = 'USER_COMMAND'

i_grid_title = 'Interactive ALV'

it_fieldcat = fcat

it_events = eve

TABLES

t_outtab = itab

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

ENDFORM. "dis_data

&----


*& Form user_command

&----


  • text

----


  • -->U_COM text

----


FORM user_command USING u_com LIKE sy-ucomm sel_field TYPE slis_selfield.

CLEAR fcat1.

CASE u_com.

WHEN '&IC1'.

READ TABLE itab INDEX sel_field-tabindex.

IF sel_field-fieldname = 'MATNR'.

IF sy-subrc = 0.

t_mat = itab-matnr.

PERFORM build_cat1 USING fcat1.

PERFORM build_eve1.

PERFORM get_data1.

PERFORM dis_data1.

ENDIF.

ENDIF.

ENDCASE.

ENDFORM. "user_command

&----


*& Form build_fcat1

&----


  • text

----


  • -->T_FCAT1 text

----


FORM build_cat1 USING t_fcat1 TYPE slis_t_fieldcat_alv.

DATA:wa_fcat1 TYPE slis_fieldcat_alv.

wa_fcat1-tabname = 'ITAB1'.

wa_fcat1-fieldname = 'MBLNR'.

wa_fcat1-seltext_m = 'Material Doc.'.

APPEND wa_fcat1 TO t_fcat1.

CLEAR wa_fcat1.

wa_fcat1-tabname = 'ITAB1'.

wa_fcat1-fieldname = 'MENGE'.

wa_fcat1-seltext_m = 'Quantity'.

APPEND wa_fcat1 TO t_fcat1.

CLEAR wa_fcat1.

wa_fcat1-tabname = 'ITAB1'.

wa_fcat1-fieldname = 'MEINS'.

wa_fcat1-seltext_m = 'UOM'.

APPEND wa_fcat1 TO t_fcat1.

CLEAR wa_fcat1.

wa_fcat1-tabname = 'ITAB1'.

wa_fcat1-fieldname = 'WERKS'.

wa_fcat1-seltext_m = 'Plant'.

APPEND wa_fcat1 TO t_fcat1.

CLEAR wa_fcat1.

ENDFORM. "build_fcat1

&----


*& Form build_eve1

&----


  • text

----


FORM build_eve1.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = eve1

EXCEPTIONS

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

ENDFORM. "build_eve1

&----


*& Form get_data1

&----


  • text

----


FORM get_data1.

SELECT mblnr menge meins werks FROM mseg

INTO CORRESPONDING FIELDS OF TABLE itab1

WHERE matnr = t_mat.

ENDFORM. "get_data1

&----


*& Form dis_data1

&----


  • text

----


FORM dis_data1.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = 'ZINT_ALV'

it_fieldcat = fcat1

it_events = eve1

TABLES

t_outtab = itab1

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

ENDFORM. "dis_data1