cancel
Showing results for 
Search instead for 
Did you mean: 

Restricting user to exclude values in selection screen

Former Member
0 Kudos

Hi Everybody,

I am facing a problem with f.m SELECT_OPTIONS_RESTRICT.

I want to restrict user, so that he will only be able to exclude values (single, multiple or range) from a selection-option.

The code snippet is as follows:

  • item messages -> restrict selection

opt_list-name = 'EXCLUDE'.

opt_list-options-ne = 'X'.

opt_list-options-nb = 'X'.

APPEND opt_list TO restrict-opt_list_tab.

ass-kind = 'B'.

ass-name = 'A2'.

ass-sg_main = 'I'.

ass-sg_addy = ' '.

  • ass-op_main = 'EXCLUDE'.

ass-op_addy = 'EXCLUDE'.

APPEND ass TO restrict-ass_tab.

CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'

EXPORTING

  • PROGRAM =

restriction = restrict

  • DB = ' '

EXCEPTIONS

TOO_LATE = 1

REPEATED = 2

SELOPT_WITHOUT_OPTIONS = 3

SELOPT_WITHOUT_SIGNS = 4

INVALID_SIGN = 5

EMPTY_OPTION_LIST = 6

INVALID_KIND = 7

REPEATED_KIND_A = 8

OTHERS = 9

.

But this is only including the single multiple and range value. Can anyone throw some light on it?

Thanks

Samit

Accepted Solutions (0)

Answers (3)

Answers (3)

andreas_mann3
Active Contributor
0 Kudos

Hi Charles and Samit,

so it's missing functionality ?

and it's not possible to say:

ass-sg_main = 'E'. "-> short dump INVALID_SIGN

regards Andreas

Former Member
0 Kudos

I took a look at the documentation of this FM to confirm what I was thinking:

"You can also disable the function allowing users to enter values to be excluded from the selection (SIGN = 'E')."

So I think this is trying to tell us that we can turn off the ability for the user to enter "exclude" but we cannot turn off the option for the user to enter "include" options.

When you set ass-sg_main = 'I', it means that only "include" options are allowed.

I think you will need to do your own validation.

In the event AT SELECTION SCREEN you can do a LOOP on your selection option name and validate the users selections:

LOOP AT SO_MINE.
  IF SO_MINE-SIGN NE 'E'.
    SET CURSOR FIELD 'SO_MINE-LOW'.
    MESSAGE E123.
  ENDIF.
ENDLOOP.

It has been awhile since I used this FM so please let us know how it goes.

Former Member
0 Kudos

Hello Samit,

It seems to me that you are trying to restrict the options for only one select-options. Then why did you specify ass-kind = 'B' ? You should try it out with ass-kind = 'S' and accordingly set the other options.

Please read the documentation for this FM carefully. There are also illustrative examples in there.

Regards,

Anand Mandalika.

Former Member
0 Kudos

Hello Anand,

Thanks for your suggestion. I am trying to make the same restriction on two select options within a specific block. The block name is A2. This has been followed in the documentation of the function module.

Samit