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: 

Dynamic Table----> Display Totals in REUSE_ALV_HIERSEQ_LIST_DISPLAY

0 Kudos

Hi All,

I'm not able to build the Totals Options for the Columns displayed in the Hierarchal List. The Table being passed to the FM is a Dynamic Table and the table fields are decided based on the user input. The number of fields in the table is also based on the user input. It could range from 16 - 60 Fields. Now, I want Totals and Sub-Totals for all the columns which contain Quantity Fields.

Could anyone help me out in doing this.

Thanks in advance.

Cheers,

Naresh

2 REPLIES 2

former_member583013
Active Contributor
0 Kudos

You need to pass the following to the quantity fields..


ls_fieldcat-do_sum = 'X'.

When you build the sort table, do this...


FORM sort_build USING lt_sort TYPE slis_t_sortinfo_alv.

  DATA: ls_sort TYPE slis_sortinfo_alv.

  CLEAR ls_sort.
  ls_sort-spos = 1.
  ls_sort-tabname = gt_tabname_item.
  ls_sort-fieldname = 'DESCBIEN'.
  ls_sort-subtot = 'X'.
  ls_sort-up = 'X'.
  ls_sort-group = 'UL'.
  APPEND ls_sort TO lt_sort.

ENDFORM.                    " sort_build

Has you any way of knowing which fields are quantity?

Greetings,

Blag.

0 Kudos

Yes. The quantity fields would be knowing.

I already filled the 'DO_SUM' parameter in the Field Catalog. But this Sort Table population is a bit confusion. Which values do in need to populate in the TABNAME and FIELDNAME...?? Do I need to pass the Header Key Fields or the Fields for which I need the 'Totals'?

Actually, the report is very Dynamic. Even the Header Fields are also based on the User Input.

For eg. Lets consider there are 16 fields that need to be displayed. Suppose the user enters 5 then the report should display the fields as follows.

Header--- 1stField 2ndField 3rdField 4thField 5thField

Item--- 6thField 7thfield..................................................16thField.

Could you let me know the Population of the Sort Table now..?

Thanks.