2007 Nov 07 7:22 PM
Hi gurus,
i have made one report. in this report we need different layout.
i have user reuse_alv_grid_display .
our requirement is we want to create one default layout and other user specific layout.
so if user doen't have his ownlayout then we want to display default layout otherwise display that user specific layout.
i am not able to figure it out how it works in this function module.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = g_repid
i_structure_name = 'ZSDMATATP'
it_fieldcat = zfield
it_sort = sortcat[]
I_DEFAULT = 'X'
i_save = 'U'
is_variant = g_variant
IMPORTING
e_exit_caused_by_caller = exit_caused_by_caller
es_exit_caused_by_user = exit_caused_by_user
tables
t_outtab = display
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
please tell me where i made mistake.
Thanks,
Jignesh.
Hi gurus,
i have made one report. in this report we need different layout.
i have user reuse_alv_grid_display .
our requirement is we want to create one default layout and other user specific layout.
so if user doen't have his ownlayout then we want to display default layout otherwise display that user specific layout.
i am not able to figure it out how it works in this function module.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = g_repid
i_structure_name = 'ZSDMATATP'
it_fieldcat = zfield
it_sort = sortcat[]
I_DEFAULT = 'X'
i_save = 'U'
is_variant = g_variant
IMPORTING
e_exit_caused_by_caller = exit_caused_by_caller
es_exit_caused_by_user = exit_caused_by_user
tables
t_outtab = display
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
please tell me where i made mistake.
Thanks,
Jignesh.
2007 Nov 07 7:33 PM
1. Put one parameter on the screen like:
PARAMETERS : P_VAR LIKE DISVARIANT-VARIANT obligatory.2. Assign the F4 help for that parameter
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VAR.
DATA: W_VARIANT LIKE DISVARIANT.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
IS_VARIANT = W_VARIANT
I_SAVE = e_save "Was 'A'
IMPORTING
ES_VARIANT = W_VARIANT
EXCEPTIONS
NOT_FOUND = 1
PROGRAM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC EQ 0.
P_VAR = W_VARIANT-VARIANT.
ELSE.
W_VARIANT-REPORT = SY-REPID.
ENDIF.3. Pass this W_VARIANT to FM
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IS_VARIANT = W_VARIANT
.....By this way, user has to select at least one variant. He can pull down the F4 help for avaliable variants. He can see the default one alongwith his own variants if he has any.
Regards,
Naimesh Patel
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |