Skip to Content
author's profile photo Former Member
Former Member

Restricting user to exclude values in selection screen

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 17, 2005 at 12:05 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Feb 18, 2005 at 04:09 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 18, 2005 at 06:35 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.