2007 Jul 09 12:08 PM
hi,
pls explain in detail how to use the variant in alv report ,what is the use of that we used to call the function module reuse_alv_varint_f4 and reuse_alv_variant_existance,
what is the use of that., what are the parameter have to pass.
i dont anything about that pls tell me in detail with example.
pls help
hi,
pls explain in detail how to use the variant in alv report ,what is the use of that we used to call the function module reuse_alv_varint_f4 and reuse_alv_variant_existance,
what is the use of that., what are the parameter have to pass.
i dont anything about that pls tell me in detail with example.
pls help
2007 Jul 09 12:39 PM
Hi,
We usually use the variant in the ALV gid, for viewing the required fields, we use to save the variants and use it for laterpur pose.
report zrich_0003.
data: g_save type c value 'X'.
data: g_variant type disvariant.
data: gx_variant type disvariant.
data: g_exit type c.
data: ispfli type table of spfli.
parameters: variant like disvariant-variant.
at selection-screen output.
check variant is initial.
gx_variant-report = sy-repid.
call function 'REUSE_ALV_VARIANT_DEFAULT_GET'
exporting
i_save = g_save
changing
cs_variant = gx_variant
exceptions
not_found = 2.
if sy-subrc = 0.
variant = gx_variant-variant.
endif.
POV for Layout
at selection-screen on value-request for variant.
g_save = 'A'.
clear g_variant.
g_variant-report = sy-repid.
gx_variant = g_variant.
call function 'REUSE_ALV_VARIANT_F4'
exporting
is_variant = g_variant
i_save = g_save
importing
e_exit = g_exit
es_variant = gx_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 g_exit = space.
variant = gx_variant-variant.
endif.
endif.
start-of-selection.
select * into table ispfli from spfli.
g_variant-report = sy-repid.
g_variant-variant = variant.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_structure_name = 'SPFLI'
i_save = g_save
is_variant = g_variant
tables
t_outtab = ispfli
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
2007 Jul 09 12:42 PM
Hi,
Try this one
CALL_ALV
DATA: VARIANT TYPE DISVARIANT.
VARIANT-REPORT = SY-REPID.
VARIANT-USERNAME = SY-UNAME.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IT_FIELDCAT = FIELDCAT
IS_VARIANT = VARIANT
I_SAVE = 'U'
TABLES
T_OUTTAB = IALV.
<b>rEWARD POINTS</b>
rEGARDS
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |