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

SELECTION OF MULTIPLE ROWS

Former Member
0 Likes
1,430

Hi all,

i am using FM REUSE_ALV_GRID_DISPLAY TO display records.

I am able to select only one row ata time .

i need to use ctrl or shift key to select multiple rows

is there a way that i can select multiple rows with just using mouse and without using shift or ctrl KEYS

tHANKS

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,091

I think you can click on one row and drag down to select more rows.

Regarsd,

Rich Heilman

Read only

0 Likes
1,091

Hi Rich,

i have to select like random rows .

say like 1 ,3 7, 11---

is it posiible.

i saw some standard SAP screens similar to this .

where i can select without using CTRL OR shift keys

let me know

thanks

Read only

0 Likes
1,091

Hi,

declare a variable-name as 'box' of type char in ur internal table which u pass to alv grid fm

sample code

layout settings declaration.

data: wg_gs_layout TYPE slis_layout_alv.

write this stmt befor u call the alv grid fm.

wg_gs_layout-box_fieldname = 'BOX'.

this will help u to select multiple row in random from alv report

Read only

0 Likes
1,091

But after selecting multiple rows how to retrieve the seelcted rows ? In the user_event , i cld see the field 'selfield' of TYPE slis_selfield which holds only one record info ?

Read only

0 Likes
1,091

Hi,

Use the following function in user_command subroutine to know the selected coloumn in ALV.

FORM user_cmd USING ucomm1 LIKE sy-ucomm

selfield TYPE slis_selfield."#ec *

DATA ref1 TYPE REF TO cl_gui_alv_grid.

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

IMPORTING

e_grid = ref1.

CALL METHOD ref1->check_changed_data.

CASE ucomm1 .

WHEN 'SAVE'.

UPDATE ekko FROM TABLE itab.

COMMIT WORK.

ENDFORM. "user_cmd

Read only

Former Member
0 Likes
1,091

hi,

we can use

select upto n rows from table itab where <condition>.

example.

data : begin of itab_mara,

matnr like mara-matnr,

enum like mara-enum,

end of itab_mara.

selection-screen : begin of block blk1 with frame title text-001.

select-options : s_matnr for mara-matnr,

selection-screen : end of block blk1.

select upto 5 rows from table itab_mara where matnr in s_matnr.

if the rows which u want to select is not random rows.

reward with points if helpful.