‎2013 Nov 25 10:07 AM
Hi,
Suppose if i have 10 abap reports and all these 10 reports are called in one single report say 'ABC'. Now for report ABC, can i create a variant with 10 checkboxes in it for different 10 programs? so that the user can check the required checkboxex and display the data instead of running all the 10 reports.
Eagerly waiting for the response.
Regards,
Gururaj.
‎2013 Nov 25 10:15 AM
‎2013 Nov 25 10:16 AM
Hi Gururaj,
I do my reports just like that. Declare variant variable"
DATA: z_variant LIKE disvariant.
On Selection screen add parameters as checkbox group:
PARAMETERS: radn RADIOBUTTON GROUP r1 DEFAULT 'X',
prof RADIOBUTTON GROUP r1,
parc RADIOBUTTON GROUP r1,
oper RADIOBUTTON GROUP r1.
and then before you call FM REUSE_ALV_GRID_DISPLAY:
* A L V V A R I A N T S E L E C T I O N
z_variant-report = sy-repid.
IF radn = 'X'.
z_variant-variant = '/DEFAULT'.
ELSEIF prof = 'X'.
z_variant-variant = '/PROFCENT'.
ELSEIF parc = 'X'.
z_variant-variant = '/PARCELE'.
ELSE.
z_variant-variant = '/OPERACIJE'.
ENDIF.
where DEFAULT, PROFCENT, PARCELE and OPERACIJE are saved layouts.
In FM call just export variant:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_background_id = 'ALV_BACKGROUND'
i_callback_program = sy-repid
i_callback_top_of_page = 'ALV_TOP_OF_PAGE'
i_default = 'X'
i_save = 'A'
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = t_fieldcat
it_events = t_events
it_event_exit = z_event_exit
is_layout = z_layout
is_variant = z_variant
...
Regards,
Vladimir