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

regarding selection screen

Former Member
0 Likes
565

hi,

i have 2 check boxes on selection screen

if the user checks both the check boxes

then i have to throw an error message that only one check box should be selected

iam getting error with the below code

aT SELECTION-SCREEN.

IF ( ( p_check1 = 'X' ) and

( p_check2= 'X' )).

WRITE:/ 'Please choose only one option''(e04) COLOR COL_NEGATIVE INVERSE.

ENDIF.

endif.

1 ACCEPTED SOLUTION
Read only

venkat_o
Active Contributor
0 Likes
533

<li>Error because of WRITE statement. WRITE statements must not be written at AT SELECTION-SCREEN event. <li>Instead you can write like below.

AT SELECTION-SCREEN.
  IF p_check1 = 'X' AND
     p_check2 = 'X'.
    MESSAGE 'Please choose only one option' TYPE 'E'.
  ENDIF.
Thanks Venkat.O

3 REPLIES 3
Read only

venkat_o
Active Contributor
0 Likes
534

<li>Error because of WRITE statement. WRITE statements must not be written at AT SELECTION-SCREEN event. <li>Instead you can write like below.

AT SELECTION-SCREEN.
  IF p_check1 = 'X' AND
     p_check2 = 'X'.
    MESSAGE 'Please choose only one option' TYPE 'E'.
  ENDIF.
Thanks Venkat.O

Read only

Former Member
0 Likes
533

if your requirement is such why dont you use radio buttons instead checkbox. No extra code needed.

Read only

Former Member
0 Likes
533

if your requirement is such why dont you use radio buttons instead checkbox. No extra code needed.