Skip to Content
0
Former Member
Aug 04, 2011 at 09:49 AM

Reg: ALV List Display check box single click for selecting all records

138 Views

Dear All,

I have an requirement in normal alv list display. I created 2 buttons using menu painter and attached in PF status of alv list display. When i click first button i want to select all check box records. But my code is working in user command at double click.

I search sdn but there was oops alv only available for my scenario.

"BCALV_EDIT_05" This standard Program also used oops alv. But i need normal alv list display.

*-- In field catalog....

fcat-fieldname = 'CHECK'.

fcat-checkbox = 'X'.

fcat-input = 'X'.

fcat-edit = 'X'.

APPEND fcat TO fieldcat. CLEAR fcat.

*--In user cmmand....

FORM usercmd USING f2code LIKE sy-ucomm rs_selfield TYPE slis_selfield.

CASE f2code.

when 'SELALL'.

LOOP AT itab.

itab-check = 'X'.

MODIFY itab.

ENDLOOP.

rs_selfield-refresh = 'CHECK'.

when 'DESELECT'.

LOOP AT itab.

itab-check = ' '.

MODIFY itab.

ENDLOOP.

rs_selfield-refresh = 'CHECK'.

ENDCASE.

Could you please any one guide me.

Regards,

S.Kalaivani.