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: 

Restrictions in select-options

Former Member
0 Kudos

Hi,

How to remove the diffrent tabs in the extention of a select-option? Foe example I want to remove 'exclude single values' and 'exclude range' from the extention of select-options.

Thanks in advance

Jaison Joseph

13 REPLIES 13

Former Member
0 Kudos

try

select-options s_matnr for mara-matnr no-extension no intervals

regards

shiba dutta

0 Kudos

select-options s_matnr for mara-matnr no-extension no intervals.

or

select-options s_matnr for mara-matnr no-extension .

or

select-options s_matnr for mara-matnr no intervals.

amit

Former Member
0 Kudos

Addition 10

... OBLIGATORY

Effect

The user must enter a value for this selection (in the LOW field).

Addition 11

... NO-EXTENSION

Effect

The user can only make an entry on one line. Calling the additional "Multiple Selection" screen is not supported and no pushbutton for this appears on the selection screen.

Addition 12

... NO INTERVALS

Effect

The selection option is displayed on the selection screen without a 'to' field. The pushbutton for calling the "Multiple Selection" screen appears immediately after the 'from' field.

This addition thus allows you to generate a simplified display on the selection screen. This is particularly useful if you are not making any range selections for this selection option.

Notes

On the "Multiple Selection" screen, you can also enter ranges for selection options with "NO INTERVALS".

By combining this addition with "NO-EXTENSION", you can restrict the user to entry of a single value for the selection option, but with the possibility of also choosing single value options like 'Greater than' or 'Less than or equal'.

By using the addition " NO INTERVALS" with SELECTION-SCREEN BEGIN OF BLOCK, you can activate the simplified display for all selection options in a block.

The function module SELECT_OPTIONS_RESTRICT allows you to restrict the set of selection options available for a SELECT-OPTION (for example, only single values and patterns, i.e. 'EQ' and 'CP' are allowed). You can also forbid the leading sign 'E' (= 'Exclude from selection'). This means that you can considerably restrict the selections which can be entered on the selection

former_member188829
Active Contributor
0 Kudos

select-options:s_matnr for mara-matnr no-extension no intervals.

Former Member
0 Kudos

Hi All,

I want to restrict the different tabs in the extension of select-option.

Former Member
0 Kudos

SELECT-OPTIONS : VENDOR FOR YTXLFA1-LIFNR.

INITIALIZATION.

VENDOR-LOW = 1000. " It specifies the range starting value.

VENDOR-HIGH = 2000. " It specifies the range ending value.

VENDOR-OPTION = 'BT'. " specifies ranges value is in between.

<b>VENDOR-SIGN = 'E'.</b> "specifies Exclusive.--->

Append Vendor.

Effect : it excludes this range ..

use this option.

regards,

vijay

Former Member
0 Kudos

Hi jaison,

1. Only

Single Values (Green color)

Ranges ( Green Color)

(No Red color single and range)

2. Its a little tricky, we have to use SELECT_OPTIONS_RESTRICT fm.

3. Just copy paste to get a taste of it.

(important code is in BOLD)

4.

REPORT abc NO STANDARD PAGE HEADING.

TYPE-POOLS : sscr.

*----


Data

TABLES : t001.

*----


IMPORTANT VARIABLES

DATA : res TYPE sscr_restrict.

DATA : opt_list TYPE sscr_opt_list.

DATA : ass TYPE sscr_ass.

*----


Sel Screen.

SELECT-OPTIONS : bukrs FOR t001-bukrs.

*----


INITIALIZATION.

<b>*----


IMPORTANT CODE

opt_list-name = 'A'.

opt_list-options-nb = 'X'.

opt_list-options-ne = 'X'.

APPEND opt_list TO res-opt_list_tab.

ass-kind = 'A'.

ass-name = 'BUKRS'.

ass-sg_main = 'I'..

APPEND ass TO res-ass_tab.</b>

CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'

EXPORTING

restriction = res

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

.

regards,

amit m.

0 Kudos

just check the SELECT_OPTIONS_RESTRICT FMs documentation, its got good example program.

Regards

Raja

Former Member
0 Kudos

Hi

Please check the following link which has many examples from our friends in the forum.

And one small example from me:

TABLES: VBAK.
TYPE-POOLS: SSCR.

************************************************************************
*               S E L E C T I O N    S C R E E N                       *
************************************************************************
SELECTION-SCREEN BEGIN OF BLOCK BLK3 WITH FRAME NO INTERVALS.
SELECTION-SCREEN BEGIN OF BLOCK BLK0 WITH FRAME TITLE TEXT-000 NO
INTERVALS.
  SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: P_ARC RADIOBUTTON GROUP RAD0 DEFAULT 'X'
                      USER-COMMAND ABC.
    SELECTION-SCREEN  COMMENT (20) TEXT-003 FOR FIELD P_ARC.
    SELECTION-SCREEN  POSITION 33.
    PARAMETERS: P_DIS RADIOBUTTON GROUP RAD0.
    SELECTION-SCREEN  COMMENT (20) TEXT-004 FOR FIELD P_DIS.
  SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK BLK0.

SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001 NO
INTERVALS.
  PARAMETERS: P_VKORG LIKE VBAK-VKORG OBLIGATORY.
  SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN OBLIGATORY NO INTERVALS.
SELECTION-SCREEN END OF BLOCK BLK1.

SELECTION-SCREEN BEGIN OF BLOCK BLK2 WITH FRAME TITLE TEXT-002 NO
INTERVALS.
  PARAMETERS: P_SO   RADIOBUTTON GROUP RAD1 DEFAULT 'X' MODIF ID ABC,
              P_PO   RADIOBUTTON GROUP RAD1 MODIF ID ABC,
              P_SOPO RADIOBUTTON GROUP RAD1 MODIF ID ABC.
SELECTION-SCREEN END OF BLOCK BLK2.
SELECTION-SCREEN END OF BLOCK BLK3.


************************************************************************
*         A T     S E L E C T I O N - S C R E E N     OUTPUT           *
************************************************************************
AT SELECTION-SCREEN OUTPUT.
   LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'ABC' OR SCREEN-NAME = '%B002014_BLOCK_1000'.
         CASE 'X'.
         WHEN P_ARC.
           SCREEN-ACTIVE = 1.
         WHEN P_DIS.
           SCREEN-ACTIVE = 0.
         ENDCASE.
         MODIFY SCREEN.
      ENDIF.
   ENDLOOP.

************************************************************************
*                   I N I T I A L I Z A T I O N                        *
************************************************************************
INITIALIZATION.

DATA: RES TYPE SSCR_RESTRICT.
DATA OPT_LIST TYPE SSCR_OPT_LIST.
DATA ASS      TYPE SSCR_ASS.

MOVE: 'OPT1' TO OPT_LIST-NAME,
      'X'    TO OPT_LIST-OPTIONS-EQ.
APPEND OPT_LIST TO RES-OPT_LIST_TAB.

MOVE: 'S' TO ASS-KIND,
      'S_VBELN' TO ASS-NAME,
      'I' TO ASS-SG_MAIN,
      ' ' TO ASS-SG_ADDY,
      'OPT1' TO ASS-OP_MAIN.
APPEND ASS TO RES-ASS_TAB.


   CALL FUNCTION 'RS_INT_SELOPT_RESTRICT'
     EXPORTING
       PROGRAM                      = SY-REPID
       RESTRICTION                  = RES
    EXCEPTIONS
      SELOPT_WITHOUT_OPTIONS       = 1
      SELOPT_WITHOUT_SIGNS         = 2
      INVALID_SIGN                 = 3
      EMPTY_OPTION_LIST            = 4
      INVALID_KIND                 = 5
      REPEATED_KIND_A              = 6
      OTHERS                       = 7.
   IF SY-SUBRC <> 0.
   ENDIF.


************************************************************************
*                S T A R T - O F - S E L E C T I O N                   *
************************************************************************

Regards

Eswar

Message was edited by:

Eswar Rao Boddeti

Just checked that the thread is already answered, am slow... NVM, it had resolved your query:)

0 Kudos

Hi Eswar,

Thank you very much for your valuable input. I have assigned points for you.

0 Kudos

Hi Jaison

Glad the info i have provided could help you.:)

Regards

Eswar

Former Member
0 Kudos

You can look at the tip "Restricting select options" in SAPTechnical.COM

Former Member
0 Kudos

This message was moderated.