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

how to code for select all& deselect all?using menu buttons

hai,

i have generated a report with a single field from a database table and

i have a checkbox for each record/item in the report.

i need help in the following ..

now that i have menu buttons say "select all" and "deselect all"..

if select all is clicked then all checkboxes should be selected.

if deselect all is clicked, then all checkboxes should be deselected

i know that we have to use functional code and use case sy-ucomm etc.

when "selectall" etc..

can someone help me how to code for this to work exactly?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Mar 04, 2007 at 05:07 AM

    hi ,

    write the code.

    assume you have a field in the internal table as a checbox .

    case ok_code.

    when 'SELECTALL'.

    LOOP AT ITAB.

    ITAB-FIELDNAME = 'X' ( THE FIELD FOR CHECKBOX).

    MODIFY ITAB TRANSPORTING FIELDNAME WHERE FIELDNAME = ' '.

    EXIT.

    ENDLOOP.

    WHEN 'DESELECTALL'.

    LOOP AT ITAB.

    ITAB-FIELDNAME = ' ' ( THE FIELD FOR CHECKBOX).

    MODIFY ITAB TRANSPORTING FIELDNAME WHERE FIELDNAME = ' X'.

    EXIT.

    ENDLOOP.

    PLEASE REWARD IF USEFUL.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      it did not work for the code u had suggested...

      plz check it out and send me the exact working code..

      REPORT ZINTRACTIVE_PROJ .

      TABLES : SFLIGHT.

      DATA : BEGIN OF IT OCCURS 0,

      CARRID LIKE SFLIGHT-CARRID, FLDATE LIKE SFLIGHT-FLDATE,

      END OF IT.

      DATA : BOX TYPE C,

      LINE TYPE I.

      SELECT CARRID FLDATE FROM SFLIGHT INTO TABLE IT.

      LOOP AT IT.

      WRITE : / BOX AS CHECKBOX, IT-CARRID.

      ENDLOOP.

      LINE = SY-LINNO .

      SET PF-STATUS 'SELECT'.

      AT USER-COMMAND.

      CASE SY-UCOMM.

      WHEN 'SELECT'.

      DO LINE TIMES.

      READ LINE SY-INDEX FIELD VALUE BOX.

      IF BOX = 'X'.

      NEW-PAGE.

      WRITE : / IT-FLDATE.

      ENDIF.

      ENDDO.

      <b>WHEN 'SELECTALL'.

      LOOP AT IT.

      IT-CARRID = 'X'.

      MODIFY IT TRANSPORTING CARRID WHERE CARRID = IT-CARRID.

      EXIT.

      ENDLOOP.

      WHEN 'DESELECTALL'.

      LOOP AT IT.

      IT-CARRID = ''.

      MODIFY IT TRANSPORTING CARRID WHERE CARRID = 'X'.

      EXIT.

      ENDLOOP.</b>ENDCASE.

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.