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

ALV sorting

Former Member
0 Likes
1,153

Hi,

I have designed a ALV grid based report.

If i select more than 1 column and press button means,in user command i am getting only one field name which was selected last.

My user command subroutine is like :

form user_command using r_ucomm like sy-ucomm

rs_selfield type slis_selfield.

endform.

How can i get both the column names (fields) in the user command subroutine.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,114

Is it possible or not

9 REPLIES 9
Read only

Former Member
0 Likes
1,115

Is it possible or not

Read only

0 Likes
1,114

Since this is a structure, I don not think this would be possible to get that value in thsi sturcture,.. But what is your exact requirement

Edited by: Suzie on Sep 15, 2011 3:24 PM

Read only

Former Member
0 Likes
1,114

Hi

If you use FM REUSE ALVDRID display it will sort Or mean for any number of coloumns.

Read only

0 Likes
1,114

Yes in Reuse_ALV_Grid_Display we can use that sort parameter.

but in run time the user can click at any columns,

That user selected columns i need.

Read only

0 Likes
1,114

Hi ,

You can insert a coloumn of Checkbox in your ALV.

Based on the checkboxes selected by the user you can get to know the rows selected...

Read only

0 Likes
1,114

Thanks Praful,

but i need the columns selection,not row selection

Read only

Former Member
0 Likes
1,114

Not anwsered

Read only

0 Likes
1,114

The following is the FM we want to use in the User command subroutine to find out the columns which we user has selected.

DATA : it_layouts TYPE slis_layout_alv,

it_fields TYPE SLIS_T_FIELDCAT_ALV,

it_marked1 TYPE SLIS_T_FIELDCAT_ALV.

CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'

IMPORTING

es_layout = it_layouts

et_fieldcat = it_fields

et_marked_columns = it_marked1

EXCEPTIONS

no_infos = 1

program_error = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

Read only

Former Member
0 Likes
1,114

Thanks for all,for sharing your ideas.