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

restrict the values

Former Member
0 Likes
529

Hi Guru's,

i have the field in selection screen bwart i.e movement type as a select-options. i want to display except what i enter in the selection screen.

example :

select-options : bwart 300 to 321.

i have to display bellow 300 and above 321 only not in between 300 to 321.

Thanks & Best Regards,

Rakhi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
507

Hi,

You must have defined select options. Now on runtime just on the right hand side of the second box there will be a small button upon clicking of which would open a dialog box. Select the tab which states Exclude range (two red dots) and enter 300 to 321.

Upon executing this would exclude values from 300 to 321.

You can also set this programmatically as follows

select-options bwart for <tablename>-bwart.

Initialization.

bwart-sign = 'E'.

bwart-option = 'BT'.

bwart-low = 300.

bwart-high = 321.

append bwart.

and execute.

Reagrds

Sachin

3 REPLIES 3
Read only

Former Member
0 Likes
507

Hi,

You may use 'Exclude' - E option, in the initialization.

Ex:

select-options: VNO for LFA1-LIFNR.

initialization.

vno-low = ' 300 '.

vno-high= ' 321'.

vno-sign = 'E'.

Read only

Former Member
0 Likes
508

Hi,

You must have defined select options. Now on runtime just on the right hand side of the second box there will be a small button upon clicking of which would open a dialog box. Select the tab which states Exclude range (two red dots) and enter 300 to 321.

Upon executing this would exclude values from 300 to 321.

You can also set this programmatically as follows

select-options bwart for <tablename>-bwart.

Initialization.

bwart-sign = 'E'.

bwart-option = 'BT'.

bwart-low = 300.

bwart-high = 321.

append bwart.

and execute.

Reagrds

Sachin

Read only

Former Member
0 Likes
507

Check this sample code:

TYPE-POOLS: sscr.
TABLES: t156.
SELECT-OPTIONS: s_bwart FOR t156-bwart.

DATA: rest TYPE sscr_restrict,
      optl TYPE sscr_opt_list,
      sass TYPE sscr_ass.

INITIALIZATION.

  CLEAR: rest.
  optl-name = 'MVT_TYPE'.
  optl-options-nb = 'X'.
  APPEND optl TO rest-opt_list_tab.

  sass-kind = 'S'.
  sass-name = 'S_BWART'.
  sass-sg_main = 'I'.
  sass-sg_addy = space.
  sass-op_main = 'MVT_TYPE'.
  sass-op_addy = 'MVT_TYPE'.
  APPEND sass 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 sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

Now whatever values entered in selection screen for select-options S_BWART are considered as range to exclude.

~Eswar