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

capturing checked items in ALV

Former Member
0 Likes
522

Hi,

I have ALV with check boxes.How can i capture checked items in ALV?Can any one tell me step by step process?

  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM       = SY-REPID
      IT_FIELDCAT              = FIELDCAT  
      I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'
      I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
      I_SAVE                   = 'A'
    TABLES
      T_OUTTAB                 = T_INS
    EXCEPTIONS
      PROGRAM_ERROR            = 1
      OTHERS                   = 2.

Points guraranteed

cheers

kaki

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
502

Hi Kaki,

u had not declared ur layout,please declare it(wa_layout) and pass it to the FM.

declare one field in the internal table for checkbox named CHK.

wa_laout-box_fieldname = 'CHK'.

to get the checked entries.

FORM USER_COMMAND USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

.

case r_ucomm.

when 'SAVE'.

loop at itab where chk = 'X'.

u can get the checked values here

endloop.

ENDFORM.

3 REPLIES 3
Read only

suresh_datti
Active Contributor
0 Likes
502

Hi Kaki,

Pl take a look at this example program in SAP BCALV_EDIT_05. This example shows how to use checkboxes within an ALV Grid Control.

Regards,

Suresh Datti

Read only

Former Member
0 Likes
502

Hi Kaki,

Since it is normal ALV, you need to do some action

using some button, or enter.

and don't forget to take backup before calling the ALV Fm. since it is required to compare.

in the button action,

you need to do some thing like this.

case sy-ucomm.

when 'ENTER'.
if itab[] <> itab_backup[].
loop at itab where check = 'X'.
**do what ever you need...
endloop.

endif.
endcase.

thanks

vijay

Read only

Former Member
0 Likes
503

Hi Kaki,

u had not declared ur layout,please declare it(wa_layout) and pass it to the FM.

declare one field in the internal table for checkbox named CHK.

wa_laout-box_fieldname = 'CHK'.

to get the checked entries.

FORM USER_COMMAND USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

.

case r_ucomm.

when 'SAVE'.

loop at itab where chk = 'X'.

u can get the checked values here

endloop.

ENDFORM.