2006 May 13 8:11 AM
Hi,
How to use ALV variant in SAP ECC 5.0.
regards
Nishant
2006 May 13 8:14 AM
2006 May 13 8:22 AM
Hai Nishanth
1. REUSE_ALV_VARIANT_DEFAULT_GET.
This FM is used to get the default variant for the report if it has been set.
EXPORTING
I_SAVE Controls the storage mode. Allowed values are
A Standard and user specific variants
U User specific variants
X Standard Variants
CHANGING
CS_VARIANT Gets the default variant in a structure like DISVARIANT.
In REUSE_ALV_FIELDCATALOG_MERGE
List layout specifications
2.6.1. Description
Output list description structure.
The parameters are described under the following headers:
Display options
Exceptions
Totals
Interaction
Detail screen
Display variants (only for hierarchical-sequential lists)
Color
Other
Note the section 'Default'.
IT_SPECIAL_GROUPS. and the field catalog parameter FIELDCAT-SP_GROUP of the IMPORTING parameter IT_FIELDCAT.
' ' = if the prerequisite is fulfilled, but the parameter is not set, the function code '&OL0' calls the display variant popup in which you can show the visible fields in the field list by their groups. All fields in the field list are visible by default. The user can go to the group views in the popup.
The fields can be classified into any number of logical groups (1:n).
'X' = a maximum of five logical groups can be formed. The display variant popup for each of these groups can be called by its own function in the interface. The fields in the field list belong to this group. The ALV standard interface contains pushbuttons for the first three groups (the first three entries in the internal table IT_SPECIAL_GROUPS). The group text passed in IT_SPECIAL_GROUPS is displayed as pushbutton text. The display variant popup for the fourth and fifth groups can be called via the right-hand mouse key function selection. When the display variant popup for a field group is called, that group is selected, but the user can change the group view in the popup. The function codes &OLx (x=1,2,3,4,5) call the display variant popups for the respective group.
There are pushbuttons for the function codes &OL1, &OL2 and &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.
Display variants (only relevant for hierarchical-sequential lists)
header_text only relevant for hierarchical-sequential lists
value set: SPACE, CHAR(20)
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 only relevant for hierarchical-sequential lists
value set: SPACE, CHAR(20)
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 only relevant for hierarchical-sequential lists
value set: SPACE, 'X'
' ' = 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.
The following text parameters should be specified for program fields without a Data Dictionary reference. 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. If the user changes the column width interactively, the column header text with the appropriate length is always used. The interactive function 'Optimize column width' takes account of both the field contents and the column headers: if all field contents are shorter than the shortest column header, the column width depends on the column header.
The 'long field label' is also used in display variant definition, sort, etc. popups.
seltext_l (long field label)
seltext_m (medium field label)
seltext_s (short field label)
reptext_ddic (header)
analogous to the Data element maintenance 'Header'
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'
You can specify with values 'L', 'M', and 'S', the keyword that should always be used as column header. If the column width changes, no attempt is made in this case to find an appropriate header for the new output width.
Filter criteria for first list output
2.11.1. Description
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'.
Initial variant active/inactive logic
2.13.1. Description
Initial variant logic active/inactive.
Prerequisite: The parameter IS_VARIANT has the appropriate value.
See also the documentation of the IMPORTING parameter IS_VARIANT.
2.13.2. Value Range
SPACE = no initial variant can be defined 'X' = initial variant can be defined
2.13.3. Default
SPACE
Variants can be saved
2.14.1. Description
Controls the storage mode
Prerequisite: The IS_VARIANT parameter has the appropriate value.
See also the documentation of the IMPORTING parameter IS_VARIANT.
2.14.2. Value Range
' ' = display variants cannot be saved
Defined display variants (e.g. delivered display variants) can be selected for presentation independently of this flag. Changes can not be saved.
'X' = standard save
Display variants can be saved as standard display variants. User-specific saving is not possible.
'U' = only user-specific saving
The user can only save display variants user-specifically
'A' = standard and user-specific saving
The user can save a display variant user-specifically and as standard display variant. The user chooses in the display variant save popup.
2.14.3. Default
SPACE
2.15. IS_VARIANT
Variant information
2.15.1. Description
This structure is only relevant if display variants are to be saved and/or read. Variant information including the name of the list output variant. The access path must be specified in the fields REPORT (required field), HANDLE (optional) and/or LOG_GROUP (optional) to allow ALV to read display variants. If display variants are also to be saved, the parameter I_SAVE must also be entered.
See also the documentation of the IMPORTING parameter I_SAVE.
A variant is identified uniquely by:
the program to which it is assigned (REPORT)
the handle if, e.g. several lists with various structures and data are called (HANDLE) in a program (I_CALLBACK_PROGRAM)
The handle is a unique user-assigned CHAR(4) field, which assigns the call to the current internal output table structure.
Example: Various lists can be output in program x, depending on a user action.
Display variants are to be able to be defined for each of these lists.
This functionality is guaranteed by assigning a HANDLE for each list. If variants are saved for this program and handle, the handle must not change.
the logical group if, e.g. the same list is made with different settings (LOG_GROUP) via different transactions
The logical group is a unique user-assigned CHAR(4) field which determines the assignment.
Example: The program x is called via the transactions T1 and T2. The field catalog fields offered to the user vary depending on the transaction code by assignment to logical groups.
If variants are saved for the program and logical group, the logical group must not change.
the user name, if variants are saved user-specifically (USERNAME)
This parameter is never entered manually as the variant name is unique.
the variant name (VARIANT).
This parameter is only to be entered if a particular variant is to be read and the list is to be output with this variant via this structure.
2.15.2. Value Range
The above fields must be specified to be able to call a list with a variant.
2.15.3. Default
If the structure is initial but saving is active (I_SAVE is not initial), IS_VARIANT-REPORT is set to I_CALLBACK_PROGRAM. <b>The function module REUSE_ALV_VARIANT_F4 provides variant possible entry help.</b>
Thanks & regards
Sreenivasulu P
2006 May 13 9:06 AM
HI
GOOD
GO THROUGH THIS LINK
/people/thomas.jung3/blog/2005/10/26/alv-om-template-program
THANKS
MRUTYUN