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: 

Default ALV sorting

former_member181995
Active Contributor
0 Kudos
219

Hi,

My requirement is like that when user run the report a ALV should be comes sorted w.r.t. to one column..

<REMOVED BY MODERATOR>

Amit.

Edited by: Alvaro Tejada Galindo on Apr 25, 2008 1:03 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos
103

hi when you give that sort itab it will not sort itab by any column .

if you specify

sort itab by field it will do in ascending by default .

regards,

venkat.

7 REPLIES 7

Former Member
0 Kudos
103

Fill sort catalogue (IT_SORT table)

Former Member
0 Kudos
103

what is w.r.t. ?

Former Member
0 Kudos
103

Fill sort catalogue (IT_SORT table) in the function module for ALV

vinod_vemuru2
Active Contributor
0 Kudos
103

Hi Jony,

Just sort the output internal table by the field u want before passing it to the Function module.

SORT itab BY f3.

CALL FUNCTION REUSE_ALV..

Here pass ur itab.

Thanks,

Vinod.

Former Member
0 Kudos
103

Hi Jony,

You can sort the internal table based on the field requiread and pass it to the ALV FM or method.

Hope it helps.

Former Member
0 Kudos
104

hi when you give that sort itab it will not sort itab by any column .

if you specify

sort itab by field it will do in ascending by default .

regards,

venkat.

former_member181995
Active Contributor
0 Kudos
103

DATA: gt_sort TYPE slis_t_sortinfo_alv,

gs_sort TYPE slis_sortinfo_alv.

CLEAR gs_sort.

gs_sort-fieldname = 'LDDAT'.

gs_sort-spos = 1.

gs_sort-up = 'X'.

gs_sort-subtot = 'X'.

APPEND gs_sort TO gt_sort.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = v_repid

i_callback_user_command = 'PROCESS_USER_COMMANDS'

is_layout = w_layout

it_fieldcat = i_fieldcat[]

it_sort = gt_sort[]

i_default = 'X'

i_save = 'A'

it_events = v_events

is_print = w_print

TABLES

t_outtab = i_final1