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: 

How to make Select Options Mandatory?

Former Member
0 Kudos

Hi Guys,

Can anybnody tell me how to Declare Selection Options for some of them mandatory.

Select-Options : v_PurOrg for EKKO-EKORG default '2000',

v_GRDate for Sy-Datum ,

v_GRPrd for MSEG-GJAHR.

In these i have to make v_PurOrg Manadatory.

Thanks,

Gopi.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Put "obligatory" at the end, before the comma.

If that doesn't work, then you can do the following in the code:

If <tablename-fieldname> = space.

<code to display message>.

end list-processing.

endif.

6 REPLIES 6

Former Member
0 Kudos

Put "obligatory" at the end, before the comma.

If that doesn't work, then you can do the following in the code:

If <tablename-fieldname> = space.

<code to display message>.

end list-processing.

endif.

Former Member
0 Kudos

Hi,

use OBLIGATORY.

Ex:

select-options : s_lifnr for lfa1-lifnr obligatory.

Former Member
0 Kudos

Select-Options : v_PurOrg for EKKO-EKORG default '2000' <b>obligatory</b>,

v_GRDate for Sy-Datum ,

v_GRPrd for MSEG-GJAHR.

Former Member
0 Kudos

Hi Gopi,

To make select-options/parameters mandatory use OBLIGATORY.

Ex:

In case of select-options:

Select-Options : v_PurOrg for EKKO-EKORG default '2000' OBLIGATORY.

In case of parameters:

parameters: p_PurOrg LIKE EKKO-EKORG OBLIGATORY.

Regards,

KK

Former Member
0 Kudos

Hi Gopi,

In order to make select-options mandatory we add OBLIGATORY in the statement like the below.

Selection-Screen.

Select-Options : v_PurOrg for EKKO-EKORG default '2000' OBLIGATORY.

In this case, only the first option will have the default value of 2000.But if you want both the options low and high of select-options, means you have to add the below code in your program in the initialization event.

Initialization.

v_PurOrg-low = 1000.

v_PurOrg-high = 2000.

append v_PurOrg.

Hope this helps.

Please reward if useful.

Thanks,

Srinivasa

0 Kudos

Thanks