‎2007 Jun 05 8:44 AM
Hy!
I have to checkboxes. I must choose<b> one</b> . This must be <b>mandatory</b>.
Fot that I have another two parameters. Those are optional.
They must be in the same screen , in the same line, so I made :
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (3) text-p05 FOR FIELD sb_kks.
PARAMETERS: sb_kks AS CHECKBOX.
SELECTION-SCREEN POSITION 45.
SELECTION-SCREEN COMMENT (13) text-p04 FOR FIELD p_emkey.
PARAMETERS: p_emkey TYPE /bic/azg1e_kks00-/bic/zg1emkey.
SELECTION-SCREEN END OF LINE.
Q1: How can I choose between the tho ckeckboxes , if the first is also in a selection screen as the second, because it has a parameter that must be in the same line as it?
Q1: How can I make the checkbox mandatory ?
Thank you.
‎2007 Jun 05 8:46 AM
Hi,
At SELECTIOn-SCREEN.
IF the Check_box is initial.
Raise the Error message.
Endif.
‎2007 Jun 05 8:46 AM
Hi,
At SELECTIOn-SCREEN.
IF the Check_box is initial.
Raise the Error message.
Endif.
‎2007 Jun 05 8:54 AM
I tried this :
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 45.
SELECTION-SCREEN COMMENT (3) text-p05 FOR FIELD sb_kks.
PARAMETERS: sb_kks AS CHECKBOX.
SELECTION-SCREEN END OF LINE.
AT SELECTION-SCREEN.
IF sb_kks IS INITIAL.
MESSAGE 'Give a value !' type 'I'.
ELSE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 80.
SELECTION-SCREEN COMMENT (13) text-p04 FOR FIELD p_emkey.
PARAMETERS: p_emkey TYPE /bic/azg1e_kks00-/bic/zg1emkey.
SELECTION-SCREEN END OF LINE.
ENDIF.
But I get an error message that in form routines and function modules the selection -screen is not accepted :(.
Suggestions?
Thank you.
‎2007 Jun 05 8:58 AM
The AT SELECTION-SCREEN is a report event and cannot be clubbed with the screen declarations.
You will have to do this:
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 45.
SELECTION-SCREEN COMMENT (3) text-p05 FOR FIELD sb_kks.
PARAMETERS: sb_kks AS CHECKBOX.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 80.
SELECTION-SCREEN COMMENT (13) text-p04 FOR FIELD p_emkey.
PARAMETERS: p_emkey TYPE /bic/azg1e_kks00-/bic/zg1emkey.
SELECTION-SCREEN END OF LINE.
AT SELECTION-SCREEN.
IF sb_kks IS INITIAL.
MESSAGE 'Give a value !' type 'I'.
ENDIF.
It is also not possible to code the selection screen parameters in an IF-ENDIF condition. What you can do give an error message if the checkbox is ticked and the parameter is blank.
Sudha
‎2007 Jun 05 8:51 AM
Hi,
AT SELECTION-SCREEN.
if SB_KKS is initial.
Raise Error Message.
endif.
Reward points if it is helpful.
Regards,
Sangeetha.a
‎2007 Jun 05 8:54 AM
HI Anda,
I am not quiet clear about Question1 , if would be great if you could provide some more details.
For the second question , check box and the obligatory key words cannot be used together , so you need to check whether the check box is checked in the event
at selection-screen.
e.g. if p_chk1 is the checkbox which is obligatory , then the code will look some thing like this
at selection-screen.
IF P_CHK1 is initial.
*" Give error message
endif.Hope this helps.
Regards
Arun