Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Checking whether checkbox is inactive

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

Hi

READ LINE sy-index FIELD VALUE markfield into flag.

IF FLAG = 'X'.

-


> Checkbox active

ELSE.

ENDIF.

Max

Former Member
0 Kudos
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. 

Former Member
0 Kudos

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

0 Kudos

Thanks Chandrasekhar!