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

Default ALV sorting

Former Member
0 Likes
402

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:25 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
384

DATA: gt_sort TYPE slis_t_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

2 REPLIES 2
Read only

Former Member
0 Likes
384

Sort the internal table w.r.t that col before passing it to ALV or populate IT_SORT type SLIS_T_SORTINFO_ALV.

santhosh

Read only

Former Member
0 Likes
385

DATA: gt_sort TYPE slis_t_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