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

How to disable the SELECT-OPTINS multiple selection screen's Ranges options

Hi this is sekhar,

I have used the Select-options: statement with 'No-Interval' option. Now I need to restrict the user not to enter the values in the Ranges column of multiple selection screen. How can I do it....

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

9 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 02, 2006 at 11:33 AM

    ,NO EXTENSIONS' CAN BE USED AT SELECT-OPTIONS.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 02, 2006 at 11:34 AM

    Hi,

    This is SAP standard, you can use no-intervals at max but i dont think so you can disable RANGE option.

    You can put a check in AT SELECTION-SCREEN.

    IF select-option-high contains some value.

    Then you can stop processing and show appropriate message.

    *REWARD if this helps

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 02, 2006 at 11:34 AM

    Hi shekar,

    welcome to SDN.

    chkl this sample code.

    REPORT Z_CONECT_A.

    • Include type pool SSCR

    TYPE-POOLS sscr.

    TABLES : marc.

    • defining the selection-screen

    select-options :

    s_matnr for marc-matnr,

    s_werks for marc-werks.

    • Define the object to be passed to the RESTRICTION parameter

    DATA restrict TYPE sscr_restrict.

    • Auxiliary objects for filling RESTRICT

    DATA : optlist TYPE sscr_opt_list,

    ass type sscr_ass.

    INITIALIZATION.

    • Restricting the MATNR selection to only EQ and 'BT'.

    optlist-name = 'OBJECTKEY1'.

    optlist-options-eq = 'X'.

    optlist-options-bt = 'X'.

    APPEND optlist TO restrict-opt_list_tab.

    ass-kind = 'S'.

    ass-name = 'S_MATNR'.

    ass-sg_main = 'I'.

    ass-sg_addy = space.

    ass-op_main = 'OBJECTKEY1'.

    APPEND ass TO restrict-ass_tab.

    • Restricting the WERKS selection to CP, GE, LT, NE.

    optlist-name = 'OBJECTKEY2'.

    optlist-options-cp = 'X'.

    optlist-options-ge = 'X'.

    optlist-options-lt = 'X'.

    optlist-options-ne = 'X'.

    APPEND optlist TO restrict-opt_list_tab.

    ass-kind = 'S'.

    ass-name = 'S_WERKS'.

    ass-sg_main = 'I'.

    ass-sg_addy = space.

    ass-op_main = 'OBJECTKEY2'.

    APPEND ass TO restrict-ass_tab.

    CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'

    EXPORTING

    restriction = restrict

    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 SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    rgds

    anver

    Message was edited by: Anversha s

    Message was edited by: Anversha s

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 02, 2006 at 11:35 AM

    i don't know if it is possible restrict in map parameters

    you can you a control with at selecion-screen on <Ranges>

    where you check if are present datas in column of multiple selection screen.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 02, 2006 at 11:39 AM

    you can do it in the following way :

    FORM init_screen.

    DATA: restrict TYPE sscr_restrict,

    opt_list TYPE sscr_opt_list,

    ass TYPE sscr_ass.

    *...... restrict select options: only inclusive values allowed ........

    CLEAR opt_list.

    opt_list-name = 'OPT_LIST'.

    opt_list-options-bt = 'X'.

    opt_list-options-eq = 'X'.

    APPEND opt_list TO restrict-opt_list_tab.

    CLEAR ass.

    ass-kind = 'B'.

    ass-name = 'SET_SELECTION'.

    ass-sg_main = 'I'.

    ass-op_main = 'OPT_LIST'.

    APPEND ass TO restrict-ass_tab.

    CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'

    EXPORTING

    restriction = restrict.

    ENDFORM.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 02, 2006 at 11:47 AM

    You can also refer this code as below : CHECK OUT SELECT OPTION sel_1_0.

    &----


    *& Report ZTESTREP

    *&

    &----


    *&

    *&

    &----


    REPORT ztestrep.

    • Include type pool SSCR

    TYPE-POOLS sscr.

    • Define the object to be passed to the RESTRICTION parameter

    DATA restrict TYPE sscr_restrict.

    • Auxiliary objects for filling RESTRICT

    DATA opt_list TYPE sscr_opt_list.

    DATA ass TYPE sscr_ass.

    • Define the selection screen objects

    • First block: 3 SELECT-OPTIONS

    SELECTION-SCREEN BEGIN OF BLOCK block_0 WITH FRAME TITLE text-bl0.

    SELECT-OPTIONS sel_0_0 FOR sy-tvar0.

    SELECT-OPTIONS sel_0_1 FOR sy-tvar1.

    SELECT-OPTIONS sel_0_2 FOR sy-tvar2.

    SELECT-OPTIONS sel_0_3 FOR sy-tvar3.

    SELECTION-SCREEN END OF BLOCK block_0.

    • Second block: 2 SELECT-OPTIONS

    SELECTION-SCREEN BEGIN OF BLOCK block_1 WITH FRAME TITLE text-bl1.

    SELECT-OPTIONS sel_1_0 FOR sy-subrc.

    SELECT-OPTIONS sel_1_1 FOR sy-repid.

    SELECTION-SCREEN END OF BLOCK block_1.

    INITIALIZATION.

    • Define the option list

    • ALL: All options allowed

    MOVE 'ALL' TO opt_list-name.

    MOVE 'X' TO: opt_list-options-bt,

    opt_list-options-cp,

    opt_list-options-eq,

    opt_list-options-ge,

    opt_list-options-gt,

    opt_list-options-le,

    opt_list-options-lt,

    opt_list-options-nb,

    opt_list-options-ne,

    opt_list-options-np.

    APPEND opt_list TO restrict-opt_list_tab.

    • NOPATTERN: CP and NP not allowed

    CLEAR opt_list.

    MOVE 'NOPATTERN' TO opt_list-name.

    MOVE 'X' TO: opt_list-options-bt,

    opt_list-options-eq,

    opt_list-options-ge,

    opt_list-options-gt,

    opt_list-options-le,

    opt_list-options-lt,

    opt_list-options-nb,

    opt_list-options-ne.

    APPEND opt_list TO restrict-opt_list_tab.

    • NOINTERVLS: BT and NB not allowed

    CLEAR opt_list.

    MOVE 'NOINTERVLS' TO opt_list-name.

    MOVE 'X' TO: opt_list-options-cp,

    opt_list-options-eq,

    opt_list-options-ge,

    opt_list-options-gt,

    opt_list-options-le,

    opt_list-options-lt,

    opt_list-options-ne,

    opt_list-options-np.

    APPEND opt_list TO restrict-opt_list_tab.

    • EQ_AND_CP: only EQ and CP allowed

    CLEAR opt_list.

    MOVE 'EQ_AND_CP' TO opt_list-name.

    MOVE 'X' TO: opt_list-options-cp,

    opt_list-options-eq.

    APPEND opt_list TO restrict-opt_list_tab.

    • JUST_EQ: Only EQ allowed

    CLEAR opt_list.

    MOVE 'JUST_EQ' TO opt_list-name.

    MOVE 'X' TO opt_list-options-eq.

    APPEND opt_list TO restrict-opt_list_tab.

    • Assign selection screen objects to option list and sign

    • KIND = 'A': applies to all SELECT-OPTIONS

    MOVE: 'A' TO ass-kind,

    '*' TO ass-sg_main,

    'NOPATTERN' TO ass-op_main,

    'NOINTERVLS' TO ass-op_addy.

    APPEND ass TO restrict-ass_tab.

    • KIND = 'B': applies to all SELECT-OPTIONS in block BLOCK_0,

    • that is, SEL_0_0, SEL_0_1, SEL_0_2

    CLEAR ass.

    MOVE: 'B' TO ass-kind,

    'BLOCK_0' TO ass-name,

    'I' TO ass-sg_main,

    '*' TO ass-sg_addy,

    'NOINTERVLS' TO ass-op_main.

    APPEND ass TO restrict-ass_tab.

    • KIND = 'S': applies to SELECT-OPTION SEL-0-2

    CLEAR ass.

    MOVE: 'S' TO ass-kind,

    'SEL_0_2' TO ass-name,

    'I' TO ass-sg_main,

    '*' TO ass-sg_addy,

    'EQ_AND_CP' TO ass-op_main,

    'ALL' TO ass-op_addy.

    APPEND ass TO restrict-ass_tab.

    • KIND = 'S': Applies to SELECT-OPTION SEL_0_3

    CLEAR ass.

    MOVE: 'S' TO ass-kind,

    'SEL_0_3' TO ass-name,

    'I' TO ass-sg_main,

    'N' TO ass-sg_addy,

    'JUST_EQ' TO ass-op_main.

    APPEND ass TO restrict-ass_tab.

    • Call function module

    CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'

    EXPORTING

    restriction = restrict

    • DB = ' '

    EXCEPTIONS

    too_late = 1

    repeated = 2

    not_during_submit = 3

    db_call_after_report_call = 4

    selopt_without_options = 5

    selopt_without_signs = 6

    invalid_sign = 7

    report_call_after_db_error = 8

    empty_option_list = 9

    invalid_kind = 10

    repeated_kind_a = 11

    OTHERS = 12.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 02, 2006 at 11:55 AM

    hi sekhar ,

    just execute this code ..

    welcome to sdn.

    regards,

    Vijay.

    <b>give the input as 1 and 20 in the range..</b>

    -


    REPORT ZEX4 .

    tables mara.

    select-options: so_matnr for mara-matnr.

    at selection-screen.

    if so_matnr-high ne ' '.

    clear so_matnr-high.

    message e999(zp) with 'cant enter values'.

    endif.

    Message was edited by: Vijay

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 02, 2006 at 11:55 AM

    Use directly the FM 'COMPLEX_SELECTIONS_DIALOG'. There you have many possibilities concerning restrictions of select options.

    Regards,

    Thomas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 02, 2006 at 12:07 PM

    Hi sekhar,

    1. You only want to allow SINGLE VALUES

    (and not ranges)

    2. just copy paste to get a taste of it.

    3. (Its a little tricky to understand)

    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.

    *----


    IMPORTANT CODE

    opt_list-name = 'A'.

    opt_list-options-eq = 'X'.

    APPEND opt_list TO res-opt_list_tab.

    ass-kind = 'A'.

    ass-name = 'BUKRS'.

    ass-op_main = 'A'.

    ass-sg_main = '*'.

    APPEND ass TO res-ass_tab.

    CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'

    EXPORTING

    • PROGRAM =

    restriction = res

    • 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

    .

    BREAK-POINT.

    regards,

    amit m.

    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.