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_RESTRICT

Former Member
0 Likes
1,259

Hi all.

In a select option I want to allow the user to select only single values,

i.e. no ranges, as included values (green values) and as excluded values

(red values) in the same select-option

I was able to do it for the include values, but I couldn't figure out to do

the exclude.

Does anybody know what is the correct way to use the FM

SELECT_OPTIONS_RESTRICT to do it?

Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,104

Hi,

REPORT selectoptionsrestrict.

  • 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.

Hope this helps,

Chaitanya

3 REPLIES 3
Read only

Former Member
0 Likes
1,104

hi rupesh,

do this way ....

select-options : s_vbeln like vbak-vbeln no intervals no-extension.

Refer to this related thread

;&#57179;

Regards,

Santosh

Edited by: Santosh Kumar Patha on Feb 23, 2008 10:18 AM

Read only

Former Member
0 Likes
1,105

Hi,

REPORT selectoptionsrestrict.

  • 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.

Hope this helps,

Chaitanya

Read only

Former Member
0 Likes
1,104

Hi,

did u try like dis........

data date type dats.
select-options s_date for date no-EXTENSION NO INTERVALS.

Cheers,

jose.