0% found this document useful (0 votes)
17 views2 pages

ALV List Display

The document is an ABAP report named ZALV_LIST_DISPLAYPRAC_U46 that retrieves sales order data from the VBAK and VBAP tables. It creates a final output table LT_FINAL by merging relevant fields from both tables and prepares the data for display using ALV (ABAP List Viewer). The report includes error handling for function calls related to field catalog and list display.

Uploaded by

Soumik Dey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

ALV List Display

The document is an ABAP report named ZALV_LIST_DISPLAYPRAC_U46 that retrieves sales order data from the VBAK and VBAP tables. It creates a final output table LT_FINAL by merging relevant fields from both tables and prepares the data for display using ALV (ABAP List Viewer). The report includes error handling for function calls related to field catalog and list display.

Uploaded by

Soumik Dey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Page : 1 / 2

1 *&---------------------------------------------------------------------*
2 *& Report ZALV_LIST_DISPLAYPRAC_U46
3 *&---------------------------------------------------------------------*
4 *&
5 *&---------------------------------------------------------------------*
6 REPORT ZALV_LIST_DISPLAYPRAC_U46.
7
8 TYPES : BEGIN OF TY_VBAK,
9 VBELN TYPE VBAK-vbeln,
10 ERDAT TYPE VBAK-erdat,
11 ERNAM TYPE VBAK-ernam,
12 END OF TY_VBAK.
13
14 TYPES : BEGIN OF TY_VBAP,
15 VBELN TYPE VBAP-vbeln,
16 POSNR TYPE VBAP-posnr,
17 MATNR TYPE VBAP-matnr,
18 MATKL TYPE VBAP-matkl,
19 END OF TY_VBAP.
20
21 DATA : LT_VBAK TYPE TABLE OF TY_VBAK,
22 LT_VBAP TYPE TABLE OF TY_VBAP,
23 LT_FINAL TYPE TABLE OF ZSTR_VBAKAP_U46,
24 LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
25
26 DATA : WA_VBAK TYPE TY_VBAK,
27 WA_VBAP TYPE TY_VBAP,
28 WA_FINAL TYPE ZSTR_VBAKAP_U46.
29
30
31 SELECT VBELN ERDAT ERNAM FROM VBAK INTO TABLE LT_VBAK.
32
33 IF LT_VBAK IS NOT INITIAL.
34 SELECT VBELN POSNR MATNR MATKL FROM VBAP INTO TABLE LT_VBAP
35 FOR ALL ENTRIES IN LT_VBAK
36 WHERE VBELN = LT_VBAK-vbeln.
37 ENDIF.
38
39 LOOP AT LT_VBAK INTO WA_VBAK.
40 WA_FINAL-vbeln = WA_VBAK-vbeln.
41 WA_FINAL-erdat = WA_VBAK-erdat.
42 WA_FINAL-ernam = WA_VBAK-ernam.
43 READ TABLE LT_VBAP INTO WA_VBAP WITH KEY VBELN = WA_VBAK-vbeln.
44 IF SY-SUBRC = 0.
45 WA_FINAL-matnr = WA_VBAP-matnr.
46 WA_FINAL-posnr = WA_VBAP-posnr.
47 WA_FINAL-matkl = WA_VBAP-matkl.
48 APPEND WA_FINAL TO LT_FINAL.
49 CLEAR: WA_FINAL , WA_VBAK, WA_VBAP.
50 ENDIF.
51 ENDLOOP.
52
53
54
55
56
57 CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
58 EXPORTING
59 * I_PROGRAM_NAME =
60 * I_INTERNAL_TABNAME =
61 I_STRUCTURE_NAME = 'ZSTR_VBAKAP_U46'
62 * I_CLIENT_NEVER_DISPLAY = 'X'
63 * I_INCLNAME =
64 * I_BYPASSING_BUFFER =
65 * I_BUFFER_ACTIVE =
66 CHANGING
67 ct_fieldcat = LT_FIELDCAT
68 * EXCEPTIONS
69 * INCONSISTENT_INTERFACE = 1
70 * PROGRAM_ERROR = 2
71 * OTHERS = 3
72 .
73 IF sy-subrc <> 0.
74 * Implement suitable error handling here
File : ZALV_LIST_DISPLAYPRAC_U46. Date: 14.02.2025
Page : 2 / 2
75 ENDIF.
76
77
78 CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
79 EXPORTING
80 * I_INTERFACE_CHECK = ' '
81 * I_BYPASSING_BUFFER =
82 * I_BUFFER_ACTIVE = ' '
83 * I_CALLBACK_PROGRAM = ' '
84 * I_CALLBACK_PF_STATUS_SET = ' '
85 * I_CALLBACK_USER_COMMAND = ' '
86 * I_STRUCTURE_NAME =
87 * IS_LAYOUT =
88 IT_FIELDCAT = LT_FIELDCAT
89 * IT_EXCLUDING =
90 * IT_SPECIAL_GROUPS =
91 * IT_SORT =
92 * IT_FILTER =
93 * IS_SEL_HIDE =
94 * I_DEFAULT = 'X'
95 * I_SAVE = ' '
96 * IS_VARIANT =
97 * IT_EVENTS =
98 * IT_EVENT_EXIT =
99 * IS_PRINT =
100 * IS_REPREP_ID =
101 * I_SCREEN_START_COLUMN = 0
102 * I_SCREEN_START_LINE = 0
103 * I_SCREEN_END_COLUMN = 0
104 * I_SCREEN_END_LINE = 0
105 * IR_SALV_LIST_ADAPTER =
106 * IT_EXCEPT_QINFO =
107 * I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
108 * IMPORTING
109 * E_EXIT_CAUSED_BY_CALLER =
110 * ES_EXIT_CAUSED_BY_USER =
111 TABLES
112 t_outtab = LT_FINAL
113 * EXCEPTIONS
114 * PROGRAM_ERROR = 1
115 * OTHERS = 2
116 .
117 IF sy-subrc <> 0.
118 * Implement suitable error handling here
119 ENDIF.

File : ZALV_LIST_DISPLAYPRAC_U46. Date: 14.02.2025

You might also like