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 Grid Column Select

Former Member
0 Likes
1,052

hi,

i am using the function 'REUSE_ALV_GRID_DISPLAY' and would to know in the user_command form when user is selecting a column, like the functionality of row_selected.

in my program i need the user to choose a column and push a button. i must know in the user command form what column was selected and if it is chosen and not just the head marked.

thank you,

Roi Grosfeld

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
827

Hi

You need to call the FM REUSE_ALV_GRID_LAYOUT_INFO_GET in your user-command.

In this fm there's the parameter ET_MARKED_COLUMNS where you should get out the informations you need.

Max

Message was edited by: max bianchi

hi,

i am using the function 'REUSE_ALV_GRID_DISPLAY' and would to know in the user_command form when user is selecting a column, like the functionality of row_selected.

in my program i need the user to choose a column and push a button. i must know in the user command form what column was selected and if it is chosen and not just the head marked.

thank you,

Roi Grosfeld

3 REPLIES 3
Read only

Former Member
0 Likes
828

Hi

You need to call the FM REUSE_ALV_GRID_LAYOUT_INFO_GET in your user-command.

In this fm there's the parameter ET_MARKED_COLUMNS where you should get out the informations you need.

Max

Message was edited by: max bianchi

Read only

Former Member
0 Likes
827

hi, in the USER_COMMAND form, you can do like following:


data: it_mark  type SLIS_T_FIELDCAT_ALV.
  CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
       IMPORTING
            ET_MARKED_COLUMNS         =  it_mark[].

call this function in USER_COMMAND form, the selected column will be stored in it_mark.

Hope it will be helpful

thanks

Read only

former_member186741
Active Contributor
0 Likes
827

Hi there,

the form used to process the user_command event has a parameter which you can use to determine which column was selected (fieldname) and which row too (tabindex).

Eg, the following only operates if the Customer number or Name columns have been acted on and reads the underlying internal table based on the index....

FORM user_command

USING i_ucomm LIKE sy-ucomm

i_selfield TYPE slis_selfield.

CASE i_selfield-fieldname.

  • CUSTOMER OR CUSTOMER NAME.......

WHEN 'KUNNR' OR 'NAME1'.

READ TABLE t_dtl ASSIGNING <detail> INDEX i_selfield-tabindex.

CHECK sy-subrc = 0.

..........................

Regards

neil