Application Development and Automation 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: 
Read only

Sort Using Class CL_GUI_ALV_GRID

0 Likes
927

Hi Experts,

I want to sum a columm of a internal table (it_outtab) Method : CL_GUI_ALV_GRID->set_table_for_first_display.

I'm using the method set_sort_criteria to sort, but isn't working.

The following code is correct?

clear: wa_sort.

wa_sort-SPOS = '01'.

wa_sort-FIELDNAME = 'MATNR'.

wa_sort-UP = 'X'.

append wa_sort to it_sort.

clear: wa_sort.

wa_sort-SPOS = '02'.

wa_sort-FIELDNAME = 'WERKS'.

wa_sort-UP = 'X'.

append wa_sort to it_sort.

clear: wa_sort.

wa_sort-FIELDNAME = 'LABST'.

wa_sort-SUBTOT = 'X'.

append wa_sort to it_sort.

CALL METHOD og_alv_grid->set_sort_criteria

EXPORTING

it_sort = it_sort

EXCEPTIONS

no_fieldcatalog_available = 1

others = 2

I want to sum the column LABST.

Thanks.

Pacifier

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
538

Hi,

Did you mentioned the field do_sum in fieldcat?


fs_fcat type lvc_s_fcat.
fs_fcat-LABST = 'X'.

Regards,

Raghava Channooru

2 REPLIES 2
Read only

Former Member
0 Likes
539

Hi,

Did you mentioned the field do_sum in fieldcat?


fs_fcat type lvc_s_fcat.
fs_fcat-LABST = 'X'.

Regards,

Raghava Channooru

Read only

0 Likes
538

Hi Raghava,

Thanks for help.

After fill the field the problem was solved and won't necessary to use the method set_sort_criteria.

Thanks,

Denilson