Application Development and Automation 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: 
Read only

Checking whether checkbox is inactive

Former Member
0 Likes
785

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
Read only

Former Member
0 Likes
741

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
Read only

Former Member
0 Likes
741

Hi

READ LINE sy-index FIELD VALUE markfield into flag.

IF FLAG = 'X'.

-


> Checkbox active

ELSE.

ENDIF.

Max

Read only

Former Member
0 Likes
741
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. 
Read only

Former Member
0 Likes
742

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

Read only

0 Likes
741

Thanks Chandrasekhar!