Skip to Content
author's profile photo Former Member
Former Member

Use different Layouts for Summary and Details in Drill down report

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.

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2006 at 04:46 PM

    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>

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • Posted on Aug 01, 2006 at 04:28 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.