12-06-2004 12:29 PM
Hi ,
is there any method by which we can select/deselect all the checkboxes on a screen.
Regards
Arun
12-06-2004 12:53 PM
If its on a list screen then you can have two button for select all and deselect all and on user command you can use one of the forms below.
form select_all.
wf_n = 1 .
do.
read line wf_n field value box.
if sy-subrc ne 0 .
exit.
endif.
if box = space .
box = 'X'.
modify line wf_n field value box .
endif.
wf_n = wf_n + 1 .
enddo.
endform. " select_all
form deselect_all.
clear wf_line1.
clear wf_line.
wf_n = 1 .
do.
read line wf_n field value box.
if sy-subrc ne 0 .
exit.
endif.
if box = 'X' .
box = space.
modify line wf_n field value box .
modify line wf_n line format color col_normal
intensified on .
endif.
wf_n = wf_n + 1 .
enddo.
endform. " deselect_all
Hope this helps.
Regards
Raja
12-06-2004 12:51 PM
Sorry I did not read your question correctly and write the code for selection-screen.
REPORT zsilf .
TABLES sscrfields.
FIELD-SYMBOLS:
<fs>.
PARAMETERS:
vbeln LIKE vbak-vbeln,
give a groupname for checkboxes
zcheck AS CHECKBOX MODIF ID chk,
zcheck2 AS CHECKBOX MODIF ID chk.
SELECTION-SCREEN PUSHBUTTON /10(20) pushy USER-COMMAND abcd.
INITIALIZATION.
MOVE 'Clear' TO pushy.
AT SELECTION-SCREEN.
CHECK sscrfields-ucomm = 'ABCD'.
LOOP AT SCREEN.
clear all checkboxes
CHECK screen-group1 EQ 'CHK'.
ASSIGN (screen-name) TO <fs>.
CLEAR <fs>.
ENDLOOP.
START-OF-SELECTION.
Message was edited by: Fuat Ulugay
12-06-2004 12:53 PM
If its on a list screen then you can have two button for select all and deselect all and on user command you can use one of the forms below.
form select_all.
wf_n = 1 .
do.
read line wf_n field value box.
if sy-subrc ne 0 .
exit.
endif.
if box = space .
box = 'X'.
modify line wf_n field value box .
endif.
wf_n = wf_n + 1 .
enddo.
endform. " select_all
form deselect_all.
clear wf_line1.
clear wf_line.
wf_n = 1 .
do.
read line wf_n field value box.
if sy-subrc ne 0 .
exit.
endif.
if box = 'X' .
box = space.
modify line wf_n field value box .
modify line wf_n line format color col_normal
intensified on .
endif.
wf_n = wf_n + 1 .
enddo.
endform. " deselect_all
Hope this helps.
Regards
Raja