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

checkbox

Former Member
0 Likes
1,415

hi

i have 2 checkbox on my selection screen

Im trying to disable one checkbox when the other one is selected, but its not working

see code below

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-002.

PARAMETERS : p_park AS CHECKBOX,

p_posted AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK block1.

AT SELECTION-SCREEN.

IF p_park = 'X'.

LOOP AT SCREEN.

IF screen-name = 'P_POSTED'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,391

Hi,

Replace your code with this code and it will work surely-------

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-002.

PARAMETERS : p_park AS CHECKBOX,

p_posted AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK block1.

AT SELECTION-SCREEN OUTPUT.

IF p_park = 'X'.

LOOP AT SCREEN.

IF screen-name = 'P_POSTED'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Thanks & Regards,

Vivek Gaur

9 REPLIES 9
Read only

former_member386202
Active Contributor
0 Likes
1,391

Hi,

Do it in AT SELECTION SCREEN ON OUTPUT event

Regards,

Prashant

Read only

Former Member
0 Likes
1,392

Hi,

Replace your code with this code and it will work surely-------

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-002.

PARAMETERS : p_park AS CHECKBOX,

p_posted AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK block1.

AT SELECTION-SCREEN OUTPUT.

IF p_park = 'X'.

LOOP AT SCREEN.

IF screen-name = 'P_POSTED'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Thanks & Regards,

Vivek Gaur

Read only

Former Member
0 Likes
1,391

hii

try using following statement and code

IF box EQ 'X'.

        MODIFY LINE sy-lilli  FIELD VALUE  box
             FIELD FORMAT box INPUT OFF.
        MODIFY LINE sy-lilli  FIELD VALUE  box FROM w_space.

regards

twinkal

Read only

Former Member
0 Likes
1,391

Hi,

Check the code you have written-

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-002.
PARAMETERS : p_park AS CHECKBOX,
p_posted AS CHECKBOX DEFAULT 'X' user-command p_posted.

SELECTION-SCREEN END OF BLOCK block1.

AT SELECTION-SCREEN OUTPUT.
IF p_park = 'X'.
LOOP AT SCREEN.
IF screen-name CS 'P_POSTED'.
screen-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

Read only

0 Likes
1,391

One more clarification please

the checkbox 'p_park' is always desactivated when we enter the selection screen

I want to give the user the option to tick any checkbox when he enters the selection screen

I tried to remove the DEFAULT 'X' in the paramaters SECTION but it wasnt good.

Anyone has any idea?

Read only

0 Likes
1,391

Hi,

have you tried the code which i have posted previously??

if not try this out..

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-002.

PARAMETERS : p_park AS CHECKBOX,

p_posted AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK block1.

AT SELECTION-SCREEN OUTPUT.

IF p_park = 'X'.

LOOP AT SCREEN.

IF screen-name = 'P_POSTED'.

screen-active = 1.

screen-INPUT = 0.

screen-OUTPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Hope this helps.

Read only

0 Likes
1,391

Yes it works

ive even allocated u the points, its just that I want one more clarification please

the checkbox 'p_posted' is always desactivated when we enter the selection screen

I want to give the user the option to tick any checkbox when he enters the selection screen

I tried to remove the DEFAULT 'X' in the paramaters SECTION but it wasnt good.

Anyone has any idea?

Read only

Former Member
0 Likes
1,391

Hi

AT SELECTION-SCREEN on output.

IF p_park = 'X'.

LOOP AT SCREEN.

IF screen-name = 'P_POSTED'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

~hitesh

Close the thread once your query is resolved

Read only

Former Member
0 Likes
1,391

Hi,

Try this code out,

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-002.

PARAMETERS : p_park AS CHECKBOX,

p_posted AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK block1.

AT SELECTION-SCREEN OUTPUT.

IF p_park = 'X'.

LOOP AT SCREEN.

IF screen-name = 'P_POSTED'.

screen-active = 1.

screen-INPUT = 0.

screen-OUTPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Hope this helps.