Application Development and Automation 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: 
Read only

select-options

Former Member
0 Likes
575

I have a selection screen for various inputs, including Fiscal Year.

I want to restrict the ability of users to input this field as follows:

Include single values only and not be able to specify exclusions.

I have made use of the No Intervals option, but the user still has

the ability to include a range of values and to exclude values.

So I want to use this function to further restrict the values that

can be inputted: select_options_restrict. But I have been unable

to configure the parameters in a way that the user can only include

values and also not be able to specify a range.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
552

CHeck this sample.




report zrich_0001 .

tables: bkpf.

* Type pools
type-pools: slis, sscr.

* Selection Screen
select-options: s_GJAHR for bkpf-GJAHR no intervals.

initialization.
  perform initilization.


************************************************************************
*  INITILIZATION
************************************************************************
form initilization.

* Restrict the select options for S_DATE
* to just a date range
  data: selopt   type sscr_ass,
        opt_list type sscr_opt_list,
        restrict type sscr_restrict.

  clear opt_list.
  opt_list-name          = 'EQ'.
  opt_list-options-eq    = 'X'.
  append opt_list to restrict-opt_list_tab.

  clear selopt.
  selopt-kind            = 'S'.
  selopt-name            = 'S_GJAHR'.
  selopt-sg_main         = 'I'.
  selopt-sg_addy         = ' '.
  selopt-op_main         = 'EQ'.
  selopt-op_addy         = 'EQ'.
  append selopt  to restrict-ass_tab.

  call function 'SELECT_OPTIONS_RESTRICT'
       exporting
            restriction            = restrict
       exceptions
            too_late               = 1
            repeated               = 2
            selopt_without_options = 5
            selopt_without_signs   = 6
            invalid_sign           = 7
            empty_option_list      = 9
            invalid_kind           = 10
            repeated_kind_a        = 11
            others                 = 12.


endform.

Regards,

RIch Heilman

5 REPLIES 5
Read only

Former Member
0 Likes
552

Hi,

if u want to restrict to only one value.

then use this:

Select-options: mat type mara-matnr no-interval no extension.

Reward if helpful.

Regards,

Naveen

Read only

Former Member
0 Likes
552

Hi...

Please follow the option no extension of Slect-options :

Select-options: werks type werks no-interval no extension .

This will remove the extension box on the screen and this way values will be restricted.

Praveen

Read only

Former Member
0 Likes
552

hi

<b>this works fine:</b>

REPORT zselopt_eq.

TYPE-POOLS : sscr.

DATA tr TYPE sscr_restrict.

DATA w1 TYPE sscr_opt_list.

DATA w2 TYPE sscr_ass.

TABLES bkpf.

SELECT-OPTIONS gjahr FOR bkpf-gjahr.

INITIALIZATION.

MOVE 'JUST_EQ' TO w1-name.

MOVE 'X' TO w1-options-eq.

  • MOVE 'X' TO w1-options-ne.

APPEND w1 TO tr-opt_list_tab.

MOVE: 'S' TO w2-kind,

'GJAHR' TO w2-name,

'I' TO w2-sg_main.

MOVE 'N' TO w2-sg_addy.

MOVE 'JUST_EQ' TO w2-op_main.

APPEND w2 TO tr-ass_tab.

*

CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'

EXPORTING

restriction = tr.

START-OF-SELECTION.

regards

ravish

<b>plz dont forget to reward points if helpful</b>

Message was edited by:

ravish goyal

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
553

CHeck this sample.




report zrich_0001 .

tables: bkpf.

* Type pools
type-pools: slis, sscr.

* Selection Screen
select-options: s_GJAHR for bkpf-GJAHR no intervals.

initialization.
  perform initilization.


************************************************************************
*  INITILIZATION
************************************************************************
form initilization.

* Restrict the select options for S_DATE
* to just a date range
  data: selopt   type sscr_ass,
        opt_list type sscr_opt_list,
        restrict type sscr_restrict.

  clear opt_list.
  opt_list-name          = 'EQ'.
  opt_list-options-eq    = 'X'.
  append opt_list to restrict-opt_list_tab.

  clear selopt.
  selopt-kind            = 'S'.
  selopt-name            = 'S_GJAHR'.
  selopt-sg_main         = 'I'.
  selopt-sg_addy         = ' '.
  selopt-op_main         = 'EQ'.
  selopt-op_addy         = 'EQ'.
  append selopt  to restrict-ass_tab.

  call function 'SELECT_OPTIONS_RESTRICT'
       exporting
            restriction            = restrict
       exceptions
            too_late               = 1
            repeated               = 2
            selopt_without_options = 5
            selopt_without_signs   = 6
            invalid_sign           = 7
            empty_option_list      = 9
            invalid_kind           = 10
            repeated_kind_a        = 11
            others                 = 12.


endform.

Regards,

RIch Heilman

Read only

Former Member
0 Likes
552

Hi Gregory ,

please see the documentation of the FM , it contains a sample program also for the same.

Regards

Arun