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

How to process checkbox change in a simple list?

Hi guys,

I'm in a middle of a task, where some table is asked to be written on the screen (simple WRITE statement) and one of the fields is written in a way:

...

LOOP AT it.

WRITE: it-f1 AS CHECKBOX.

ENDLOOP.

...

The screen in simple, PF-STATUS is not complex also.

Everything is shown as expected. But I've been asked to manipulate content of the it-f1 depending on the user-action on the screen - i.e. if the user checked/unchecked f1 at line 23, this should be corrected into an it[23] also. In my PF-STATUS I have a 'SAVE' button, and after pressing it I should have my internal table filled correctly depending on the user interaction. The table is expected to be long (approx. 200-300 records or so).

How to achieve this? I played with AT LINE-SELECTION and much more which I found in the docu, but with no success until now.

Any help would be highly appreciated.

If any specifics are needed, I'm ready to supply them here.

Many thanks in advence.

Ivaylo

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 09, 2004 at 11:44 AM

    Hello ,

    The following code sample should do the trick.

    ==========================================================

    REPORT  ZTEST no standard page heading.
    
    data : begin of itab occurs 0,
             check type c,
             value type i,
           end of itab.
    
    data: w_line_no  type i,
          w_itab(72) type c.
    
    start-of-selection.
    
    do 10 times.
      itab-value = sy-index.
      append itab.
    enddo.
    
    loop at itab.
      write : / itab-check as checkbox,
                itab-value.
    endloop.
    
    at user-command.
    
    if sy-ucomm eq 'SAVE'.
      clear itab.
      loop at itab.
        w_line_no = sy-tabix.
        read line w_line_no line value into w_itab.
        itab-check = w_itab(1) .
        modify itab transporting check.
      endloop.
    endif.
    
    

    ==========================================================

    Get back if you have any more doubts on this.

    Regards,

    Anand Mandalika.

    P.S. : Don't forget to award the points if you like the solution.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 09, 2004 at 10:29 AM

    Hi,

    Use the following peace of code to find whether check box is selected or not for that if so...

    Code:

    do n times. (Here N is no of records on list)

    read line sy-index field value wc_check.

    if wc_check eq 'X'.

    write select query to fetch records

    endif.

    enddo.

    If i am not understand issue please reply again!!!

    Best regards

    Suresh Babu Karanam

    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.