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
561

hi,

my requirement is that my selct options shd accept single input as well as multiple single inputs

it shd not have ranges, for which i have used

SELECT-OPTIONS : S_route for zvmt_cg_mxvol-route no intervals obligatory.

through no interval option the ranges go

but when we click on extension button that time the screen which appears has 4 tabs i want to disable the 2nd , 3rd and 4th tab ... how can i do it ?

otherwise is there any other way i can provide user with this type of select on the selection screen ?

help will be app

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
532

Use FM SELECT_OPTIONS_RESTRICT'.

  • Define the object to be passed to the RESTRICTION parameter

data wa_restrict type sscr_restrict.

  • Auxiliary objects for filling RESTRICT

data : wa_optlist type sscr_opt_list,

wa_ass type sscr_ass.

  • Restricting the Parameter selection to only EQ .

wa_optlist-name = 'OBJECTKEY1'.

wa_optlist-options-eq = c_flag .

append wa_optlist to wa_restrict-opt_list_tab.

wa_ass-kind = 'S' .

wa_ass-name = 'S_NAME'.

wa_ass-sg_main = 'I'.

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 id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

Regards,

Joy.

4 REPLIES 4
Read only

Former Member
0 Likes
532

use FM :

SELECT_OPTIONS_RESTRICT

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

  • Exception handling

if sy-subrc ne 0.

endif.

Read only

Former Member
0 Likes
532

HI,

tables : mARA.

select-options : p_matnr for mara-matnr NO INTERVALS NO-EXTENSION.

USE NO EXTENSION TOOO..

regards,

sravanthi.

Read only

Former Member
0 Likes
532

Hi,

Just goto FM - SELECT_OPTIONS_RESTRICT and see how it is used in any of the programs.

simply giving no-intervals is not enough

Cheers

Kothand

Read only

Former Member
0 Likes
533

Use FM SELECT_OPTIONS_RESTRICT'.

  • Define the object to be passed to the RESTRICTION parameter

data wa_restrict type sscr_restrict.

  • Auxiliary objects for filling RESTRICT

data : wa_optlist type sscr_opt_list,

wa_ass type sscr_ass.

  • Restricting the Parameter selection to only EQ .

wa_optlist-name = 'OBJECTKEY1'.

wa_optlist-options-eq = c_flag .

append wa_optlist to wa_restrict-opt_list_tab.

wa_ass-kind = 'S' .

wa_ass-name = 'S_NAME'.

wa_ass-sg_main = 'I'.

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 id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

Regards,

Joy.