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

Checking whether checkbox is inactive

Hello!

My report outputs lines from DB to a list. In the list, there are lines with checkboxes. I mark a checkbox -> do an operation on the specified line -> return to the list. I make the checkbox in the line inactive through the following statement:

DATA markfield TYPE c.

DO lines TIMES.

READ LINE sy-index FIELD VALUE markfield.

MODIFY LINE sy-index FIELD VALUE markfield

FIELD FORMAT markfield INPUT OFF.

ENDDO.

Now, I want to check if the checkbox (markfield variable) is inactive and change it to active. How the logical expression should look like in the condition of IF statement?

I had this idea:

DO lines TIMES.

READ LINE sy-index FIELD VALUE markfield.

IF FIELD VALUE markfield FIELD FORMAT markfield INPUT OFF

MODIFY LINE sy-index FIELD VALUE markfield

FIELD FORMAT markfield INPUT OFF.

ENDIF.

ENDDO.

or:

DO lines TIMES.

READ LINE sy-index FIELD VALUE markfield.

MODIFY LINE sy-index FIELD VALUE markfield

FIELD FORMAT markfield INPUT ON

WHERE ....... " what condition?

ENDDO.

Count on your help 😊

Regards

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 26, 2007 at 11:01 AM

    check these useful tips

    if checkbox = 1. " It is marked and inactive

    = X " it is marked and active

    = 0 " it is not marked and inactive

    = space " it is not marked and active

    u can modify ur code accordingly

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 26, 2007 at 10:53 AM

    Hi

    READ LINE sy-index FIELD VALUE markfield into flag.

    IF FLAG = 'X'.

    -


    > Checkbox active

    ELSE.

    ENDIF.

    Max

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 26, 2007 at 10:57 AM
    DO lines TIMES.
    READ LINE sy-index FIELD VALUE markfield into field.
     if field <> 'X'.
       write ' Check Box is Inactive'.
     endif.
    MODIFY LINE sy-index FIELD VALUE markfield
    FIELD FORMAT markfield INPUT ON
    WHERE ....... " what condition?
    ENDDO. 
    
    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.