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

Sorting problem with ALV.

Former Member
0 Likes
574

Hallo guyes,

I have an usual ALV grid where I dispaly some documents f.e.

When I sort the content according to marked column using standard ALV button and

after that I want to jump into choosen document by 2clicking on it I jump into

the wrong one.

Problem is that my 'program itab' is not sorted. Itab lines are still in position like

after first dispaly.

How can I handle this problem?

I wanted to use before_user_command event to sort my itab according to marked column

but it doesn't work.

IF e_ucomm = '&SORT_DSC'.

CALL METHOD ref_alv->get_selected_columns

IMPORTING

et_index_columns = lt_index_columns.

CLEAR ls_index_columns.

READ TABLE lt_index_columns INTO ls_index_columns

INDEX 1.

SORT gt_best BY ls_index_columns-fieldname DESCENDING.

ENDIF.

CALL METHOD ref_alv->set_user_command

EXPORTING i_ucomm = space.

Any other idea?

Thanks a lot.

3 REPLIES 3
Read only

Former Member
0 Likes
506

No idea?

Read only

0 Likes
506

are you using the OOALV or normal alv. why can't you use Normal(Standard )Sort functionality.

i am not getting what is the reason you are going for it.

Read only

0 Likes
506

I do use standard 'manual' sort but after that my itab is not sorted according to what I see on screen.

So after 2clicking on one line I don't get the correct values. You know what I mean?

And I am using OOALV.