‎2012 Jul 30 11:26 AM
i have to display 2 checkbox....at a given time 1 check box must be selected....or a message display to select a checkbox...
message should display before output( on selection screen)...
‎2012 Jul 30 11:35 AM
Hi,
code like this,
AT SELECTION-SCREEN OUTPUT.
IF p_check1 is INITIAL AND p_check2 IS INITIAL.
MESSAGE 'Either Checkbox 1 or Checkbox2 should be selected' TYPE 'S'.
ENDIF.
‎2012 Jul 30 11:42 AM
Message is showing after returning from list screen....i want to show the message before output...then user select a check box... then execute the code(F8)
‎2012 Jul 30 11:53 AM
Replace
AT SELECTION-SCREEN OUTPUT.
with
AT SELECTION-SCREEN.
...........
message 'xxxxx' type 'E'.
.............
‎2012 Jul 30 12:01 PM
by using AT SELECTION-SCREEN.... message is showing in list screen...not on the selection screen
‎2012 Jul 30 12:06 PM
‎2012 Jul 30 12:09 PM
sorry....i not saw you changed message type S to E....now the issuse is fix
thanks!!!
‎2012 Jul 30 12:12 PM
code like this,
AT SELECTION-SCREEN.
IF p_check1 is INITIAL AND p_check2 IS INITIAL.
MESSAGE 'Either Checkbox 1 or Checkbox2 should be selected' TYPE 'E'.
ENDIF.
‎2012 Jul 30 11:38 AM
By selected you mean checked so internally in ABAP it contains 'X', I presume.
Not very clear what you need.
You could display it with default 'X' unless it depends on value of another field on the screen...
(never mind - Sharath has it right!)
‎2012 Jul 30 11:44 AM
Hi,
If your requirement is to have only one option selected at a given point of time, then u should go for RADIO BUTTON else if multiple options to be selected, then CHECK BOX.
I will give you a brief overview of the syntax of CHECK BOX
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
PARAMETER: CB_DISPLAY AS CHECKBOX,
CB_DOWNLOAD AS CHECKBOX.
SELECT-SCREEN END OF BLOCK B1.
IF CB_DISPLAY = 'X'.
<CODE TO DISPLAY THE DATA FROM ON TO THE SCREEN'
ELSEIF CB_DOWNLOAD = 'X'.
CALL FUNCTION 'GUI_DOWNLOAD'.
‎2012 Jul 30 12:05 PM
i know what is radio button & check box....my requirement is..
>there should 2 check box....user can select both or AT least one
>if user doesnt select any check box...a message should display to select at leaste one
>message should show when user click execute(F8) without any checkbox selected...
‎2012 Jul 30 12:09 PM
AT SELECTION-SCREEN.
IF p_cb1 is INITIAL and p_cb2 IS INITIAL.
IF sy-ucomm = 'ONLI'. " When user presses F8
* Give your error message
ENDIF.
ENDIF.