Application Development 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: 

Use different Layouts for Summary and Details in Drill down report

Former Member
0 Kudos

Hi All,

I have a 2 level drill down report in ALV.

The summary report has certain fields and the Detail report has different fields. Now my problem is that when i use a default layout (with all fields of summary report) for the summary report, and drill down to the detail report i'm missing the fields on detail that are not in Summary. And if i save the default layout as default (with all fields of Detail) and go back to sumary, I'm missing the some other fields on summary (which are not on detail report).

Is there a way to make different default layouts for each of those summary and detail reports:

Also as the layouts are choosen by the user, i cannot hardcode any particular layout;

So if the user chooses a layout for detail; it has to stay the same layout for the detail report if he goes to summary and then back to detail; unless the user changes the layout again.

I'm using two different Layout types for each report. but i still cannot get the desired effect.


Data:
      gt_layout_s             type slis_layout_alv,
      gt_layout_d             type slis_layout_alv,


  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_callback_program       = g_repid
      is_layout                = <b>gt_layout_s</b>
      i_callback_top_of_page   = g_top_of_page
      i_callback_user_command  = g_user_command
      i_callback_pf_status_set = g_status
      i_save                   = g_save
      is_variant               = gs_variant
      it_fieldcat              = gt_fieldcat[]
      it_events                = gt_events[]
    importing
      es_exit_caused_by_user   = gs_exit_caused_by_user
    tables
      t_outtab                 = it_summary.


  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_callback_program       = g_repid
      is_layout                = <b>gt_layout_d</b>
      i_callback_top_of_page   = g_top_of_page
      i_callback_user_command  = g_user_command
      i_callback_pf_status_set = g_status
      i_save                   = g_save
      is_variant               = gs_variant
      it_fieldcat              = gt_fieldcat[]
      it_events                = gt_events[]
    importing
      es_exit_caused_by_user   = gs_exit_caused_by_user
    tables
      t_outtab                 = it_detail_disp.

1 ACCEPTED SOLUTION

Former Member

Here is how you differentiate between the layout of two different grids. There is the parameter, IS_VARIANT in the function. You usually leave it empty or pass only the report name and username. <b>What you need to do is to pass unique string for each grids to the HANDLE field of the parameter IS_VARIANT.</b> You can probably hard code it as HEADER and DETAILS in your case. Once that is done, system identified that these two different layout for different grids.

Regards,

Ravi

Note : Please mark all the helpful answers<u></u>

5 REPLIES 5

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

How is the gt_layout_s layout differ from the gt_layout_d layout? Can I see the code that is filling these structures?

Regards.

Rich Heilman

0 Kudos

Hi rich,

I tried to fill something different but it wasn't working.

So right now they are both the same and empty when i pass them.

Thanks,

raj.

Former Member

Here is how you differentiate between the layout of two different grids. There is the parameter, IS_VARIANT in the function. You usually leave it empty or pass only the report name and username. <b>What you need to do is to pass unique string for each grids to the HANDLE field of the parameter IS_VARIANT.</b> You can probably hard code it as HEADER and DETAILS in your case. Once that is done, system identified that these two different layout for different grids.

Regards,

Ravi

Note : Please mark all the helpful answers<u></u>

0 Kudos

Hi Ravi,

This worked out like a charm.

Thanks again,

Raj.

0 Kudos

This is what I was thinking, the layout parameter doesn't actually help with the layout of the alv grid, it is more of characterisitics of the grid. The column layout is modified by the variant.

Regards,

Rich Heilman