Beruflich Dokumente
Kultur Dokumente
SHOBANA.C
2/21/2013
Function Modules used Parameter required to be passed Events to be passed Formatting Output as per need Simple Reports Hierarchical Reports
3
REUSE_ALV_EVENTS_TRANSFER
REUSE_ALV_EVENT_NAMES_GET Returns table of constant names of possible events for a list type
Output a simple
REUSE_ALV_LIST_LAYOUT_INFO_GET Read current ALV list information REUSE_ALV_LIST_LAYOUT_INFO_SET Set current ALV list information
REUSE_ALV_VARIANT_DEFAULT_GET Read default display variant (description only, w/o field catalog)
REUSE_ALV_VARIANT_F4 selection dialog box Display variant
2/21/2013
Function group:SLVC_FULLSCREEN
REUSE_ALV_GRID_COMMENTARY_SET REUSE_ALV_GRID_DISPLAY Output of a simple list (single-line) REUSE_ALV_GRID_DISPLAY_LVC REUSE_ALV_GRID_LAYOUT_INFO_GET Read current ALV list information REUSE_ALV_GRID_LAYOUT_INFO_SET Set current ALV list information
2/21/2013 6
Function REUSE_ALV_LIST_DISPLAY
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 catalogue as an internal table The field catalogue describes the fields to be output in the list.
7
2/21/2013
Exporting Parameters
1
2 3
I_INTERFACE_CHECK
I_BYPASSING_BUFFER I_BUFFER_ACTIVE
= ' '
= = ' '
4
5 6
I_CALLBACK_PROGRAM
I_CALLBACK_PF_STATUS_SET I_CALLBACK_USER_COMMAND
= ' '
= ' ' = ' '
7
8 9
2/21/2013
I_STRUCTURE_NAME
IS_LAYOUT IT_FIELDCAT
=
= =
8
10
11 12
IT_EXCLUDING
IT_SPECIAL_GROUPS IT_SORT
=
= =
13
14 15 16 17 18 19 20
IT_FILTER
IS_SEL_HIDE I_DEFAULT I_SAVE IS_VARIANT IT_EVENTS IT_EVENT_EXIT IS_PRINT
=
= = 'X' = ' ' = = = =
9
2/21/2013
21 22 23 24 25
= = 0 = 0 = 0 = 0
2/21/2013
10
= = =
= 1 = 2
11
Though the ALV function module needs 25-30 parameters to be passed, a simple report with ALV just requires these:
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY' EXPORTING I_CALLBACK_PROGRAM TABLES T_OUTTAB EXCEPTIONS PROGRAM_ERROR OTHERS
2/21/2013
= ' '
= 1 = 2.
12
2/21/2013
13
I_CALLBACK_PROGRAM
Program which calls the function module and contains the exit routines. It must be a Report, Function group, Module pool or Form routine pool (not an Include).
Note: Never pass SY-REPID directly in the interface. If the desired program name is in SYREPID, it must be assigned to an intermediate variable which is then passed to the interface.
2/21/2013 14
The field catalog for the output table is built-up in the caller's coding. The build-up can be completely or partially automated by calling the following function module REUSE_ALV_FIELDCATALOG_MERGE
2/21/2013
15
A field catalog need not be built-up and passed explicitly only under the following conditions: The internal table to be output has the same structure as a Data Dictionary structure which is referred to in the internal table declaration using LIKE or INCLUDE STRUCTURE.
All fields in this structure are to be output
Parameters to be passed
Positioning
row_pos (row position) value set: 0, 1 - 3 col_pos (column position) value set: 0, 1 60
Identification
fieldname (field name) tabname (internal output table)
2/21/2013
17
2/21/2013
18
19
symbol Texts
just (justification) value set: SPACE, 'R', 'L', 'C' lzero (leading zeros) no_sign (no +/- sign ) no_zero (suppress zeros) edit_mask (field formatting) value set: SPACE, template
2/21/2013
20
Texts
The texts are taken from the Data Dictionary for fields with a Data Dictionary reference. If this is not desired, the text parameters can also be specified. The Data Dictionary texts are then ignored. seltext_l (long field label) seltext_m (medium field label)
The specified text is not necessarily output in the list, an optimum among all texts is sought ddictxt (specify text) value set: SPACE, 'L', 'M', 'S'
2/21/2013 21
rollname (data element) value set: SPACE, Data Dictionary data element name
2/21/2013
22
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
1 Fieldname
2 Outputlen
3 Datatype
5 seltext_m
4 seltext_s
6 seltext_l
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.
2/21/2013 23
Defaults : The following entries are usually sufficient for internal table fields with a reference to a field defined in the Data Dictionary :
fieldname
ref_tabname 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 specified 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. 2/21/2013 24
I_STRUCTURE_NAME
If the internal output table is defined via an ABAP/4 Dictionary structure (INCLUDE STRUCTURE struct or LIKE struct), the field catalog can be built-up automatically by passing the structure name.
2/21/2013
25
Display options Totals Interaction Detail screen Display variants (only for hierarchical lists) Color Other
26
Display options
2/21/2013
27
Exceptions
Totals
no_sumchoice value set: SPACE, 'X' no_totalline value set: SPACE, 'X' no_subchoice value set: SPACE, 'X' no_subtotals value set: SPACE, 'X' totals_only value set: SPACE, 'X' totals_text value set: SPACE, string(max.60) subtotals_text value set: SPACE, string(max.60) numc_sum value set: SPACE, 'X'
29
2/21/2013
Interaction
box_fieldname value set: SPACE, internal output table field name box_tabname value set: SPACE, internal output table name no_input value set: SPACE, 'X' expand_fieldname value set: SPACE, internal header table field name f2code value set: SPACE, function code
2/21/2013 30
Interaction (cont)
confirmation_prompt value set: SPACE, 'X' key_hotspot value set: SPACE, 'X' no_keyfix value set: SPACE, 'X' get_selinfos value set: SPACE, 'X'
2/21/2013
31
Detail screen
detail_popup value set: SPACE, 'X' detail_initial_lines value set: SPACE, 'X' detail_titlebar value set: SPACE, string(max.30)
2/21/2013
32
2/21/2013
33
IT_SORT
The caller specifies the sorting and/or subtotalling of the basic list in the internal table IT_SORT. This internal table has the following fields
Spos Sort sequence Fieldname Internal output table field name Tabname Name of the internal output table Up 'X' = sort in ascending order Down 'X' = sort in descending order Subtot 'X' = subtotal at group value change group '* ' = new page at group value change 'UL' = underline at group value change
2/21/2013
34
IT_EVENTS 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.
2/21/2013 35
PF_STATUS_SET
ITEM_DATA_EXPAND List processing events :
TOP_OF_LIST
END_OF_LIST
END_OF_PAGE TOP_OF_PAGE TOP_OF_COVERPAGE
END_OF_COVERPAGE
IT_EVENTS-FORM - Name of the form routine which should be called in the calling program at the event.
2/21/2013 36
I_CALLBACK_USER_COMMAND
EXIT routine for command handling
Passing an EXIT routine tells ALV that the application wants to react to certain function codes itself. These are general function codes which ALV does not recognize (not ALV standard functions) and which were defined and set by an application status. FORM user_command USING r_ucomm LIKE syucomm rs_selfield TYPE slis_selfield. The parameter R_UCOMM contains the function code called.
2/21/2013 37
IT_EVENT_EXIT
Table for passing ALV standard function codes, to return control to the user before and/or after execution with the callback event USER_COMMAND. The table fields are as follows:
ucomm before after
2/21/2013 38
I_CALLBACK_PF_STATUS_ST
Passing an EXIT routine tells the ALV that the caller wants to set his or her own user status. In this case, the default ALV status is not set. The form routine interface must be defined as follows:
FORM set_pf_status USING rt_extab TYPE slis_t_extab
The table RT_EXTAB contains those function codes that are hidden on the standard interface.
2/21/2013 39
The structure RS_SELFIELD contains information: tabname : internal output table name tabindex : internal output table index fieldname: field name of cursor position sel_tab_field: cell name of cursor position (internal ALV table name field endsum : cursor is on the final total row sumindex : if >0, the cursor is on a subtotal row value : field value on the list refresh : (exporting) list is to be refreshed col_stable:(exporting) keep column positions in refresh row_stable:(exporting) keep row positions in refresh exit :(exporting) leave list (and ALV) before_action: jump before performing standard action 2/21/2013 after_action : jump after performing standard action,
40
IT_FILTER
Filter criteria for first list output 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 builtup 'manually'.
2/21/2013 41
I_DEFAULT
Initial variant logic active/inactive. Prerequisite: The parameter IS_VARIANT has the appropriate value Value Range SPACE = no initial variant can be defined 'X' = initial variant can be defined Default SPACE
2/21/2013 42
Value Range
' ' = display variants cannot be saved 'X' = standard save 'U' = only user-specific saving 'A' = standard and user-specific saving
2/21/2013
43
IS_VARIANT
This structure is only relevant if display variants are to be saved and/or read The access path must be specified in the fields
REPORT (required field), HANDLE (optional) unique user-assigned CHAR(4) field LOG_GROUP (optional)
2/21/2013 44
I_INTERFACE_CHECK
To avoid overloading list output with interface consistency checks, they are only made in an extra call mode. If this parameter is 'X', the consistency of the interface is checked when the function module is called, and an error log is output. This parameter should only be set for development test purposes (e.g. in debugging). The interface check can also be made on the results list by entering the function code &SOS.
2/21/2013 45
IS_PRINT
Print information Print control parameter
2/21/2013
SCREEN_SETTINGS
IT_SCREEN_END_COLUMN
x coordinate of the bottom right-hand corner of the popup.
2/21/2013
47
SCREEN_SETTINGS (contd.)
IT_SCREEN_END_LINE
y coordinate of the bottom right-hand corner of the popup.
2/21/2013
48
E_EXIT_CAUSED_BY_CALLER
2/21/2013
49
ES_EXIT_CAUSED_BY_USER
How the user left the list
If one of the ALV standard function codes for 'Back', 'Cancel' or 'Exit' occurs, the current list is discarded and the ALV function module ends. In this case the exporting structure ES_EXIT_CAUSED_BY_USER contains one of the following flags: ES_EXIT_CAUSED_BY_USER-BACK = 'X 'Back' occurred ES_EXIT_CAUSED_BY_USER-CANCEL = 'X' 'Cancel' occurred ES_EXIT_CAUSED_BY_USER-EXIT = 'X' 'Exit' occurred The function which occured determines the further navigation in the application. 2/21/2013 50
T_OUTTAB
2/21/2013
52