-
Notifications
You must be signed in to change notification settings - Fork 0
/
reuse alv,fieldcatalog ve layout.abap
139 lines (124 loc) · 4.77 KB
/
reuse alv,fieldcatalog ve layout.abap
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
REPORT ZGK_REUSE_ALV.
TYPES: BEGIN OF gty_list,
ebeln TYPE ebeln,
ebelp TYPE ebelp,
BSTYP TYPE EBSTYP,
BSART TYPE bSART,
matnr TYPE matnr,
menge TYPE bstmg,
END OF gty_list.
DATA: gt_list TYPE TABLE OF gty_list,
gs_list TYPE gty_list.
DATA:gt_fieldcatalog TYPE slis_t_fieldcat_alv,
gs_fieldcatalog TYPE slis_fieldcat_alv.
DATA: gs_layout TYPE SLIS_LAYOUT_ALV.
START-OF-SELECTION.
select
ekko~ebeln"kolonları alır...
ekpo~ebelp
ekko~BSTYP
ekko~BSART
ekpo~matnr
ekpo~menge
from ekko
INNER JOIN ekpo on ekpo~ebeln eq ekko~ebeln"iki tablodaki ortak key leri alır ve birleştirir...
into TABLE gt_list.
CLEAR gs_fieldcatalog-fieldname.
gs_fieldcatalog-fieldname = 'ebeln'.
gs_fieldcatalog-seltext_s = 'sas no'."kolon başlığı kısa orta ve uzun olarak yazdık...
gs_fieldcatalog-seltext_m = 'sas numarası'.
gs_fieldcatalog-seltext_l = 'sas numarası'.
* gs_fieldcatalog-key = abap_true."key yapmak için...
gs_fieldcatalog-col_pos = 0."kolon sırasını belirler...
gs_fieldcatalog-outputlen = 15."genişilik...
gs_fieldcatalog-edit = abap_true."Edit yazmamızı,düzenlememizi sağlar...
gs_fieldcatalog-hotspot = abap_true."Altını çizer...
APPEND gs_fieldcatalog TO gt_fieldcatalog.
CLEAR gs_fieldcatalog-fieldname.
gs_fieldcatalog-fieldname = 'ebelp'.
gs_fieldcatalog-seltext_s = 'kalem'.
gs_fieldcatalog-seltext_m = 'kalem'.
gs_fieldcatalog-seltext_l = 'kalem'.
* gs_fieldcatalog-key = abap_true.
gs_fieldcatalog-col_pos = 0.
APPEND gs_fieldcatalog TO gt_fieldcatalog.
CLEAR gs_fieldcatalog-fieldname.
gs_fieldcatalog-fieldname = 'BSTYP'.
gs_fieldcatalog-seltext_s = 'belge tip'.
gs_fieldcatalog-seltext_m = 'belge tipi'.
gs_fieldcatalog-seltext_l = 'belge tipi'.
APPEND gs_fieldcatalog TO gt_fieldcatalog.
CLEAR gs_fieldcatalog-fieldname.
gs_fieldcatalog-fieldname = 'BSART'.
gs_fieldcatalog-seltext_s = 'belge tür'.
gs_fieldcatalog-seltext_m = 'belge türü'.
gs_fieldcatalog-seltext_l = 'belge türü'.
APPEND gs_fieldcatalog TO gt_fieldcatalog.
CLEAR gs_fieldcatalog-fieldname.
gs_fieldcatalog-fieldname = 'matnr'.
gs_fieldcatalog-seltext_s = 'malzeme'.
gs_fieldcatalog-seltext_m = 'malzeme'.
gs_fieldcatalog-seltext_l = 'malzeme'.
APPEND gs_fieldcatalog TO gt_fieldcatalog.
CLEAR gs_fieldcatalog-fieldname.
gs_fieldcatalog-fieldname = 'menge'.
gs_fieldcatalog-seltext_s = 'miktar'.
gs_fieldcatalog-seltext_m = 'miktar'.
gs_fieldcatalog-seltext_l = 'miktar'.
gs_fieldcatalog-do_sum = abap_true."toplam miktar
APPEND gs_fieldcatalog TO gt_fieldcatalog.
gs_layout-window_titlebar = 'Layout yapısını öğreniyoruz'.
gs_layout-zebra = abap_true.
gs_layout-colwidth_optimize = abap_true."kolon genişliğini ayarlar...
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
* I_CALLBACK_PROGRAM = ' '
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
IS_LAYOUT = gs_layout
IT_FIELDCAT = gt_fieldcatalog
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
tables
t_outtab = gt_list
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
.
if sy-subrc <> 0.
* Implement suitable error handling here
endif