Skip to Content
0
Former Member
Jan 19, 2008 at 03:09 PM

ALV - Sort

19 Views

HI All,

I want to do Total sum and Sub total ZRATE(CURR) with respect to ZCLIENT(Char10).

Can you please what is wrong in my code.

Correct me if i am wrong.

Even DOSUM is also not working....

DEFINE m_fieldcat.

add 1 to ls_fieldcat-col_pos.

ls_fieldcat-fieldname = &1.

ls_fieldcat-tabname = 'IT_PIPE'.

ls_fieldcat-seltext_l = &2.

ls_fieldcat-do_sum = &3.

append ls_fieldcat to lt_fieldcat.

END-OF-DEFINITION.

m_fieldcat 'ZCLIENT' 'Client' ' '.

m_fieldcat 'ZRATE' 'Rate' 'X'.

DEFINE m_sort.

add 1 to ls_sort-spos.

ls_sort-fieldname = &1.

ls_sort-up = 'X'.

ls_sort-subtot = &2.

append ls_sort to lt_sort.

END-OF-DEFINITION.

m_sort 'ZCLIENT ' 'X' .

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = sy-repid

it_fieldcat = lt_fieldcat

it_sort = lt_sort

TABLES

t_outtab = it_pipe.

Thanks,

Ashok...