Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Variant creation

Former Member
0 Likes
517

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.

2 REPLIES 2
Read only

former_member209120
Active Contributor
0 Likes
488

This message was moderated.

Read only

vladimir_erakovic
Contributor
0 Likes
488

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