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: 

unable to expand and collapse the subtotal in alv output

Former Member
0 Kudos

Hi,

I have an issue to expand and collapse the subtotal fileds in the alv output ,

I have tried setting the property of the sort table to exp and the layout property to expand all and to expand the filedname.

Please suggest

Thanks and Regards

Jatender

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Which kind of ALV?

The field for expand/collapse should be used for hierarchical ALV

U should manage the field EXPA of SORTING table.

MAx

4 REPLIES 4

Former Member
0 Kudos

Hi

Which kind of ALV?

The field for expand/collapse should be used for hierarchical ALV

U should manage the field EXPA of SORTING table.

MAx

0 Kudos

I am using standard alv function REUSE_ALV_GRID_DISPLAY.

0 Kudos

Hi

Try this sample (but I don't know if you want this result):

type-pools slis.

parameters: p_comp radiobutton group r1 default 'X',
            p_expa radiobutton group r1.

data: begin of itab occurs 0,
        lifnr like lfa1-lifnr,
        waers like t001-waers,
        wrbtr like bseg-wrbtr,
      end   of itab.

DATA: GT_FIELDCAT   TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
      GT_SORT       TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE,
      GT_LAYOUT     TYPE SLIS_LAYOUT_ALV.

data: lt_report     type sy-repid.

start-of-selection.

  do 4 times.
    move sy-index   to itab-lifnr.
    move    'EUR'   to itab-waers.
    move    '10.21' to itab-wrbtr.
    append itab.
    move    'USD'   to itab-waers.
    move    '11.21' to itab-wrbtr.
    append itab.
  enddo.

end-of-selection.
  lt_report = sy-repid.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      I_PROGRAM_NAME     = lt_report
      I_INTERNAL_TABNAME = 'ITAB'
      I_INCLNAME         = lt_report
    CHANGING
      CT_FIELDCAT        = GT_FIELDCAT[].

  loop at gt_fieldcat where fieldname = 'WRBTR'.
    gt_fieldcat-do_sum = 'X'.
    modify gt_fieldcat.
  endloop.

  GT_SORT-spos      = 1.
  GT_SORT-fieldname = 'LIFNR'.
  GT_SORT-up        = 'X'.
  GT_SORT-subtot    = 'X'.
  GT_SORT-comp      = p_comp.
  GT_SORT-expa      = p_expa.
  append gt_sort.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      IT_FIELDCAT = GT_FIELDCAT[]
      IT_SORT     = GT_SORT[]
    TABLES
      T_OUTTAB    = itab.

Max

0 Kudos

Thanks Dear friend