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: 

Selection screen parameter.

Former Member
0 Kudos

Hi Gurus,

How to declare selection screen parameter based on customer number : KNA1-KUNNR

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hI

If you want to have the functionality of a select-option but doesn't want the user to enter ranges, then what you can do is to use the SELECT-OPTIONS with NO-INTERVALS. Then use the function module RSRESTRICTSEL*,so that now the user will be able to enter multiple single values but cannot enter ranges.

A compromise could be that you provide the user with only LOW option to fill in and remove the ranges and exclude conditions. That way user will be forced to enter single values and you can validate each of them by looping at the select option.

I think your customer will understand the reason. Let the customer know that it is possible to say either you found values or didn't find values, but not the way they want it. Explain it to them with several examples to showcase how many variations there can be and how difficult it will be to validate each of those variations. Tell them SELECT-OPTIONS gives them the flexibility of entering ranges, excluding ranges, single values etc. Such a powerful flexibility comes with a small price of not being able to validate each and every value.

If they still insist, then you have to restrict their ability to enter 'EXCLUSIONS', and may be even ranges. Look at the function module 'SELECT_OPTIONS_RESTRICT'. There is very good documentation associated with it.

Here is an example using this function module where I restrict the users to just multiple single values for a select option called S_EXWRK which is for plant.

TYPE-POOLS sscr.

DATA: ls_restrict TYPE sscr_restrict,

ls_opt_list TYPE sscr_opt_list,

ls_ass TYPE sscr_ass.

CLEAR ls_opt_list.

MOVE 'EQ' TO ls_opt_list-name.

ls_opt_list-options-eq = 'X'.

APPEND ls_opt_list TO ls_restrict-opt_list_tab.

ls_ass-kind = 'S'.

ls_ass-name = 'S_EXWRK'.

ls_ass-sg_main = 'I'.

ls_ass-sg_addy = ' '.

ls_ass-op_main = 'EQ'.

ls_ass-op_addy = 'EQ'.

APPEND ls_ass TO ls_restrict-ass_tab.

CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'

EXPORTING

restriction = ls_restrict

EXCEPTIONS

OTHERS = 1.

2 REPLIES 2

Former Member

Former Member
0 Kudos

hI

If you want to have the functionality of a select-option but doesn't want the user to enter ranges, then what you can do is to use the SELECT-OPTIONS with NO-INTERVALS. Then use the function module RSRESTRICTSEL*,so that now the user will be able to enter multiple single values but cannot enter ranges.

A compromise could be that you provide the user with only LOW option to fill in and remove the ranges and exclude conditions. That way user will be forced to enter single values and you can validate each of them by looping at the select option.

I think your customer will understand the reason. Let the customer know that it is possible to say either you found values or didn't find values, but not the way they want it. Explain it to them with several examples to showcase how many variations there can be and how difficult it will be to validate each of those variations. Tell them SELECT-OPTIONS gives them the flexibility of entering ranges, excluding ranges, single values etc. Such a powerful flexibility comes with a small price of not being able to validate each and every value.

If they still insist, then you have to restrict their ability to enter 'EXCLUSIONS', and may be even ranges. Look at the function module 'SELECT_OPTIONS_RESTRICT'. There is very good documentation associated with it.

Here is an example using this function module where I restrict the users to just multiple single values for a select option called S_EXWRK which is for plant.

TYPE-POOLS sscr.

DATA: ls_restrict TYPE sscr_restrict,

ls_opt_list TYPE sscr_opt_list,

ls_ass TYPE sscr_ass.

CLEAR ls_opt_list.

MOVE 'EQ' TO ls_opt_list-name.

ls_opt_list-options-eq = 'X'.

APPEND ls_opt_list TO ls_restrict-opt_list_tab.

ls_ass-kind = 'S'.

ls_ass-name = 'S_EXWRK'.

ls_ass-sg_main = 'I'.

ls_ass-sg_addy = ' '.

ls_ass-op_main = 'EQ'.

ls_ass-op_addy = 'EQ'.

APPEND ls_ass TO ls_restrict-ass_tab.

CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'

EXPORTING

restriction = ls_restrict

EXCEPTIONS

OTHERS = 1.