09-21-2006 4:02 AM
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.
09-21-2006 5:24 AM
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.
09-21-2006 4:07 AM
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
09-21-2006 4:14 AM
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.
09-21-2006 4:16 AM
09-21-2006 4:26 AM
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.
09-21-2006 5:17 AM
Hi please correct ur code like this
<b>When 'delete'.
loop at itab where check = 'X'.
delete itab.
endloop.</b>
09-21-2006 5:24 AM
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.
09-21-2006 7:14 AM
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
09-21-2006 7:19 AM
09-21-2006 7:24 AM
09-21-2006 7:30 AM
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>
09-21-2006 7:53 AM
09-23-2006 4:41 AM
Hi Rajesh,
I have exactly the same problem. Can you kindly tell me your solution? Thanks.
12-08-2006 7:14 PM
12-26-2006 2:45 PM
07-13-2010 2:01 PM
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.