Skip to Content
author's profile photo Former Member
Former Member

Checkbox in a list

Hi ,

is there any method by which we can select/deselect all the checkboxes on a screen.

Regards

Arun

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Dec 06, 2004 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 06, 2004 at 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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.