04-05-2006 11:36 AM
Hi,
Can anybody tell me what is the purpose of REUSE_ALV_VARIANT_DEFAULT_GET and how to use it.
What are the diff reqd parameters in this
Is this compulsory practice to use this function while
making the alv reports.
Thanx in advance.
Tina.
04-05-2006 11:41 AM
Tina,
I am giving you a small piece of reference.
If you want I can send you across some more material
Give your email address.
REUSE_ALV_VARIANT_DEFAULT_GET:
Purpose: Provides the default variant for the list specified in the structure
parameter CS_VARIANT of a program.
Function Call:
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
I_SAVE = 'A'
CHANGING
CS_VARIANT = I_VARIANT
Parameters
I_SAVE :
Description :
Controls the storage mode
Prerequisite:
The IS_VARIANT parameter has the appropriate value.
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 cannot 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.
CS_VARIANT:
Internal table containing the program name (and the default variant---optional )
Hope this helps
Suruchi
04-05-2006 11:40 AM
Hi Tina,
This is not compulsory to use this FM.
REUSE_ALV_VARIANT_DEFAULT_GET.
This FM is used to get the default variant for the report if it has been set.
Parameters to be passed
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.
Regards,
Savitha
Message was edited by: savitha m
04-05-2006 11:41 AM
Hi,
check this Demo Program ...
<b>BALVHD01</b>,
* Get default variant
LX_VARIANT = L_VARIANT.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
I_SAVE = L_SAVE
CHANGING
CS_VARIANT = LX_VARIANT
EXCEPTIONS
NOT_FOUND = 2.
IF SY-SUBRC = 0.
P_VARI = LX_VARIANT-VARIANT.
ENDIF.
Regards
vijay
04-05-2006 11:41 AM
Tina,
I am giving you a small piece of reference.
If you want I can send you across some more material
Give your email address.
REUSE_ALV_VARIANT_DEFAULT_GET:
Purpose: Provides the default variant for the list specified in the structure
parameter CS_VARIANT of a program.
Function Call:
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
I_SAVE = 'A'
CHANGING
CS_VARIANT = I_VARIANT
Parameters
I_SAVE :
Description :
Controls the storage mode
Prerequisite:
The IS_VARIANT parameter has the appropriate value.
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 cannot 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.
CS_VARIANT:
Internal table containing the program name (and the default variant---optional )
Hope this helps
Suruchi
04-05-2006 11:42 AM
Hi Tina,
well, I normally use the following piece of code:
...
CONSTANTS: c_yes(1) TYPE c VALUE 'X'.
...
DATA: e_variant TYPE disvariant.
...
PARAMETERS: p_vari LIKE disvariant-variant.
...
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
CLEAR e_variant.
e_variant-report = sy-cprog.
e_variant-username = sy-uname.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = c_yes
CHANGING
cs_variant = e_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 0.
p_vari = e_variant-variant.
ENDIF.
PERFORM f4_for_variant.
...
FORM f4_for_variant.
*
DATA: l_exit(1) TYPE c.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = e_variant
i_tabname_header = 'T_LISTADO'
* i_tabname_item = ' '
* IT_DEFAULT_FIELDCAT =
i_save = 'A'
IMPORTING
e_exit = l_exit
es_variant = e_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 2.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
IF l_exit = space.
p_vari = e_variant-variant.
ENDIF.
ENDIF.
*
ENDFORM. " f4_for_variant
This allows you to enter a display variant BEFORE running your ALV report. Then, your call to the ALV should look a little bit like this:
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
...
is_variant = e_variant
...
I hope it helps. BR,
Alvaro
04-05-2006 11:42 AM
Provides the default variant for the list specified in the structure parameter CS_VARIANT of a program.
Parameters
I_SAVE
CS_VARIANT
Regards,
Sreenivasulu P
04-05-2006 11:45 AM