Professional Documents
Culture Documents
Reuse Alv List Display
Reuse Alv List Display
6 C)
REUSE_ALV_LIST_DISPLAY
(documentazione ufficiale release 4.6C)
Output a simple list (single line or several lines)
Functionality
This module outputs an internal table with any structure as a formatted one-line or multiple-line list.
Principle:
Pass an internal table with the set of output information
Pass a structure with general list layout details
Pass a field catalog as an internal table
The field catalog describes the fields to be output in the list.
Notes
All actions on the list refer directly to the internal output table, e.g. sorting the list also sorts the passed internal
output table (passed by reference).
An important consideration for the use of the tools and certain generic functions (totals, subtotals) is the expected
amount of data to be displayed.
The application must take this consideration into account.
Parameter
I_INTERFACE_CHECK
I_BYPASSING_BUFFER
I_BUFFER_ACTIVE
I_CALLBACK_PROGRAM
I_CALLBACK_PF_STATUS_SET
I_CALLBACK_USER_COMMAND
I_STRUCTURE_NAME
IS_LAYOUT
IT_FIELDCAT
IT_EXCLUDING
IT_SPECIAL_GROUPS
IT_SORT
IT_FILTER
IS_SEL_HIDE
I_DEFAULT
I_SAVE
IS_VARIANT
IT_EVENTS
IT_EVENT_EXIT
IS_PRINT
IS_REPREP_ID
I_SCREEN_START_COLUMN
I_SCREEN_START_LINE
I_SCREEN_END_COLUMN
I_SCREEN_END_LINE
E_EXIT_CAUSED_BY_CALLER
ES_EXIT_CAUSED_BY_USER
T_OUTTAB
Default: SPACE
I_BYPASSING_BUFFER
I_BUFFER_ACTIVE
&OL3 in the ALV standard interface (function group KKBL status STANDARD).
The functions &OL4 and &OL5 only have function keys.
A group 'All fields' is added by the System when grouping logic is used (= the
above prerequisite is satisfied), regardless of the setting of this parameter.
no_keyfix
value set: SPACE, 'X'
Not relevant for block lists (output of several lists consecutively)
' ' = the key columns defined in the field catalog by FIELDCAT-KEY = 'X' are fixed
in the list output. These columns do not scroll horizontally. The item table key
columns are fixed in hierarchical-sequential lists. The header table key fields are
not considered here.
'X' = key columns not fixed
The user can change these general settings interactively. To fix a column by default
which is not a key column, set the parameter to ' X' and control it via the field list.
See the documentation of the field list parameter FIELDCAT-FIX_COLUMN of the
IMPORTING parameter IT_FIELDCAT.
get_selinfos
value set: SPACE, 'X'
If the calling program is a report with an ABAP/4 selection screen, setting this
parameter makes ALV read the selection screen again. If the selections are read
successfully, a pushbutton, via which the user can call a popup which lists the
report selections in a simple form, becomes active on the results list output by
ALV. The contents of this popup are printed, if the interface IS_PRINT structure
parameter NO_PRINT_SELINFOS is not set. You can ensure that they are printed on
a separate page by setting the parameter IS_PRINT-NO_COVERPAGE. For more
information about printed output, see the documentation of the parameter
IS_PRINT.
group_change_edit
value set: SPACE, 'X'
'X' = the user can enter a format option for each sort criterion in the sort/subtotal
popup, for the list format when this value changes (e.g. new page or undeline). For
further information about sorting see the documentation of the parameter IT_SORT.
Detail screen
detail_popup
value set: SPACE, 'X'
' ' = list record detail display in full-screen mode, with top-of-page.
'X' = list record detail display in popup (without top-of-page).
detail_initial_lines
value set: SPACE, 'X'
' ' = only fields whose contents are not initial are output in the detail view.
'X' = initial field contents are also output in detail.
Detail_titlebar
Value set: SPACE, string (max.30)
' ' = 'Detail: Display' is output as the title of the detail window.
'string' = the string passed is output as the title of the detail window.
Display variants (only relevant for hierarchical-sequential lists)
Header_text
value set: SPACE, CHAR(20)
only relevant for hierarchical-sequential lists. You can toggle between display field
and field list views via pushbuttons in the display variant definition popup for
hierarchical-sequential lists. The views refer to the hierarchy level of the fields.
This is technically a toggle between the header table and item table fields.
' ' = the header table field pushbutton text is 'Header' by default.
CHAR(20) = header table field pushbutton text.
Item_text
Value set: SPACE, CHAR(20)
Only relevant for hierarchical-sequential lists
You can toggle the view between the display fields and the field list via
pushbuttons in the display variant definition popup for hierarchical-sequential lists.
The views refer to the hierarchy level of the fields. This is technically a toggle
between the header table and item table fields.
' ' = the pushbutton text for the item table fields is 'Item' by default.
CHAR(20) = item table field pushbutton text.
item_default
value set: SPACE, 'X'
only relevant for hierarchical-sequential lists
' ' = the header table fields are displayed by default in the display variant definition
popup. The user can switch to the item table fields interactively.
'X' = the item table fields are displayed by default in the display variant Definition
Popup. The user can switch to the header table fields interactively.
Color
info_fieldname
value set: SPACE, internal output table field name
A whole list record can be colored individually using a color code in a column of
the internal output table for the record. Assign the name of the field containing the
color code to this parameter.
The internal output table field must be of type CHAR(3).
The code must have the following syntax:
'Cxy': C = color (all codes must start with ' C')
X = color number (' 1'-'9')
y = bold ('0' = off, '1' = on)
Note: the color of the key columns is not affected. Key columns can be colored at
record or cell level using the complex coloring which is described in the next
parameter COLTAB_FIELDNAME.
To color columns, see the documentation of the field catalog parameter FIELDCAT-
EMPHASIZE of the IMPORTING parameter IT_FIELDCAT.
coltab_fieldname
value set: SPACE, internal output table field name
Cells can be colored individually using a color code which is contained in a column
of the internal output table for the record containing the cell.
Assign the name of the field to this parameter.
The internal output table field must be of type SLIS_T_SPECIALCOL_ALV.
Principle: the color code field is entered for the record containing the cells to be
colored. The field contains an internal table with the above structure, containing the
field names of the cells to be colored and the color code. The cell coordinates are
determined by the record position containing the color code and the column
information in the color table.
The record structure of the internal color table of type SLIS_T_SPECIALCOL_ALV
is as follows:
Color table- FIELDNAME = field name of the cell to be colored
Color table- COLOR-COL = color number (1 - 9)
Color table- COLOR-INT = bold (0 = off, 1 = on)
Color table- COLOR-INV = inverse (0 = off, 1 = on)
Color table- NOKEYCOL = ignore key coloring (' X' = yes, ' ' = no)
If the parameter color table- FIELDNAME is not filled, the coloring applies to all
fields, so the entire record is colored.
Others
list_append
value set: SPACE, 'X'
only relevant for block lists which are not output with the REUSE_ALV_BLOCK_...
modules. It is only useful to output block-lists without specifying the above
modules if the number of list blocks exceeds, or may exceed, the maximum number
specified in the block module documentation. These operations are not possible for
user-defined block lists.
Principle: to output a list of n blocks
Call the function module for the list type for the first block.
The caller must enter the maximum list width of the n blocks in the parameter
LAYOUT-MIN_LINESIZE in the first call. The event table IT_EVENTS of the event
END_OF_LIST must contain the associated form routine name (see also the
documentation of the interface parameter IT_EVENTS). The parameter LAYOUT-
LIST_APPEND must be initial. After the first list has been output, the form routine
specified in the event END_OF_LIST is called by Callback. The remaining n-1
blocks are then output by calling the function module for the list type. The
parameter LAYOUT-LIST_APPEND must be set = 'X' for these n-1 calls. The event
table IT_EVENTS should not contain the event END_OF_LIST or at least be assigned
to a different form routine name from the first call.
Default
The default layout settings can often be retained, so that you do not have to pass this
structure with changed flags.
the internal output table field described by the current field catalog entry has a
reference to the Data Dictionary (not a program field), and the field name in the
internal output table is different from the name of the field in the Data Dictionary.
If the field names are identical, naming the Data Dictionary structure or table in the
FIELDCAT-REF_TABNAME parameter is sufficient.
ref_tabname (reference table/structure field name)
value set: SPACE, name of a Data Dictionary structure or table structure or table
name of the referred Data Dictionary field. This parameter is only used when the
internal output table field described by the current field catalog entry has a Data
Dictionary reference (not a program field).
Reference to fields with currency/measurement unit
Each internal output table sum or quantity field whose decimal places are to be
formatted appropriately for the unit in the list must follow the convention:
the field is of data type QUAN or CURR (internal type P)
(the field must really have this physical data type. Overwriting the physical
data type with the parameter FIELDCAT-DATATYPE has no effect)
There is a field in the internal output table which contains the associated unit.
There is also an entry in the field catalog for the unit field.
(If the unit is not to appear as a column in the list, and cannot be interactively
displayed as a column, e.g. because it is always unambiguous and is therefore
explicitly output by the caller in the list header, the field catalog units field
entry can take the parameter FIELDCAT-TECH = 'X'.
The association of a value field to a unit affects the output as follows:
appropriate decimal places display for the unit
an initialized field with a link to a non-initial unit is output as ' 0' for the unit (if
FIELDCAT-NO_ZERO is initial ). When this field is summed, this unit affects
whether the units are homogeneous.
an initialized field with a link to an initial unit is output as SPACE. When this
field is summed, the unit SPACE does not affect the homogeneity of the units.
When non-initial fields with an initial unit are summed, the unit SPACE is
considered to be a unit.
Link to currency unit
cfieldname (currency unit field name)
value set: SPACE, output table field name
Only relevant for amount columns with associated unit.
Name of the internal output table field containing the currency unit associated with
the amount field FIELDCAT-FIELDNAME.
The field in FIELDCAT-CFIELDNAME must have its own field catalog entry.
ctabname (internal currency unit field output table)
value set: SPACE, output table field name
only relevant for hierarchical-sequential lists
Name of the internal output table containing the FIELDCAT-CFIELDNAME field.
Link to measurement unit
qfieldname (measurement unit field name)
value set: SPACE, output table field name
only relevant for quantity columns with unit link.
Name of the internal output table field containing the measurement unit associated
with the quantity field FIELDCAT-FIELDNAME. The field in FIELDCAT-
QFIELDNAME must have its own field catalog entry.
Qtabname (internal measurement unit field output table)
value set: SPACE, output table field name
only relevant for hierarchical-sequential lists
Name of the internal output table containing the FIELDCAT-QFIELDNAME field.
Column output options
Outputlen (column width)
value set: 0 (initial ), n
For fields with a Data Dictionary link this parameter can be left initial.
For fields without a Data Dictionary link (program field) the parameter must be
given the value of the desired field list output length (column width).
initial = column width is the output length of the referred Data Dictionary field
(domain).
n = column width is n characters
Key (key column)
value set: SPACE, 'X'
'X' = kex field (key field output in color)
Key fields can not be interactively hidden. Parameter FIELDCAT-NO_OUT must be
left initial. For exceptions see the documentation of the FIELDCAT-KEY_SEL
parameter.
key_sel (hideable key column)
value set: SPACE, 'X'
only relevant when FIELDCAT-KEY = 'X'
Key field which can be hidden interactively. The key column sequence cannot be
changed interactively by the user. The output is controlled by the FIELDCAT-
NO_OUT parameter analogously to non-key fields.
no_out (field in field list)
value set: SPACE, 'X'
'X' = field is not displayed in the current list.
The user can interactively choose the field for output from the field list. The user
can display the contents of these fields at line level using the 'Detail' function. See
also the 'Detail screen' documentation of the parameter IS_LAYOUT.
tech (technical field)
value set: SPACE, 'X'
'X' = technical field
Field cannot be output in the list and cannot be displayed interactively. Field can
only be used in the field catalog (not in IT_SORT, ...).
emphasize (highlight columns in color)
value set: SPACE, 'X' or 'Cxyz' (x:'1'-'9'; y,z: '0'=off '1'=on)
'X' = column is colored with the default column highlight color.
'Cxyz' = column is colored with a coded color:
C = Color (coding must begin with ' C')
X = color number (' 1'-'9')
y = bold ('0' = off, '1' = on)
z = inverse (' 0' = off, '1' = on)
hotspot (column as hotspot)
value set: SPACE, 'X'
'X' = column cells are output as hotspots
fix_column (fix column)
value set: SPACE, 'X'
Not relevant for block lists (output of several lists consecutively)
'X' = column fixed (does not scroll horizontally)
All columns to be fixed must have this flag, starting from the left. If a column
without this flag is output, only the columns to the left of this column are fixed.
The user can change the column fixing interactively. See also the documentation of
the Layout parameter IS_LAYOUT-NO_KEYFIX of the IMPORTING parameter
IS_LAYOUT.
do_sum (sum over column)
value set: SPACE, 'X'
'X' = a sum is to be calculated over this internal output table field.
This function can also be called by the user interactively.
no_sum (sums forbidden)
value set: SPACE, 'X'
'X' = no sum can be calculated over this field, although the data type of the field
would allow summing.
Input (column ready for input)
Function not available
Format column contents
Icon
Default
The following entries are usually sufficient for internal table fields with a reference
to a field defined in the Data Dictionary :
Fieldname
ref_tabname
Notes:
ALV gets the remaining information from the Data Dictionary. If no relative column
position (COL_POS) is specified, the fields are output in the list in the order in which
they were added to the field catalog. REF_FIELDNAME need only be specifid when the
name of the internal table field differs from the name of the referred Data Dictionary
field. Information which is explicitly entered in the field catalog is not overwritten by
information from the Data Dictionary.
Priority rule:
Entries in the field catalog have priority over differing entries in the Data Dictionary.
The following entries are usually sufficient for internal table fields without a
reference to the Data Dictionary (program fields):
fieldname
outputlen
datatype
seltext_s
seltext_m
seltext_l
Notes:
F1 help can be provided for program fields by assigning a data element to the parameter
ROLLNAME. If the parameters SELTEXT_S, SELTEXT_M , SELTEXT_L, and
REPTEXT_DDIC contain appropriate field labels, the program field column headers are
also adjusted appropriately when the column width changes.
subtot
'X' = subtotal at group value change
group
'* ' = new page at group value change
'UL' = underline at group value change
The formatting options are constants of the domain SLIS_CTRLS. See also the
documentation of GROUP_CHANGE_EDIT of the interface structure IS_LAYOUT for
more information about group value change formatting.
Comp (INTERNAL USE ONLY)
Expa
Prerequisite:
IT_SORT-SUBTOT = 'X', i.e. sort criterion is also subtotal criterion
If the first list output is only to be expanded to total level n, and can then be further
expanded interactively by the user, the flag should be set at the total level criterion
for level n
IT_FILTER Filter criteria for first list output
Filter criteria table
Filter criteria which result, e.g. from explicitly loading an initial display variant, can be
passed to list output in this parameter. This table should never be built-up 'manually'.
IS_SEL_HIDE Selection information modification
Only relevant when the layout parameter LAYOUT-GET_SELINFOS of the IMPORTING
structure IS_LAYOUT is set. Complex type for modifying the information displayed in
the selection info popup:
mode: 'R' = only the entries passed in the internal table IS_SEL_HIDE-T_ENTRIES
are output in the popup. Selection info which the list tool read in the selection
screen (when called by a report with a selection screen) are replaced by the values
passed.
mode: 'S' = the selection info which the list tool read in the selection screen of the
calling report are modified by the entries in the table IS_SEL_HIDE-T_ENTRIES.
t_entries : Selection info table
t_entries-mode : 'A' = output the selection info for the current table record
additionally in the info popup.
t_entries-mode : 'D' = do not output select option or SELNAME parameter selection
info in the popup.
t_entries-selname : (only used in t_entries-mode = 'D') Name of the select option or
parameter.
The following table fields are only used in t_entries-mode = 'A'. They contain the
selection information to be added.
t_entries-field : DDIC field name of the field for which selection
information is to be output.
t_entries-table : DDIC table names of t_entries-field.
t_entries-stext : Field name in info popup. If t_entries-field and t_entries-table have
been ntered, this text is taken from DDIC.
t_entries-valuf : Selection condition 'from' value (external format)
t_entries-valut : Selection condition 'to' value (external format)
t_entries-sign0: (I)nclusive (E)xclusive
t_entries-optio : All values of the select options Option field allowed.
The remaining fields are used internally and are not relevant for the caller.
I_DEFAULT Initial variant active/inactive logic
Initial variant logic active/inactive.
Prerequisite:
The parameter IS_VARIANT has the appropriate value.
See also the documentation of the IMPORTING parameter IS_VARIANT.
Value Range
SPACE = no initial variant can be defined
Value Range: The above fields must be specified to be able to call a list with a variant.
Default: If the structure is initial but saving is active ( I_SAVE is not initial),
IS_VARIANT-REPORT is set to I_CALLBACK_PROGRAM. The function module
REUSE_ALV_VARIANT_F4 provides variant possible entry help.
IT_EVENTS Table of events to perform
This table tells ALV which events are processed by the caller by CALLBACK. The table
of possible events per list type can be initialized using the module
REUSE_ALV_EVENTS_GET.
You can display the names of the constants in the type pools SLIS which represent the
individual events using the individual test function in the function module
REUSE_ALV_EVENT_NAMES_GET. Only events with a form routine name are
processed.
The table structure contains the fields:
IT_EVENTS-NAME
Name of the Callback event.
Possible Callback events:
Action
USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD
Process actions on the list
As this is a frequently-used Callback event, the form routine can also be passed
directly in the interface in the IMPORTING parameter
I_CALLBACK_USER_COMMAND .
PF_STATUS_SET USING RT_EXTAB TYPE SLIS_T_EXTAB
If a user list status is to be set, it must be done in the form routine assigned to
this event. The ALV function codes, which must not be active, are in the
Parameter RT_EXTAB. This table must be passed with the SET PF-STATUS
command (with inactive user function codes as well, if necessary).
The STANDARD status of the function group SALV should be used as a
template for a user-specific status.
As this is a frequently-used Callback event, its form routine can also be passed
directly in the interface in the IMPORTING parameter
I_CALLBACK_PF_STATUS_SET.
ITEM_DATA_EXPAND USING RS_SELFIELD TYPE SLIS_SELFIELD
RFLG_ALL TYPE C
Only relevant for hierarchical-sequential lists using the layout parameter
IS_LAYOUT-EXPAND_FIELDNAME of the structure IS_LAYOUT.
Exit for passing item entries ( ITEM table) for a header record which was
expanded interactively by the user.
RS_SELFIELD-TABINDEX contains the header table index for which the item
entries are to be put in the global item output table ( T_OUTTAB_SLAVE). The
Callback is only called if ALV has no items for a header which is to be
expanded.
RFLG_ALL is passed with ' X' if the user shows all items. The application must
ensure that entries are not repeated in the item table.
RS_SELFIELD is initial in this case.
CALLER_EXIT USING RS_DATA
Is called at the beginning of the function module to make special settings. It is
not usually used.
List processing events
IMPORTANT: The application Callback routine must not manipulate the
internal output table and/or its header record. This restriction applies to all
Callbacks which are called in the list output and run under the 'List processing
events'.
TOP_OF_LIST no USING parameter
Information output at the start of the list
END_OF_LIST no USING parameter
Exceptions
PROGRAM_ERROR Program errors - Exception type
If the exception is not handled by the calling program, the following applies:
(X) an error message is sent.
( ) a termination message is sent.
( ) a runtime error occurs.
Function group
SALV ABAP List Viewer
Central list presentation tool with generic functionality
Scenarios which illustrate the use of the modules will be documented here.
Scenario 1
To create a list which requires no application-specific interactions. The generic
ALV functionality is sufficient.
The data are in an internal table. The internal table is defined with reference to a
Data Dictionary structure or table:
Scenario 2
REUSE_ALV_EVENTS_GET
(documentazione ufficiale release 4.6C)
Returns table of possible events for a list type
This table can be passed to the ALV display module with the form name.
Parameter
I_LIST_TYPE List type (0,1,2,3)
Exceptions
LIST_TYPE_WRONG
Function group
(vedi alle pagine precedenti, nella documentazione del function module
SALV
REUSE_ALV_EVENTS_GET )
REUSE_ALV_EVENT_NAMES_GET
(documentazione ufficiale release 4.6C)
Returns table of constant names of possible events for a list type
This module shows the SLIS type pool constant names for the list type in test mode. The events in the calling programs
should only be accessed using these constants.
Parameter
I_LIST_TYPE List type (0,1,2,3)
Value Range
for call:
0 = simple list REUSE_ALV_LIST_DISPLAY
1 = hierarchic-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY
2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND
3 = hierarchic-sequential block list REUSE_ALV_BLOCK_LIST_HS_APPEND
Default: 0
T_EVENT_NAMES
Exceptions
LIST_TYPE_WRONG
Function group
SALV (vedi alle pagine precedenti, nella documentazione del function module
REUSE_ALV_EVENTS_GET )
REUSE_ALV_FIELDCATALOG_MERGE
(documentazione ufficiale release 4.6C)
Create field catalog from dictionary structure or internal table
Supports the creation of the field catalog for the ALV function modules based either on a structure or table defined in the
ABAP Data Dictionary, or a program-internal table.
The program-internal table must either be in a TOP Include or its Include must be specified explicitly in the interface.
The variant based on a program-internal table should only be used for rapid prototyping since the following restrictions
apply:
Performance is affected since the code of the table definition must always be read and interpreted at runtime.
Dictionary references are only considered if the keywords LIKE or INCLUDE STRUCTURE (not TYPE) are used.
If the field catalog contains more than 90 fields, the first 90 fields are output in the list by default whereas the remaining
fields are only available in the field selection.
If the field catalog is passed with values, they are merged with the 'automatically' found information.
Parameter
I_PROGRAM_NAME Internal table declaration program
Program from which the function module is called and which contains the exit
routines. The program should always be a Report, Function group, Module pool or
Form routine pool (not an Include). The specification of a structure is preferable to
data declaration in an Include for reasons of performance.
I_INTERNAL_TABNAME Output table name
Name of the internal output table in the CALLBACK_PROGRAM. An ABAP DDIC
structure is preferable to a data object in a CALLBACK program Include.
I_STRUCTURE_NAME Structure name (structure, table, view)
See parameter I_STRUCTURE_NAME on function module
REUSE_ALV_LIST_DISPLAY documentation.
I_CLIENT_NEVER_DISPLAY Hide client fields
Client field handling in the structure passed.
Exceptions
INCONSISTENT_INTERFACE
PROGRAM_ERROR
Function group
SALV (vedi alle pagine precedenti, nella documentazione del function module
REUSE_ALV_EVENTS_GET )
REUSE_ALV_COMMENTARY_WRITE
(documentazione ufficiale release 4.6C)
List body comment block output
Functionality
List header information is output according to its type. The output information is put in an internal table. Output attributes
are assigned to each line via the TYP field.
This module outputs formatted simple header information at TOP-OF-PAGE.
Example
List <-- Type 'H'
Currency DEM Controlling area currency <-- Type 'S'
Material FGS_TEST Test material <-- Type 'S'
Action info <-- Type 'A'
------------------- Column headers ----------------------------------
------------------- List --------------------------------------------
Parameter
IT_LIST_COMMENTARY Comment block
Internal table with the following fields:
TYP: Possible values:
- (H)eader: List header
only the contents of INFO are output (KEY is ignored)
usually one line = one entry
Attributes: - left-justified
- Bold
- followed by empty line
- (S)election: Important header information, e.g. currency of amounts in the list
display format: KEY (bold) INFO (normal)
Ex.: Currency DEM
Ctrl area FGS_TEST Test material
Usually several entries (one entry per line)
Attributes: - left-justified
- bold (KEY = on / INFO = off)
- followed by empty line
- (A)ction: Action info (see LIBS)
direct output via table
only the contents of INFO are output (KEY is ignored)
usually one entry
Attributes: - left-justified
- normal intensity
KEY: String with keyword character output in combination with TYP = 'S'.
INFO: Information output in header, formatted by type.
I_LOGO
I_END_OF_LIST_GRID
Function group
SALV (vedi alle pagine precedenti, nella documentazione del function module
REUSE_ALV_EVENTS_GET )
Esempio
(dal report standard d’esempio BALVSD01)
data: gt_list_top_of_page type slis_t_listheader.
data: gt_events type slis_t_event.
**********
initialization.
perform e03_eventtab_build using gt_events[].
perform e04_comment_build using gt_list_top_of_page[].
**********
form e03_eventtab_build using e03_lt_events type slis_t_event.
data: ls_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = e03_lt_events.
read table e03_lt_events with key name = slis_ev_top_of_page
into ls_event.
if sy-subrc = 0.
move gc_formname_top_of_page to ls_event-form.
append ls_event to e03_lt_events.
endif.
endform.
**********
form e04_comment_build2 using e04_lt_top_of_page type slis_t_listheadr.
data: ls_line type slis_listheader.
* Listenüberschrift: Typ H
clear ls_line.
ls_line-typ = 'H'.
* LS_LINE-KEY: not used for this type
ls_line-info = 'Intestazione lista'.
append ls_line to e04_lt_top_of_page.
* Kopfinfo: Typ S
clear ls_line.
ls_line-typ = 'S'.
ls_line-key = 'Chiave 1'.
ls_line-info = 'Testo informativo'.
append ls_line to e04_lt_top_of_page.
ls_line-key = 'Chiave 2'.
append ls_line to e04_lt_top_of_page.
* Aktionsinfo: Typ A
clear ls_line.
ls_line-typ = 'A'.
* LS_LINE-KEY: not used for this type
ls_line-info = 'Stato lista'.
append ls_line to e04_lt_top_of_page.
endform.
**********
form top_of_page.
* Scrive la top-of-page, ed è richiamata automaticamente
* da ALV grazie alle due perfom precedenti
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = gt_list_top_of_page.
endform.
Stato lista
REUSE_ALV_HIERSEQ_LIST_DISPLAY
(documentazione ufficiale release 4.6C)
Hierarchical sequential list output
Functionality
This module outputs two internal tables as a formated hierarchical-sequential list.
Principle:
Pass an internal table containing the set of header information to be output.
Pass an internal table containing the set of item information to be output.
Pass a structure containing the general list layout details
Pass a field catalog in the form of an internal table. The field catalog describes the fields to be output in the list.
Notes
All interactions which are performed on the list refer directly to the internal output tables, e.g. sorting the list also
sorts the passed internal output tables (passed by reference).
The expected output data quantity is an important consideration for the use of the tool or various generic functions
(totals, subtotals).
The application must take account of this.
Parameter
ES_LAYOUT ( REUSE_ALV_LIST_DISPLAY - IS_LAYOUT)
ET_FIELDCAT ( REUSE_ALV_LIST_DISPLAY - IT_FIELDCAT)
ET_SORT ( REUSE_ALV_LIST_DISPLAY - IT_SORT)
ET_FILTER ( REUSE_ALV_LIST_DISPLAY - IT_FILTER)
ES_LIST_SCROLL
ES_VARIANT
E_WIDTH
ET_MARKED_COLUMNS
ET_FILTERED_ENTRIES
ET_FILTERED_ENTRIES_HEADER
ET_FILTERED_ENTRIES_ITEM
ET_OUTTAB
ET_OUTTAB_HEADER
ET_OUTTAB_ITEM
ET_COLLECT00
ET_COLLECT01
ET_COLLECT02
ET_COLLECT03
ET_COLLECT04
ET_COLLECT05
ET_COLLECT06
ET_COLLECT07
ET_COLLECT08
ET_COLLECT09
Per la spiegazione di questi parametri si rimanda alla documentazione del function module
REUSE_ALV_LIST_DISPLAY , anche se il nome è leggermente diverso
staro
See the documentation of the system field SY-STARO
cursor_line
current cursor row position in the list (not in the internal output table)
cursor_offset
current cursor column position in the list (not in the internal output table)
Exceptions
NO_INFOS
PROGRAM_ERROR
Function group
SALV (vedi alle pagine precedenti, nella documentazione del function module
REUSE_ALV_EVENTS_GET )
REUSE_ALV_LIST_LAYOUT_INFO_GET
(documentazione ufficiale release 4.6C)
Read current ALV list information
Functionality
The caller can get current list status information with this module.
The current layout, the current field catalog, sort and current list scroll status information, and filter conditions are
returned.
Notes
Function module for modifying the information provided: REUSE_ALV_LIST_LAYOUT_INFO_SET
Parameter
ES_LAYOUT ( REUSE_ALV_LIST_DISPLAY - IS_LAYOUT)
ET_FIELDCAT ( REUSE_ALV_LIST_DISPLAY - IT_FIELDCAT)
ET_SORT ( REUSE_ALV_LIST_DISPLAY - IT_SORT)
ET_FILTER ( REUSE_ALV_LIST_DISPLAY - IT_FILTER)
ES_LIST_SCROLL
ES_VARIANT
E_WIDTH
ET_MARKED_COLUMNS
ET_FILTERED_ENTRIES
ET_FILTERED_ENTRIES_HEADER
ET_FILTERED_ENTRIES_ITEM
ET_OUTTAB
ET_OUTTAB_HEADER
ET_OUTTAB_ITEM
ET_COLLECT00
ET_COLLECT01
ET_COLLECT02
ET_COLLECT03
ET_COLLECT04
ET_COLLECT05
ET_COLLECT06
ET_COLLECT07
ET_COLLECT08
ET_COLLECT09
Per la spiegazione di questi parametri si rimanda alla documentazione del function module
REUSE_ALV_LIST_DISPLAY , anche se il nome è leggermente diverso
Exceptions
NO_INFOS
PROGRAM_ERROR
Function group
SALV (vedi alle pagine precedenti, nella documentazione del function module
REUSE_ALV_EVENTS_GET )
REUSE_ALV_LIST_LAYOUT_INFO_SET
(documentazione ufficiale release 4.6C)
Set current ALV list information
Functionality
The caller can change the current list description with this module.
Example
If a list has initially been called without exceptions, the application could proceed as follows:
get control after a user action (event USER_COMMAND)
set exception values per list row and in the internal output table
get the current layout structure from REUSE_ALV_LIST_LAYOUT_INFO_GET.
change the layout structure (LAYOUT-BOX_FIELDNAME is specified)
set the changed layout structure from REUSE_ALV_LIST_LAYOUT_INFO_SET.
set the SELFIELD-REFRESH flag in the RS_SELFIELD interface structure which was passed at the USER_COMMAND
event.
See also the documentation of the IMPORTING parameter I_CALLBACK_USER_COMMAND.
The list is output again with the changed layout information. The traffic lights set in the User Exit appear in the list.
Parameter
IS_LAYOUT
IT_FIELDCAT
IT_SORT
IT_FILTER
IS_LIST_SCROLL ( REUSE_ALV_LIST_LAYOUT_INFO_GET - ES_LIST_SCROLL)
Per la spiegazione di questi parametri si rimanda alla documentazione del function module
REUSE_ALV_LIST_DISPLAY o (nel caso dell’ultimo parametro) del function module
REUSE_ALV_LIST_LAYOUT_INFO_GET.
Function group
SALV (vedi alle pagine precedenti, nella documentazione del function module
REUSE_ALV_EVENTS_GET )
REUSE_ALV_POPUP_TO_SELECT
(documentazione ufficiale release 4.6C)
List in dialog box to choose one or more entries (or display only)
Functionality
Module for displaying or selecting table entries in internal tables in a popup (single or multiple selection is possible).
Principle:
pass an internal table with the superset of information to be output
pass list layout detail flags
pass a field catalog in the form of an internal table
The field catalog describes the fields to be output in the list.
Further Information
The module uses the function module ' REUSE_ALV_LIST_DISPLAY' internally. The documentation of this module
contains further information about the field catalog.
Parameter
I_TITLE
I_SELECTION
I_ZEBRA
I_SCREEN_START_COLUMN
I_SCREEN_START_LINE
I_SCREEN_END_COLUMN
I_SCREEN_END_LINE
I_CHECKBOX_FIELDNAME
I_LINEMARK_FIELDNAME
I_SCROLL_TO_SEL_LINE
I_TABNAME
I_STRUCTURE_NAME
IT_FIELDCAT
IT_EXCLUDING
I_CALLBACK_PROGRAM
I_CALLBACK_USER_COMMAND
IS_PRIVATE
ES_SELFIELD
E_EXIT
T_OUTTAB
Per la spiegazione di questi parametri si rimanda alla documentazione del function module
REUSE_ALV_LIST_DISPLAY
Column coordinate of the top left-hand corner of the popup. If no coordinates or only
the coordinates of the top left-hand corner are specified in the interface, the module
calculates the optimal coordinates using the table information. The coordinates need
not normally be specified in the interface parameters. You can position the popups by
specifying the top left-hand corner, without specifying its size.
Default: If the coordinates have initial values, the function module calculates the
optimal coordinates.
I_SCREEN_START_LINE Coordinates for list in dialog box
Row coordinate of the top left-hand corner of the popup. If no coordinates or only the
coordinates of the top left-hand corner are specified in the interface, the module
calculates the optimal coordinates using the table information. The coordinates need
not normally be specified in the interface parameters. You can position the popups by
specifying the top left-hand corner, without specifying its size.
Default: If the coordinates have initial values, the function module calculates the
optimal coordinates.
Exceptions
PROGRAM_ERROR
Function group
SALV (vedi alle pagine precedenti, nella documentazione del function module
REUSE_ALV_EVENTS_GET)
REUSE_ALV_VARIANT_ALL_MAINTAIN
(documentazione ufficiale release 4.6C)
Functionality
The ALV variant maintenance dialog (setting defaults, list user-specific variants, list standard variants, delete variants,
etc.) runs outside ALV.
Parameter
IS_VARIANT
I_DEFAULT
I_USER_SPECIFIC
I_TABNAME_HEADER
I_TABNAME_ITEM
IS_LAYOUT
IT_DEFAULT_FIELDCAT
Per la spiegazione di alcuni parametri si rimanda alla documentazione dei seguenti function modules:
REUSE_ALV_LIST_DISPLAY
REUSE_ALV_HIERSEQ_LIST_DISPLAY
Exceptions
FOREIGN_LOCK
PROGRAM_ERROR
Function group
SALV (vedi alle pagine precedenti, nella documentazione del function module
REUSE_ALV_EVENTS_GET )
REUSE_ALV_VARIANT_DEFAULT_GET
REUSE_ALV_VARIANT_EXISTENCE
(documentazione ufficiale release 4.6C)
DEFAULT_GET: Read default display variant (description only, w/o field catalog)
EXISTENCE: Check existence of a display variant
Functionality
DEFAULT_GET: Provides the default variant for the list specified in the structure parameter CS_VARIANT of a
program.
EXISTENCE: This function module checks the existence in the database of a display variant passed in the interface.
Parameter
I_SAVE
CS_VARIANT
Per la spiegazione di questi parametri si rimanda alla documentazione del function module
REUSE_ALV_LIST_DISPLAY
Exceptions
WRONG_INPUT
NOT_FOUND
PROGRAM_ERROR
Function group
SALV (vedi alle pagine precedenti, nella documentazione del function module
REUSE_ALV_EVENTS_GET )
REUSE_ALV_VARIANT_F4
(documentazione ufficiale release 4.6C)
Display variant selection dialog box
Functionality
Possible entries help, if the variant is defined explicitly as an input field on a screen. The selection must be specified by at
least partially filling the parameter structure IS_VARIANT.
Parameter
IS_VARIANT
I_TABNAME_HEADER
I_TABNAME_ITEM
IT_DEFAULT_FIELDCAT
I_SAVE
I_DISPLAY_VIA_GRID
E_EXIT
ES_VARIANT
Per la spiegazione di alcuni parametri si rimanda alla documentazione dei seguenti function modules:
REUSE_ALV_LIST_DISPLAY
REUSE_ALV_HIERSEQ_LIST_DISPLAY
Exceptions
NOT_FOUND
PROGRAM_ERROR
Function group
SALV (vedi alle pagine precedenti, nella documentazione del function module
REUSE_ALV_EVENTS_GET )
REUSE_ALV_VARIANT_MAINTAIN
(documentazione ufficiale release 4.6C)
Definition of a display variant outside the list context
Functionality
The ALV variant definition dialog box (setting column width, column sequence, display fields, hidden fields, etc.) runs
outside ALV. The caller is informed when a setting is saved.
Parameter
I_TABNAME_HEADER
I_TABNAME_ITEM
I_SAVE
I_POPUP
IS_LAYOUT
IT_SPECIAL_GROUPS
IT_SORT
E_SAVE
CT_FIELDCAT
Per la spiegazione di alcuni parametri si rimanda alla documentazione dei seguenti function modules:
REUSE_ALV_LIST_DISPLAY
REUSE_ALV_HIERSEQ_LIST_DISPLAY
Exceptions
NO_CHANGE
PROGRAM_ERROR
Function group
SALV (vedi alle pagine precedenti, nella documentazione del function module
REUSE_ALV_EVENTS_GET )
REUSE_ALV_VARIANT_SELECT
(documentazione ufficiale release 4.6C)
Read a display variant
Functionality
Read an ALV display variant
This function can also be performed with a dialog. The selection must be specified by at least partially filling the
parameter structure CS_VARIANT.
Parameter
I_DIALOG
I_USER_SPECIFIC
I_DEFAULT
I_TABNAME_HEADER
I_TABNAME_ITEM
IT_DEFAULT_FIELDCAT
I_LAYOUT
I_BYPASSING_BUFFER
I_BUFFER_ACTIVE
E_EXIT
ET_FIELDCAT
ET_SORT
ET_FILTER
ES_LAYOUT
CS_VARIANT
Per la spiegazione di alcuni parametri si rimanda alla documentazione dei seguenti function modules:
REUSE_ALV_LIST_DISPLAY
REUSE_ALV_HIERSEQ_LIST_DISPLAY
Exceptions
WRONG_INPUT
FC_NOT_COMPLETE
NOT_FOUND
PROGRAM_ERROR
Function group
SALV (vedi alle pagine precedenti, nella documentazione del function module
REUSE_ALV_EVENTS_GET )