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
997

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
Read only

Former Member
0 Likes
881

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
Read only

Former Member
0 Likes
881

Fill sort catalogue (IT_SORT table)

Read only

Former Member
0 Likes
881

what is w.r.t. ?

Read only

Former Member
0 Likes
881

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

Read only

vinod_vemuru2
Active Contributor
0 Likes
881

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.

Read only

Former Member
0 Likes
881

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.

Read only

Former Member
0 Likes
882

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.

Read only

Former Member
0 Likes
881

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