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: 

Specify Summation levels in ALV thru coding

Former Member
0 Kudos

My Alv is sub-totaling on the basis of say FIELD_A.

I am getting orange colored row showing subtotal at each new FIELD_A. till this point no problem.

When ALV is on my screen and I go to the following Menu path:

Settings > Summation levels > Define Drilldown >

A popup window with title "Sum Steps [Specify Breakdown]" displays and I have selected the row "FIELD_A" and pressed button copy.

Now my display changed to ALV with only "orange colored row " and that is what I want.

I want the program to start with this kind of display and I want to achieve the same through code (not variant though)

5 REPLIES 5

Former Member
0 Kudos

Hi

You should manage it by filling the parameter for sorting table.

DATA: LT_SORT TYPE LVC_S_SORT.

DATA: GT_SORT TYPE LVC_T_SORT.

LT_SORT-FIELDNAME = 'FIELDA'.

LT_SORT-UP = 'X'.

LT_SORT-GROUP = '*'.

LT_SORT-SUBTOT = 'X'.

LT_SORT-COMP = 'X'. <----If you want to compress the output.

append lt_SORT to gt_sort.

Max

Message was edited by: max bianchi

0 Kudos

max bianchi plz say more.

Former Member
0 Kudos

Dear Flora,

ALV provides such an amount of flexibility in analyzing the data. Its lot better if the summation and all is done the way you mentioned rather than getting it done through program.

Regards,

Deva.

Former Member
0 Kudos

yipees <b>EXPA</b> field did the magic I wanted.

So <i>Solved it on my own!</i> i guess.



FORM form_build_sortcat_1301 CHANGING value(it_sort) TYPE
slis_t_sortinfo_alv.
  DATA ls_sort LIKE LINE OF  it_sort .
  CLEAR ls_sort.
  ls_sort-spos = '1' .
  ls_sort-fieldname = 'KUNWE' .
  ls_sort-up = 'X' . "A to Z
* Uncomment it, if you want to hav sum on the basis of subordernumber
  ls_sort-subtot = 'X'.
<b>  ls_SORT-EXPA = 'X'.</b>
  ls_sort-down = space .
  APPEND ls_sort TO it_sort .
ENDFORM.

0 Kudos

Hi

what I said in my answer....or not?

Max