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: 

Excluding the EXCLUDE SINGLE VALUES and EXCLUDE RANGES

Former Member
0 Kudos

Hello freinds,

I have a need where in the *select-options * , i must take care that no values is being enteres in the EXCLUDE SINGLE VALUES and EXCLUDE RANGES . There must only be include ranges and include values Hope you could understand me .If there is any ambiguity in the question please let me know it .

Comradely ,

K.Sibi

Edited by: sibi k kanagaraj on Jun 29, 2009 4:45 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi K.Sibi,

please check the documentation on the FM SELECT_OPTIONS_RESTRICT.

You need to build in a call of that FM into your Selection Screen, than you can adjust what is allowed in a SO.

Best regards,

Sebastian

4 REPLIES 4

ThomasZloch
Active Contributor
0 Kudos

You can check the contents of the selection ranges after user input, not allowing any <name of range>-SIGN = 'E'.

Thomas

Former Member
0 Kudos

Hi,

I don't think so that you can suppress the Exclude List or Ranges from the Select-option's Display.

What you can do is that you can write the code inside the "at-selection screen on field" , on the field with Select-options, and check whether a Exclude list or range is entered by the user or not, in case it is entered, throw an error message saying that exclude values are not allowed.

Former Member
0 Kudos

Hi K.Sibi,

please check the documentation on the FM SELECT_OPTIONS_RESTRICT.

You need to build in a call of that FM into your Selection Screen, than you can adjust what is allowed in a SO.

Best regards,

Sebastian

Former Member
0 Kudos

Hello friends,

Using the FM suggested by Sebastian Schoenhoefer , I got my problem solved.

I would like to share it so that others could benefit out of it.


type-pools: SSCR.

data: rest type SSCR_RESTRICT.
DATA: ASS TYPE SSCR_ASS.


select-options s_date for sy-datum.

INITIALIZATION.

  ASS-KIND = 'S'.
  ASS-NAME = 'S_DATE'.
  ASS-SG_MAIN = 'I'.


  APPEND ASS TO REST-ASS_TAB.

  CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
    EXPORTING
     PROGRAM                      = SY-REPID
      RESTRICTION                 = REST
*   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
            .
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

As a matter of interest you could try it in at selection-screen output also .

Please go through the documentation as it is very useful.

Comradely,

K.Sibi

Edited by: sibi k kanagaraj on Jun 30, 2009 12:34 PM