-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimple ALV
More file actions
52 lines (42 loc) · 1.31 KB
/
Copy pathSimple ALV
File metadata and controls
52 lines (42 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
*&---------------------------------------------------------------------*
*& Report z_simple_alv
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT z_simple_alv.
TABLES: mara.
DATA t_alv TYPE STANDARD TABLE OF mara."table ALV
DATA s_alv TYPE mara. "Structures ALV
DATA t_fcat TYPE lvc_t_fcat. "table catalogue
"SELECTION Screen
SELECTION-SCREEN BEGIN OF BLOCK b01.
SELECT-OPTIONS: s_matnr FOR mara-matnr OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b01.
START-OF-SELECTION.
FREE t_alv."clear table
"data selection
SELECT *
FROM mara
INTO CORRESPONDING FIELDS OF TABLE t_alv
WHERE matnr IN s_matnr.
"OBLIGATORY
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'mara'
CHANGING
ct_fieldcat = t_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
"Display ALV
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
it_fieldcat_lvc = t_fcat "Receive the field catalog
TABLES
t_outtab = t_alv "table output
EXCEPTIONS
program_error = 1
OTHERS = 2.