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

Mandatory parameters

Former Member
0 Likes
715

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
662

Hi,

At SELECTIOn-SCREEN.

IF the Check_box is initial.

Raise the Error message.

Endif.

5 REPLIES 5
Read only

Former Member
0 Likes
663

Hi,

At SELECTIOn-SCREEN.

IF the Check_box is initial.

Raise the Error message.

Endif.

Read only

0 Likes
662

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.

Read only

0 Likes
662

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

Read only

Former Member
0 Likes
662

Hi,

AT SELECTION-SCREEN.

if SB_KKS is initial.

Raise Error Message.

endif.

Reward points if it is helpful.

Regards,

Sangeetha.a

Read only

Former Member
0 Likes
662

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