Created
November 11, 2013 17:04
-
-
Save dantesco/7416580 to your computer and use it in GitHub Desktop.
Limitar los select option a valores especificos, sin rangos.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Include type pool SSCR | |
TYPE-POOLS sscr. | |
* Variables for populating restriction data | |
DATA: gd_restrict TYPE sscr_restrict. "structure containing 2 tables | |
DATA: gd_optlist TYPE sscr_opt_list, "header line for table 1 | |
gd_ass TYPE sscr_ass. "header line for table 2 | |
SELECT-OPTIONS: s_konret FOR bseg-hkont NO INTERVALS, | |
s_koniva FOR bseg-hkont NO INTERVALS. | |
INITIALIZATION. | |
* Restrict select-option to only except EQ, BT and NE. | |
gd_optlist-name = 'KEY1'. "Can be anything | |
gd_optlist-options-eq = 'X'. | |
* gd_optlist-options-bt = 'X'. | |
* gd_optlist-options-ne = 'X'. | |
APPEND gd_optlist TO gd_restrict-opt_list_tab. | |
CLEAR: gd_optlist. | |
gd_ass-kind = 'S'. | |
gd_ass-name = 'S_KONRET'. | |
gd_ass-sg_main = 'I'. | |
gd_ass-sg_addy = space. | |
gd_ass-op_main = 'KEY1'. "Must be same as above | |
APPEND gd_ass TO gd_restrict-ass_tab. | |
CLEAR: gd_ass. | |
* Restrict select-option to only except CP, GE, LT. | |
gd_optlist-name = 'KEY2'. "Can be anything | |
gd_optlist-options-cp = 'X'. | |
gd_optlist-options-ge = 'X'. | |
gd_optlist-options-lt = 'X'. | |
APPEND gd_optlist TO gd_restrict-opt_list_tab. | |
CLEAR: gd_optlist. | |
gd_ass-kind = 'S'. | |
gd_ass-name = 'S_KONIVA'. | |
gd_ass-sg_main = 'I'. | |
gd_ass-sg_addy = space. | |
gd_ass-op_main = 'KEY1'. "Must be same as above | |
APPEND gd_ass TO gd_restrict-ass_tab. | |
CLEAR: gd_ass. | |
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT' | |
EXPORTING | |
* PROGRAM = | |
restriction = gd_restrict | |
* 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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment