Application Development 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: 

Checkbox in ALV Grid

Former Member
0 Kudos

Hi all,

I have checkbox for each record in my ALV grid output. i need to delete some records which are checked in the output. But after i click the delete buttom i noticed that the records which i have checked in the output where not checked in the internal table. what is the procedure to change the internal table value to 'X'.

Please help me solve this issue,

Thanks,

Rajesh.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Rajesh,

ad the code below in bold , it will work fine

case sy-ucomm.

<b> 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.</b>

when 'DELETE'.

endcase.

15 REPLIES 15

gopi_narendra
Active Contributor
0 Kudos

lets suppose ur check box a cbox(1) type c.

loop at itab where cbox = 'X'.

delete itab.

endloop.

Hope this helps. for better understanding paste ur code

Former Member
0 Kudos

Hi Gopi,

The problem i face is that the value for checkbox in the internal table in not checked eventhough i check them in my alv output.

Thanks,

Rajesh.

0 Kudos

CAn you please paste ur part of code

0 Kudos

Hi Gopi,

I dont think so there is any problem in the code, but is there any command to save the changes made in the alv output.

Thanks,

Rajesh.

This is my issue.

When 'delete'.

loop at itab.

itab-check = ' '. this values should be 'X' but doesn't occur

endloop.

0 Kudos

Hi please correct ur code like this

<b>When 'delete'.

loop at itab where check = 'X'.

delete itab.

endloop.</b>

Former Member
0 Kudos

Hi Rajesh,

ad the code below in bold , it will work fine

case sy-ucomm.

<b> 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.</b>

when 'DELETE'.

endcase.

gopi_narendra
Active Contributor
0 Kudos

Hi Rajesh,

Case sy-ucomm.

when 'DELETE'.

loop at itab where checkbox = 'X'.

delete itab.

endloop.

endcase.

Please paste ur part of code.

Calling of the Function Module should be given the user command

call function 'REUSE_ALV_LIST_DISPLAY'

exporting

I_CALLBACK_PROGRAM = SY-REPID

IS_LAYOUT = IS_LAYOUT

IT_FIELDCAT = IT_FIELDCAT

<b> I_CALLBACK_USER_COMMAND = 'USER_COMMAND'</b> IT_EVENTS = IT_EVENTS

I_SAVE = C_ISAVE

tables

T_OUTTAB = IT_OUTPUT

exceptions

PROGRAM_ERROR = 1

others = 2.

if SY-SUBRC <> 0.

message id SY-MSGID type SY-MSGTY number SY-MSGNO

with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

Regards

Gopi

Message was edited by: Gopi Narendra

Former Member
0 Kudos

Hi,

Ur Using OOPS or Function modules.

Regards

Ahasan

0 Kudos

Iam using funcion modules,

Thanks,

Rajesh.

Former Member
0 Kudos

hi,

as suggested u should always have the function codes for pushbuttons in capital letters.

eg. <b>when 'delete'</b> will not work. but.. <b>when 'DELETE'</b>

Former Member
0 Kudos

Hi ALL,

I solved the issue.

Thanks for all ur answers,

Rajesh.

0 Kudos

Hi Rajesh,

I have exactly the same problem. Can you kindly tell me your solution? Thanks.

0 Kudos

Hi

Plz reply as I am also facing the same problem

0 Kudos

hi! I have the same problem, what do you do with this?

thanks!

0 Kudos

Hi ,

FORM user_command USING r_ucomm LIKE sy-ucomm "#EC

selfield TYPE slis_selfield.

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 r_ucomm.

WHEN 'CREATE'.

LOOP AT it_mara INTO wa_mara.

IF wa_mara-sel EQ 'X'.

WRITE:/ 'display'.

ENDIF.

ENDLOOP.

ENDCASE.

ENDFORM.

Check the above code it will solve ur problem. Thanks to Guest.

Thanks,

Bhanu.