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: 

hide the high value in selection screen range

Former Member
0 Kudos

In the selection screen of an ABAP Program, I need to use a field where I have to restrict the users from entering a range of values, but still need to enter a list of values. I tried using 'no intervals' in the select-options, but still it lets me enter range. How can I accomplish this?

Thanks

1 ACCEPTED SOLUTION

former_member184119
Active Contributor
0 Kudos

Ok Lets do one thing validate the selection-screen that iof user inputs this and press execute then Trrigger Error message!!

Regards

Sas

4 REPLIES 4

Former Member
0 Kudos

No way are you sure .

Former Member
0 Kudos

SELECT-OPTIONS s_carrid FOR spfli_wa-carrid NO INTERVALS.

It will not allow you to give range of values this is for sure.

If you want to give more values your code shouls NOT contain

NO-EXTENSION .

Pls check .

If you still have the problem why dont you paste your code.

alejandro_bindi
Active Contributor
0 Kudos

You need to use the function module SELECT_OPTIONS_RESTRICT additionally to the simpler NO INTERVALS addition for this.

That way, besides of restricting the "TO" input field from appearing, you also restrict the tabs in the extension screen (yellow arrow button).

Check this code and adapt to yours:


DATA:
  wa_restrict TYPE sscr_restrict,
  wa_opt_list TYPE sscr_opt_list,
  wa_ass      TYPE sscr_ass.

    wa_opt_list-name = 'OBJECTKEY1'.
    wa_opt_list-options-eq = 'X'. "Enabling only single inclusion lists
    APPEND wa_opt_list TO wa_restrict-opt_list_tab.

    wa_ass-kind = 'S'.
    wa_ass-name = 'S_CONOCI'. "Replace with your select option name
    wa_ass-sg_main = 'I'.
    wa_ass-sg_addy = space.
    wa_ass-op_main = 'OBJECTKEY1'.
    APPEND wa_ass TO wa_restrict-ass_tab.
    CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
         EXPORTING
              restriction            = wa_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 e013.
    ENDIF.

Hope this helps.

Regards

Edited by: Alejandro Bindi on Sep 4, 2008 12:57 PM

former_member184119
Active Contributor
0 Kudos

Ok Lets do one thing validate the selection-screen that iof user inputs this and press execute then Trrigger Error message!!

Regards

Sas