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

doubt in selection screen modification

Former Member
0 Likes
1,060

Hi all,

I have a Checkbox (select all) in my selection screen and 23 other check boxes.

When i click the 'select all' checkbox, all the 23 checkboxes should be selected automatically in the selection screen and the lf i remove the tick mark in the checkbox, all the 23 check boxes should be cleared automatically and it should allow the user to select any of the checkboxes on his own..

I'm able to select all, when it is ticked. But my pbm is when the 'select all' tick mark is removed, i'm clearing all the 23 checkboxes. so after this, if the user a select any check box on his own, it is not taken. Bcoz, i'm clearing all the value in 'at selection screen' event.

Could any one help to achieve this ...

Regards,

Shanthi

1 ACCEPTED SOLUTION
Read only

venkat_o
Active Contributor
0 Likes
1,037

Hi Shanti, Here is the modified code of the fellow SDN. Just check. It works as u requested.



REPORT zvenkat_notepad.

SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME.
PARAMETERS:p_all AS CHECKBOX USER-COMMAND rusr.
SELECTION-SCREEN : END OF BLOCK blk1.

SELECTION-SCREEN : BEGIN OF BLOCK blk2 WITH FRAME.
PARAMETERS: p_chk1  AS CHECKBOX,
            p_chk2  AS CHECKBOX,
            p_chk3  AS CHECKBOX,
            p_chk4  AS CHECKBOX,
            p_chk5  AS CHECKBOX,
            p_chk6  AS CHECKBOX,
            p_chk7  AS CHECKBOX,
            p_chk8  AS CHECKBOX,
            p_chk9  AS CHECKBOX,
            p_chk10 AS CHECKBOX,
            p_chk11 AS CHECKBOX,
            p_chk12 AS CHECKBOX,
            p_chk13 AS CHECKBOX,
            p_chk14 AS CHECKBOX,
            p_chk15 AS CHECKBOX,
            p_chk16 AS CHECKBOX,
            p_chk17 AS CHECKBOX,
            p_chk18 AS CHECKBOX,
            p_chk19 AS CHECKBOX,
            p_chk20 AS CHECKBOX,
            p_chk21 AS CHECKBOX,
            p_chk22 AS CHECKBOX,
            p_chk23 AS CHECKBOX.
SELECTION-SCREEN : END OF BLOCK blk2.

AT SELECTION-SCREEN." OUTPUT.
  IF p_all = 'X'.
    p_chk1 = 'X'.
    p_chk2 = 'X'.
    p_chk3 = 'X'.
    p_chk4 = 'X'.
    p_chk5 = 'X'.
    p_chk6 = 'X'.
    p_chk7 = 'X'.
    p_chk8 = 'X'.
    p_chk9 = 'X'.
    p_chk10 = 'X'.
    p_chk11 = 'X'.
    p_chk12 = 'X'.
    p_chk13 = 'X'.
    p_chk14 = 'X'.
    p_chk15 = 'X'.
    p_chk16 = 'X'.
    p_chk17 = 'X'.
    p_chk18 = 'X'.
    p_chk19 = 'X'.
    p_chk20 = 'X'.
    p_chk21 = 'X'.
    p_chk22 = 'X'.
    p_chk23 = 'X'.
  ENDIF.
  IF sy-ucomm = 'RUSR' AND p_all = space.
    CLEAR:
          p_chk1,
          p_chk2,
          p_chk3,
          p_chk4,
          p_chk5,
          p_chk6,
          p_chk7,
          p_chk8,
          p_chk9,
          p_chk10,
          p_chk11,
          p_chk12,
          p_chk13,
          p_chk14,
          p_chk15,
          p_chk16,
          p_chk17,
          p_chk18,
          p_chk19,
          p_chk20,
          p_chk21,
          p_chk22,
          p_chk23.
  ENDIF.

Regards, Venkat.O

8 REPLIES 8
Read only

Former Member
0 Likes
1,037

Hi,

Use the below code.

selection-screen : begin of block blk1 with frame.

PARAMETERS:p_all as CHECKBOX USER-COMMAND rusr.

selection-screen : end of block blk1.

selection-screen : begin of block blk2 with frame.

PARAMETERS:p_chk1 as CHECKBOX,

p_chk2 as CHECKBOX,

p_chk3 as CHECKBOX,

p_chk4 as CHECKBOX,

p_chk5 as CHECKBOX,

p_chk6 as CHECKBOX,

p_chk7 as CHECKBOX,

p_chk8 as CHECKBOX,

p_chk9 as CHECKBOX,

p_chk10 as CHECKBOX,

p_chk11 as CHECKBOX,

p_chk12 as CHECKBOX,

p_chk13 as CHECKBOX,

p_chk14 as CHECKBOX,

p_chk15 as CHECKBOX,

p_chk16 as CHECKBOX,

p_chk17 as CHECKBOX,

p_chk18 as CHECKBOX,

p_chk19 as CHECKBOX,

p_chk20 as CHECKBOX,

p_chk21 as CHECKBOX,

p_chk22 as CHECKBOX,

p_chk23 as CHECKBOX.

selection-screen : end of block blk2.

AT SELECTION-SCREEN OUTPUT.

IF p_all = 'X'.

p_chk1 = 'X'. p_chk2 = 'X'. p_chk3 = 'X'.

p_chk4 = 'X'. p_chk5 = 'X'. p_chk6 = 'X'.

p_chk7 = 'X'. p_chk8 = 'X'. p_chk9 = 'X'.

p_chk10 = 'X'. p_chk11 = 'X'. p_chk12 = 'X'.

p_chk13 = 'X'. p_chk14 = 'X'. p_chk15 = 'X'.

p_chk16 = 'X'. p_chk17 = 'X'. p_chk18 = 'X'.

p_chk19 = 'X'. p_chk20 = 'X'. p_chk21 = 'X'.

p_chk22 = 'X'. p_chk23 = 'X'.

else.

clear: p_chk1, p_chk2, p_chk3, p_chk4, p_chk5,

p_chk6, p_chk7, p_chk8, p_chk9, p_chk10,

p_chk11, p_chk12, p_chk13, p_chk14, p_chk15,

p_chk16, p_chk17, p_chk18, p_chk19, p_chk20,

p_chk21, p_chk22, p_chk23.

endif.

Read only

0 Likes
1,037

Hi,

But my pbm is when the 'select all' tick mark is removed, i'm clearing all the 23 checkboxes. so after this, if the user a select any check box on his own, it is not taken. Bcoz, i'm clearing all the value in 'at selection screen' event.

After clearing, the user should be able to select the check box on his own.

How to do this?

Read only

0 Likes
1,037

Hi,

You have to use permutaion and combination conditions, means you have to check total 24 conditions.

Example:

if p_all = 'X' and not ( p_1 = 'X' and p_2 = 'X'...........and p_24 = 'X').

move 'X' to p_1,p_2.........p_24.

elseif not p_all = 'X' and p_1 = 'X'.

clear : p_2,p_3..........p_24.

elseif not p_all = 'X' and p_2 = 'X'.

clear: p_1,p_3...

.

.

.

elseif not p_all = 'X' and p_24 = 'X'.

clear : p_1,p_2.....p_23.

else.

clear: p_1,p_2........p_4.

endif.

Thanks

Rayudu

Read only

0 Likes
1,037

Hi,

Instead of at selection-screen event you use at selection-screen output.it does allow you to select check boxes after clearing them.

Read only

Former Member
0 Likes
1,037

Hi,

Try like this:

parameters: p_all as checkbox,

p_chk1 as checkbox,

p_chk2 as checkbox,

p_chk3 as checkbox.

at selection-screen output.

if p_all = 'X'.

p_chk1 = 'X'.

p_chk2 = 'X'.

p_chk3 = 'X'.

endif.

if p_all = ''.

p_chk1 = ''.

p_chk2 = ''.

p_chk3 = ''.

endif.

Regards,

Bhaskar

Read only

Former Member
0 Likes
1,037

Hi,

You just ignore my reply.coz its totaly wrong.

Just send me ur code, I will modify and send you.

Thanks

Rayudu

Read only

venkat_o
Active Contributor
0 Likes
1,038

Hi Shanti, Here is the modified code of the fellow SDN. Just check. It works as u requested.



REPORT zvenkat_notepad.

SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME.
PARAMETERS:p_all AS CHECKBOX USER-COMMAND rusr.
SELECTION-SCREEN : END OF BLOCK blk1.

SELECTION-SCREEN : BEGIN OF BLOCK blk2 WITH FRAME.
PARAMETERS: p_chk1  AS CHECKBOX,
            p_chk2  AS CHECKBOX,
            p_chk3  AS CHECKBOX,
            p_chk4  AS CHECKBOX,
            p_chk5  AS CHECKBOX,
            p_chk6  AS CHECKBOX,
            p_chk7  AS CHECKBOX,
            p_chk8  AS CHECKBOX,
            p_chk9  AS CHECKBOX,
            p_chk10 AS CHECKBOX,
            p_chk11 AS CHECKBOX,
            p_chk12 AS CHECKBOX,
            p_chk13 AS CHECKBOX,
            p_chk14 AS CHECKBOX,
            p_chk15 AS CHECKBOX,
            p_chk16 AS CHECKBOX,
            p_chk17 AS CHECKBOX,
            p_chk18 AS CHECKBOX,
            p_chk19 AS CHECKBOX,
            p_chk20 AS CHECKBOX,
            p_chk21 AS CHECKBOX,
            p_chk22 AS CHECKBOX,
            p_chk23 AS CHECKBOX.
SELECTION-SCREEN : END OF BLOCK blk2.

AT SELECTION-SCREEN." OUTPUT.
  IF p_all = 'X'.
    p_chk1 = 'X'.
    p_chk2 = 'X'.
    p_chk3 = 'X'.
    p_chk4 = 'X'.
    p_chk5 = 'X'.
    p_chk6 = 'X'.
    p_chk7 = 'X'.
    p_chk8 = 'X'.
    p_chk9 = 'X'.
    p_chk10 = 'X'.
    p_chk11 = 'X'.
    p_chk12 = 'X'.
    p_chk13 = 'X'.
    p_chk14 = 'X'.
    p_chk15 = 'X'.
    p_chk16 = 'X'.
    p_chk17 = 'X'.
    p_chk18 = 'X'.
    p_chk19 = 'X'.
    p_chk20 = 'X'.
    p_chk21 = 'X'.
    p_chk22 = 'X'.
    p_chk23 = 'X'.
  ENDIF.
  IF sy-ucomm = 'RUSR' AND p_all = space.
    CLEAR:
          p_chk1,
          p_chk2,
          p_chk3,
          p_chk4,
          p_chk5,
          p_chk6,
          p_chk7,
          p_chk8,
          p_chk9,
          p_chk10,
          p_chk11,
          p_chk12,
          p_chk13,
          p_chk14,
          p_chk15,
          p_chk16,
          p_chk17,
          p_chk18,
          p_chk19,
          p_chk20,
          p_chk21,
          p_chk22,
          p_chk23.
  ENDIF.

Regards, Venkat.O

Read only

Former Member
0 Likes
1,037

Thanks a lot venkat.

Its working according to my requirement..