04-14-2015 12:45 PM
Hi
In classic alv I remember an option to expand total lines (show detail lines) and collapse total lines (hide detail lines) by clicking an icon.
But I developed the Z report but it’s not appearing
I have used the variant sort functionality.
I used the sum on ZWREBTR field
wa_fcat-do_sum = 'X'.
MODIFY it_fcat FROM wa_fcat TRANSPORTING do_sum
WHERE fieldname = 'ZWRBTR' AND
fieldname = 'WRBTR' .
wa_sort-spos = '1'.
wa_sort-fieldname = 'ZAUGBL_GL'.
wa_sort-tabname = 'IT_Z070_CUR'.
wa_sort-group = 'UL'.
wa_sort-up = 'X'.
* wa_sort-spos = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO it_sort.
CLEAR:wa_sort.
Afeter that I am sung the grid display
t_slis_layout_alv-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'MODIFY_ALV'
is_layout = t_slis_layout_alv
it_fieldcat = it_fcat
it_sort = it_sort
i_save = 'A'
is_variant = rs_variant
TABLES
t_outtab = it_z070_cur
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE text-032 TYPE 'E'. "'Display Error'
ENDIF.
If I use the * wa_sort-expa = 'X'. it will hide all line items and also t was not showing expand and collapse option
04-14-2015 1:37 PM
Hi,
there are only two parameters needed to achieve this:
do_sum = 'X' in fieldcat
and
subtot = 'X' in sort.
I just tried this options using BCALV_TEST_GRID test report and it works fine:
Check this report to compare to yours.
Regards,
Frisoni
04-14-2015 2:47 PM
04-14-2015 3:52 PM
In standard program BCALV_TEST_GRID, does it shows the expand icon?
04-15-2015 7:52 AM
Hello,
it works fine and collapse option works fine. it does not work if there are some Editable fields in ALV how to make it Work.
04-15-2015 2:34 PM
Hi,
I was running some tests and debugs, and if your ALV have some edit field set on, your ALV have some other behaviors, and remove expand icons is one among then.
So, it is not possible to show this icon.
But, as Nikolay said above, you still can use menu Settings -> Define Totals Drilldown to expand and collaps lines.
Regards,
Frisoni
04-15-2015 7:37 AM
Hi! Just to suggest another point of view - you can create necessary layout manually and save it as a default one. It takes 1 minute of time and requires no coding.
04-15-2015 7:52 AM
Hello,
it works fine and collapse option works fine. it does not work if there are some Editable fields in ALV how to make it Work.
04-15-2015 8:11 AM
A-ah, once I had a problem like that - user complained that he couldn't expand subtotals in an editable ALV. But I didn't have enough time for investigations and just advised him to go to menu Settings -> Define Totals Drilldown and choose the level of expanding subtotals