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: 

check boxes in selection screen

Former Member
0 Kudos
1,948

dear all,

i want to use check boxes in selection screen.

i want to check at a time 4 or five check boxes.

plz provide me some example.

with regards,

prasadbabu.

8 REPLIES 8

naveen_inuganti2
Active Contributor
0 Kudos
488

HI Check this sample code:

parameters: check1 as checkbox,
            check2 as checkbox,
            check3 as checkbox,
            check4 as checkbox,
            check5 as checkbox.

if ( check1 = 'X' and check2 = 'X' and check3 = 'X' and check4 = 'X' and check5 = 'X' ).
  write:/ 'All the check box are checked'.
else.
  write:/ 'One or more check boxs are not checked'.
endif.

Thanks,

Naveen.I

Former Member
0 Kudos
488

Hi,

You can put check boxes in Selection screen using:

Parameters:

p1 as checkbox,

p2 as checkbox,

p3 as checkbox.

In module pool screen, just place the checkbox elements

Thanks & Regards,

Navneeth K.

satsrockford
Active Participant
0 Kudos
488

hi

see this sample code:

report zrich_0001

no standard page heading.

parameters: p_chk1 as checkbox,

p_chk2 as checkbox,

p_chk3 as checkbox.

at selection-screen.

if p_chk1 is initial

and p_chk2 is initial

and p_chk3 is initial.

message e001(00) with 'Select as least one'.

endif.

regards

Satish

Former Member
0 Kudos
488

Hi ,

regarding checkboxes in selection screen ,

normally we declare checkboxes as

pgm 1 :

PARAMETERS: r1 AS CHECKBOX DEFAULT 'X' USER-COMMAND v,

r2 AS CHECKBOX USER-COMMAND w,

r3 AS CHECKBOX USER-COMMAND x,

r4 AS CHECKBOX USER-COMMAND y,

r5 AS CHECKBOX USER-COMMAND z.

this is for checking only 1 check box , try these 2 programs , you will find the difference .

pgm 2 :

PARAMETERS: r1 AS CHECKBOX DEFAULT 'X' USER-COMMAND v,

r2 AS CHECKBOX USER-COMMAND w,

r3 AS CHECKBOX USER-COMMAND x,

r4 AS CHECKBOX USER-COMMAND y,

r5 AS CHECKBOX USER-COMMAND z.

DATA: f_checkbox(2) VALUE 'X',

anzahl TYPE i,

r1m,

r2m,

r3m,

r4m,

r5m,

rns.

AT SELECTION-SCREEN OUTPUT.

IF r1 = 'X' AND NOT r1m = 'X'.

CLEAR: r2, r3, r4, r5.

ENDIF.

IF r2 = 'X' AND NOT r2m = 'X'.

CLEAR: r1, r3, r4, r5.

ENDIF.

IF r3 = 'X' AND NOT r3m = 'X'.

CLEAR: r1, r2, r4, r5.

ENDIF.

IF r4 = 'X' AND NOT r4m = 'X'.

CLEAR: r1, r2, r3, r5.

ENDIF.

IF r5 = 'X' AND NOT r5m = 'X'.

CLEAR: r1, r2, r3, r4.

ENDIF.

IF r1 IS INITIAL AND r2 IS INITIAL AND r3 IS INITIAL AND

r4 IS INITIAL AND r5 IS INITIAL.

r1 = 'X'.

ENDIF.

r1m = r1. r2m = r2. r3m = r3. r4m = r4. r5m = r5.

Regards.

Abhi.

Former Member
0 Kudos
488

hello,

i want to declare this check boxes side by side in selection screen.

with regards,

prasadbabu.

0 Kudos
488

>

> hello,

>

> i want to declare this check boxes side by side in selection screen.

>

> with regards,

> prasadbabu.

Look up the help on SELECTION-SCREEN BEGIN OF LINE, SELECTION-SCREEN POSITION, SELECTION-SCREEN COMMENT (in fact reading all of the help on selection screens would be helpful).

Mohamed_Mukhtar
Active Contributor
0 Kudos
488

Hi Prasad,

SELECTION-SCREEN begin of line.
  SELECTION-SCREEN COMMENT 1(15) text-c1.
  parameters: check1 as checkbox.
  SELECTION-SCREEN COMMENT 25(15) text-c2.
  PARAMETERS: check2 as checkbox.
 SELECTION-SCREEN COMMENT 50(15) text-c3.
  PARAMETERS: check3 as checkbox.
 SELECTION-SCREEN COMMENT 70(15) text-c4.
  PARAMETERS: check4 as checkbox.
SELECTION-SCREEN end of LINE.

Thanks & Regards

Former Member
0 Kudos
488

Hi Prasadbabu,

SELECTION-SCREEN  :
   PUSHBUTTON 10(10) button1 USER-COMMAND SEL . 
PARAMETERS :
 c1 AS CHECKBOX USER-COMMAND c1 ,
 c2 AS CHECKBOX,
 c3 AS CHECKBOX.

DATA:
select_flag TYPE c VALUE 'N'.

AT SELECTION-SCREEN  .
  IF sy-ucomm EQ 'SEL'.
    select_flag = 'Y'.
  ENDIF.

AT SELECTION-SCREEN OUTPUT  .
  IF select_flag = 'Y'.

    LOOP AT SCREEN.
      IF screen-name = 'C1'.
        c1 = 'X'.
      ENDIF.
      IF screen-name = 'C2'.
        c2 = 'X'.
      ENDIF.
      IF screen-name = 'C3'.
        c3 = 'X'.
      ENDIF.

      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

To display buttons side by side you can use SELECTION-SCREEN BEGIN OF LINE......... END OF LINE..

You go through the help Provided by SAP you can get it easily.

Regards,

Rajitha.