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

checkboxec on selection-screen

Former Member
0 Likes
814

hi frens,

i have 3 checkboxes on selection-screen.

1st one-should be already checked and grey

2- unchecked

3-checked

so when i check the 2nd one.

1st-checked and ungrey

2-checked

3-ckecked and ungrey

6 REPLIES 6
Read only

Former Member
0 Likes
796

Hi,

check this sample code..



PARAMETERS: p_c1 AS CHECKBOX user-command USR1 DEFAULT 'X',
                        p_c2 AS CHECKBOX user-command USR2,
                        p_c3 AS checkbox    userc-command USR3 DEFAULT 'X'.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

* If the second check box is checked..disable the first one.
 IF P_C2 = ' ' AND SCREEN-NAME = 'P_C1'.
   SCREEN-INPUT = 0.
 ENDIF.

 IF P_C2 = ' ' AND SCREEN-NAME = 'P_C3'.
   SCREEN-INPUT = 0.
 ENDIF.

 IF P_C2 = 'X'.
   P_C1 = 'X'.
   P_C3 = 'X'.
 ENDIF.

 MODIFY SCREEN.

ENDLOOP.


Thanks,

Naren

Read only

Former Member
0 Likes
796

you need to write the code to make the checkboxes editable or uneditable.

the code will be instantiated by using commmand AT-USER COMMAND edit_checkbox on field p_checkbox.

then write the foolowing code in perform edit_checkbox.

loop at screen.

if screen-value = 'CHECHBOX2'.

screen-active = '1' . 1 stands for true.

modify screen.

endif.

endloop.

reward points if helpful

Read only

Former Member
0 Likes
796

Hi,

Check out the code

SELECTION-SCREEN BEGIN OF BLOCK B1.

PARAMETER : A AS CHECKBOX DEFAULT 'X',
            B AS CHECKBOX,
            C AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK B1.

AT SELECTION-SCREEN OUTPUT

 LOOP AT SCREEN.
   IF SCREEN-NAME = 'A'.
     SCREEN-INPUT = 0.
     MODIFY SCREEN.
   ENDIF.
 ENDLOOP.

Regards,

Richa

Read only

Former Member
0 Likes
796

hi,

PARAMETERS: p1 AS CHECKBOX user-command USR1 DEFAULT 'X',

p2 AS CHECKBOX user-command USR2,

p3 AS checkbox userc-command USR3 DEFAULT 'X'.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

  • If the second check box is checked..disable the first one.

IF P2 = ' ' AND SCREEN-NAME = ' P1'.

SCREEN-INPUT = 0.

ENDIF.

IF P2 = ' ' AND SCREEN-NAME = ' P_C3 '.

SCREEN-INPUT = 0.

ENDIF.

IF P_C2 = 'X'.

P_C1 = 'X'.

P_C3 = 'X'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

If helpful reward some points,

with regards,

suresh.

Read only

Former Member
0 Likes
796

hi narendra,

for me the first should be grey

n the 3rd should be checked automatically n ungrey

when the 2nd checkbox is selected.

can u help me out in this plz

Read only

Former Member
0 Likes
796

hi,

REPORT ZSR_SDN_DEMO.

PARAMETERS: p_c1 AS CHECKBOX user-command USR1 DEFAULT 'X',

p_c2 AS CHECKBOX user-command USR2,

p_c3 AS checkbox user-command USR3 DEFAULT 'X'.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

  • If the second check box is checked..disable the first one.

IF P_C2 = ' ' AND SCREEN-NAME = 'P_C1'.

SCREEN-INPUT = 0.

ENDIF.

IF P_C2 = 'X'.

P_C1 = 'X'.

P_C3 = 'X'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.