Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Restricting Select-options

Hi friends,

I want to restrict select-options at runtime. can anybody suggest me that how it will do??

Thanks,

Amar

Tags:
replied

Hi amar,

tried out select-options-restrict FM.

  • Include type pool SSCR

TYPE-POOLS: sscr,

slis.

  • Restricting the MATNR selection to only EQ and 'BT'.

opt_list-name = 'OBJECTKEY1'.

opt_list-options-eq = 'X'.

opt_list-options-bt = 'X'.

APPEND opt_list TO restrict-opt_list_tab.

***-kind = 'S'.

***-name = 'S_AYEAR'.

***-sg_main = 'I'.

***-sg_addy = space.

***-op_main = 'OBJECTKEY1'.

APPEND *** TO restrict-ass_tab.

opt_list-name = 'OBJECTKEY2'.

opt_list-options-eq = 'X'.

opt_list-options-bt = 'X'.

APPEND opt_list TO restrict-opt_list_tab.

***-kind = 'S'.

***-name = 'S_APERD'.

***-sg_main = 'I'.

***-sg_addy = space.

***-op_main = 'OBJECTKEY2'.

APPEND *** 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.

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question