0% found this document useful (0 votes)
173 views3 pages

Reuse Alv Grid

This document defines an ABAP report that displays material master data in an ALV grid. It declares internal tables and field catalog structures, performs data selection from database tables into internal tables, builds the field catalog, and calls the ALV grid display function to display the material master data.

Uploaded by

Xavier Vandelaar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
173 views3 pages

Reuse Alv Grid

This document defines an ABAP report that displays material master data in an ALV grid. It declares internal tables and field catalog structures, performs data selection from database tables into internal tables, builds the field catalog, and calls the ALV grid display function to display the material master data.

Uploaded by

Xavier Vandelaar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

Reward if helpful

report ztest_0002
no standard page heading
message-id zmm.
* Tables.
tables: mara.
* Global ALV Data Declarations
type-pools: slis.
* Internal Tables
data: begin of itab occurs 0,
matnr type mara-matnr,
maktx type makt-maktx,
end of itab.
data: fieldcat type slis_t_fieldcat_alv.
data: variant type disvariant.
* Selection Screen
selection-screen begin of block b1 with frame title text-002 .
select-options: s_matnr for mara-matnr.
parameters: p_var(30) type c.
selection-screen end of block b1.
initialization.
variant-report = sy-repid.
variant-username = sy-uname.
at selection-screen on value-request for p_var.
call function 'REUSE_ALV_VARIANT_F4'
exporting
is_variant = variant
i_save = 'U'
importing
es_variant = variant
exceptions
not_found = 1
program_error = 2
others = 3.
p_var = variant-variant.
start-of-selection.
perform get_data.
perform call_alv.
*********************************************************************
* Form GET_DATA
*********************************************************************
form get_data.
select mara~matnr makt~maktx
into corresponding fields of table itab
from mara
inner join makt
on mara~matnr = makt~matnr
where mara~matnr in s_matnr
and makt~spras = sy-langu.
endform.
************************************************************************
* CALL_ALV
************************************************************************
form call_alv.
perform build_field_catalog.
* Call ABAP List Viewer (ALV)
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
it_fieldcat = fieldcat
is_variant = variant
i_save = 'U'
tables
t_outtab = itab.
endform.
************************************************************************
* BUILD_FIELD_CATALOG
************************************************************************
form build_field_catalog.
data: fc_tmp type slis_t_fieldcat_alv with header line.
data: label(30) type c.
clear: fieldcat. refresh: fieldcat.
perform update_catalog using 'Material Number'
'ITAB'
'MATNR'
'18'
space
space
'L'.
perform update_catalog using 'Material Description'
'ITAB'
'MAKTX'
'40'
space
space
'L'.
endform.
************************************************************************
* UPDATE_CATALOG
************************************************************************
form update_catalog using col_head
table
field
outputlen
do_sum
no_out
just.
data: tmp_fc type slis_t_fieldcat_alv with header line.
tmp_fc-reptext_ddic = col_head.
tmp_fc-fieldname = field.
tmp_fc-tabname = table.
tmp_fc-outputlen = outputlen.
tmp_fc-just = just.
tmp_fc-decimals_out = 0.
tmp_fc-do_sum = do_sum.
tmp_fc-no_out = no_out.
append tmp_fc to fieldcat.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy