04-22-2008 9:20 AM
Hi
SELECT-OPTIONS : S_ROLE FOR AGR_USERS-AGR_NAME NO INTERVALS
In my selection screen there is one select-option which has no interval but i have open the option for multiple entries in Extension.
Now when user clicks on extension for entering data into it there are bu default 4 options....
2 for selection (select single values,select ranges)
2 for exclude values(exclude single value,exclude ranges)
I want only one tab select single values
pls help me on this
points will be rewarded
Regards
rajan
04-22-2008 9:23 AM
Make a search in the forum for the FM SELECT_OPTIONS_RESTRICT and you will find answer for your question.
04-22-2008 9:23 AM
Make a search in the forum for the FM SELECT_OPTIONS_RESTRICT and you will find answer for your question.
04-22-2008 9:29 AM
hi ,
use this..function dodule
FORM get_current_value USING value(p_field).
it_scrfields-fieldname = p_field.
APPEND it_scrfields.
*-- Read the Values entered in the selection screen.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = it_scrfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " get_current_value
regards,
venkat.
04-22-2008 9:32 AM
Use this FM : SELECT_OPTIONS_RESTRICT
An example ...
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.
04-22-2008 9:42 AM
Write this in u r AT SELECTION-SCREEN OUTPUT.
*******
Declarations:
DATA :
wa_restrict TYPE sscr_restrict, " Restriction tab
wa_optlist TYPE sscr_opt_list, " Options list
wa_ass TYPE sscr_ass. " Options
consatnts:
c_s VALUE 'S',
c_i VALUE 'I',
c_objname(5) VALUE 'RESTR',
c_fname(8) VALUE 'S_ROLE',
c_vlen(2) type N VALUE '30'.
CODE
CLEAR WA_OPTLIST.
wa_optlist-name = c_objname.
MOVE c_x TO: wa_optlist-options-eq.
APPEND wa_optlist TO wa_restrict-opt_list_tab.
wa_ass-kind = c_s.
wa_ass-name = c_fname.
wa_ass-sg_main = c_i.
wa_ass-sg_addy = space.
wa_ass-op_main = c_objname.
wa_ass-op_addy = c_objname.
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 NE 0.
MESSAGE e531(0U) WITH text-e01.
ENDIF. " IF sy-subrc NE 0.
Regards,
Vamshidhar ..