Complex Restrictions in Select-options
Hi Team,
I've coded SELECT-OPTIONS in my web dynpro(ABAP) and want to disable the complex selection button/link (displayed just before the actual field). This link takes the user to either "Exclude" the selection or other options like "GE", "BT" etc. I actually want that user should only select ONE value with sign="I" and Option='EQ'. Is there a way to manage this? Please help.
Thanks for your time.
P.S: Points will be awarded for solutions
Hi Sanjay.
You can switch of intervall and complex restrictions using the
parameters I_USE_COMPLEX_RESTRICTION and I_NO_INTERVALS
of the method ADD_SELECTION_FIELD:
wd_this->mr_selop->add_selection_field(
i_id = lv_fieldname
i_no_intervals = abap_true
i_use_complex_restrictions = abap_false
Hope this helps.
Cheers,
Sascha
Similar Messages
-
is exist restriction for select-options?
for example:
<b> data: ftxt04(4).
select-options: txt04 for ftxt04.</b>Hi,
You can restrict select-options.
SELECT-OPTIONS : S_VKORG FOR TVKO-VKORG MEMORY ID VKO.
Form F1000_RESTRICT_VKORG.
INITIALIZATION.
PERFORM F1000_RESTRICT_VKORG.
Define the object to be passed to the RESTRICTION parameter
DATA lw_restrict TYPE SSCR_RESTRICT.
Auxiliary objects for filling RESTRICT
DATA lw_opt_list TYPE sscr_opt_list.
DATA lw_*** TYPE sscr_***.
Assign selection screen objects to option list and sign
NOINTERVLS: BT and NB not allowed
CLEAR lw_opt_list.
MOVE 'NOINTERVLS' TO lw_opt_list-name.
MOVE 'X' TO: lw_opt_list-options-cp,
lw_opt_list-options-eq,
lw_opt_list-options-ge,
lw_opt_list-options-gt,
lw_opt_list-options-le,
lw_opt_list-options-lt,
lw_opt_list-options-ne,
lw_opt_list-options-np.
APPEND lw_opt_list TO lw_restrict-opt_list_tab.
KIND = 'S':
CLEAR lw_***.
MOVE: 'S' TO lw_***-kind,
'S_VKORG' TO lw_***-name,
'I' TO lw_***-sg_main,
'*' TO lw_***-sg_addy,
'NOINTERVLS' TO lw_***-op_main.
APPEND lw_*** TO lw_restrict-***_tab.
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
restriction = lw_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. "Restriction error encountered for Select
"Option
MESSAGE I001 WITH 'ERROR IN SELECT OPTION'."ERROR IN SELECT OPTION
ENDIF.
endform. " F1000_RESTRICT_VKORG -
Restricting the Select-options by using the FM "SELECT_OPTIONS_RESTRICT"
Hi ,
Thank You very much for reading this query.
My requirement is, I need to display 3 select-option fields on my selection screen.
1) Field1 is S_periods which is to populate the Numbers.For this field I need to provide the options single and ranges (First 2 options).
2) Field 2 is S_RECIPIENTS which should contain user IDs.For this field I need to give first option which is single values.
3) Field 3 is S_TRANSACTIONS which should contain 3 options (Select singles, ranges and Exclude singles).
So by calling the FM "SELECT_OPTIONS_RESTRICT' only once, Can i provide all these options or I need to call this FM 3 times for 3 fields .
Can any one help me on this.
If possible plz provide me some pseudo code on this.I have gone through so many forum points on this but I havenot seen this kind of requirement.
Thanks and Regards,
K.krishna Chaitanya.Check this code for first and second case.
I don't think third case is possible.
* T A B L E S
TABLES: afko, mara.
* D A T A D E C L A R A T I O N S
TYPE-POOLS: sscr.
DATA: gt_restrict TYPE sscr_restrict,
gs_selopt TYPE sscr_***,
gs_opt_list TYPE sscr_opt_list.
SELECT-OPTIONS: s_aufnr FOR afko-aufnr,
s_matnr FOR mara-matnr.
* INITIALIZATION
INITIALIZATION.
* MATERIAL
CLEAR gs_opt_list.
gs_opt_list-name = 'OBJ_MATNR'.
gs_opt_list-options-eq = 'X'.
gs_opt_list-options-bt = 'X'.
APPEND gs_opt_list TO gt_restrict-opt_list_tab.
CLEAR gs_selopt.
gs_selopt-kind = 'S'.
gs_selopt-name = 'S_MATNR'.
gs_selopt-sg_main = 'I'.
gs_selopt-op_main = 'OBJ_MATNR'.
APPEND gs_selopt TO gt_restrict-***_tab.
* ORDER
CLEAR gs_opt_list.
gs_opt_list-name = 'OBJ_AUFNR'.
gs_opt_list-options-eq = 'X'.
APPEND gs_opt_list TO gt_restrict-opt_list_tab.
CLEAR gs_selopt.
gs_selopt-kind = 'S'.
gs_selopt-name = 'S_AUFNR'.
gs_selopt-sg_main = 'I'.
gs_selopt-op_main = 'OBJ_AUFNR'.
APPEND gs_selopt TO gt_restrict-***_tab.
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
restriction = gt_restrict
EXCEPTIONS
too_late = 1
repeated = 2
selopt_without_options = 5
selopt_without_signs = 6
invalid_sign = 7
empty_option_list = 9
invalid_kind = 10
repeated_kind_a = 11
OTHERS = 12. -
Restrictions in select-options
Hi,
How to remove the diffrent tabs in the extention of a select-option? Foe example I want to remove 'exclude single values' and 'exclude range' from the extention of select-options.
Thanks in advance
Jaison JosephHi
Please check the following link which has many examples from our friends in the forum.
Re: Restricting Select-options
And one small example from me:
TABLES: VBAK.
TYPE-POOLS: SSCR.
* S E L E C T I O N S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK BLK3 WITH FRAME NO INTERVALS.
SELECTION-SCREEN BEGIN OF BLOCK BLK0 WITH FRAME TITLE TEXT-000 NO
INTERVALS.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: P_ARC RADIOBUTTON GROUP RAD0 DEFAULT 'X'
USER-COMMAND ABC.
SELECTION-SCREEN COMMENT (20) TEXT-003 FOR FIELD P_ARC.
SELECTION-SCREEN POSITION 33.
PARAMETERS: P_DIS RADIOBUTTON GROUP RAD0.
SELECTION-SCREEN COMMENT (20) TEXT-004 FOR FIELD P_DIS.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK BLK0.
SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001 NO
INTERVALS.
PARAMETERS: P_VKORG LIKE VBAK-VKORG OBLIGATORY.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN OBLIGATORY NO INTERVALS.
SELECTION-SCREEN END OF BLOCK BLK1.
SELECTION-SCREEN BEGIN OF BLOCK BLK2 WITH FRAME TITLE TEXT-002 NO
INTERVALS.
PARAMETERS: P_SO RADIOBUTTON GROUP RAD1 DEFAULT 'X' MODIF ID ABC,
P_PO RADIOBUTTON GROUP RAD1 MODIF ID ABC,
P_SOPO RADIOBUTTON GROUP RAD1 MODIF ID ABC.
SELECTION-SCREEN END OF BLOCK BLK2.
SELECTION-SCREEN END OF BLOCK BLK3.
* A T S E L E C T I O N - S C R E E N OUTPUT *
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'ABC' OR SCREEN-NAME = '%B002014_BLOCK_1000'.
CASE 'X'.
WHEN P_ARC.
SCREEN-ACTIVE = 1.
WHEN P_DIS.
SCREEN-ACTIVE = 0.
ENDCASE.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
* I N I T I A L I Z A T I O N *
INITIALIZATION.
DATA: RES TYPE SSCR_RESTRICT.
DATA OPT_LIST TYPE SSCR_OPT_LIST.
DATA *** TYPE SSCR_***.
MOVE: 'OPT1' TO OPT_LIST-NAME,
'X' TO OPT_LIST-OPTIONS-EQ.
APPEND OPT_LIST TO RES-OPT_LIST_TAB.
MOVE: 'S' TO ***-KIND,
'S_VBELN' TO ***-NAME,
'I' TO ***-SG_MAIN,
' ' TO ***-SG_ADDY,
'OPT1' TO ***-OP_MAIN.
APPEND *** TO RES-***_TAB.
CALL FUNCTION 'RS_INT_SELOPT_RESTRICT'
EXPORTING
PROGRAM = SY-REPID
RESTRICTION = RES
EXCEPTIONS
SELOPT_WITHOUT_OPTIONS = 1
SELOPT_WITHOUT_SIGNS = 2
INVALID_SIGN = 3
EMPTY_OPTION_LIST = 4
INVALID_KIND = 5
REPEATED_KIND_A = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
ENDIF.
* S T A R T - O F - S E L E C T I O N *
Regards
Eswar
Message was edited by:
Eswar Rao Boddeti
Just checked that the thread is already answered, am slow... NVM, it had resolved your query:) -
Hi to all experts,
I have a select option in the selection screen my requirement is that the records which have movement type 101 or 105 should only get printed even if the user select as 101 to 105 the remaining (102,103,104) records should not get printed how can we achieve this>
mozam khan wrote:
> Hi Amit,
>
> Im printing from smartform . what are the other ways that we can do this
Hello Mozam,
You must have developed a custom driver program for this purpose. And in the SF interface have you must have passed an internal table with the Movement details ?
If yes, you can delete the other movement types from this table & keep only the required ones.
DATA:
R_BWART TYPE RANGE OF BWART,
WA_BWART LIKE LINE OF R_BWART.
WA_BWART-SIGN = 'I'.
WA_BWART-OPTION = 'EQ'.
WA_BWART-LOW = '101'.
APPEND WA_BWART TO R_BWART.
WA_BWART-SIGN = 'I'.
WA_BWART-OPTION = 'EQ'.
WA_BWART-LOW = '105'.
APPEND WA_BWART TO R_BWART.
CLEAR WA_BWART.
DELETE ITAB WHERE BWART NOT IN R_BWART.
BR,
Suhas
Edited by: Suhas Saha on Feb 26, 2009 9:44 AM -
I am using a logical database in HR.I use the selection screen of the logical database but i want to restrict a select options for only permit introduce one value.
I restrict in abap to only use values ,nor intervals by example and other conditions.Now i have to restrict to only one value.
it must be work like a parameterHi,
U can use No-extension to restrict multiple selcet option button.
See this link
http://www.sapdevelopment.co.uk/reporting/selscr/selscr_restrictso.htm
*: Report: ZRESTRICT_SELOPT :
*: Author: www.SAPdev.co.uk :
*: Date : 2004 :
*: Description: Demonstrates how to restrict select options to only :
*: allow specific restriction options: :
*: i.e.. EQ, NE, BT etc.. :
REPORT ZRESTRICT_SELOPT.
* Include type pool SSCR
TYPE-POOLS sscr.
TABLES: EKPO.
* Selection-screen
select-options : so_ebeln for ekpo-ebeln,
so_ebelp for ekpo-ebelp.
* 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_*** TYPE sscr_***. "header line for table 2
*INITIALIZATION.
INITIALIZATION.
* Restrict SO_EBELN 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_***-kind = 'S'.
gd_***-name = 'SO_EBELN'.
gd_***-sg_main = 'I'.
gd_***-sg_addy = SPACE.
gd_***-op_main = 'KEY1'. "Must be same as above
APPEND gd_*** TO gd_restrict-***_tab.
clear: gd_***.
* Restrict SO_EBELP 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_***-kind = 'S'.
gd_***-name = 'SO_EBELP'.
gd_***-sg_main = 'I'.
gd_***-sg_addy = SPACE.
gd_***-op_main = 'KEY2'. "Must be same as above
APPEND gd_*** TO gd_restrict-***_tab.
clear: gd_***.
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.
Kindly reward points for the answer which helped u and close the thread if ur problem got solved.
Message was edited by: Judith Jessie Selvi -
Hi,
I came across this piece of code in ABAP FAQ. It is supposed to restrict the select-options so that the user can enter only specific options like only intervals or single values or patterns etc. But for some reason its not working for me. I am using SAP 4.7.
Any pointers will be greatly appreciated.
Restricting the selection screen
REPORT ZDANY_RESTRICT_SELECTION.
Include type pool SSCR
TYPE-POOLS sscr.
TABLES : sflight.
defining the selection-screen
select-options :
s_carrid for sflight-carrid,
s_connid for sflight-connid.
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,
*** type sscr_***.
INITIALIZATION.
Restricting the carrid selection to only EQ and 'BT'.
optlist-name = 'OBJECTKEY1'.
optlist-options-eq = 'X'.
optlist-options-bt = 'X'.
APPEND optlist TO restrict-opt_list_tab.
***-kind = 'S'.
***-name = 'S_carrid'.
***-sg_main = 'I'.
***-sg_addy = space.
***-op_main = 'OBJECTKEY1'.
APPEND *** TO restrict-***_tab.
Restricting the connid 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.
***-kind = 'S'.
***-name = 'S_connid'.
***-sg_main = 'I'.
***-sg_addy = space.
***-op_main = 'OBJECTKEY2'.
APPEND *** TO restrict-***_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.
Regards,
SudeepHi
Olaf's solution should be OK. Always use uppercase for this kind of variable values. I guess you've already seen, but the FM has a documentation if you need more information on it.
*--Serdar -
Hi experts,
is it possible to restrict the select options so that the user can select only from a limited list based on previous selections?
Example: user selects value "A" of attribute1 from drop-down list, then in the select options he/she would be allowed to select attr2 with attr1 = "A".
Thanks a lot!
TomasHi Tomas.
I think it is not possible if you use the select options component for that.
But if you do it using the controls directly (dropdown, inputfield) you can do it easily.
So if the user selects something in dropdown A you can fill the node for dropdown B in the onselect method.
Cheers,
Sascha -
I want to restrict the selection option of a field.
There will be no intervals to enter.
Only EQ will be available.
Will allow multiple values but no intervals.
when I enter somthing* and than proceed it displays a popup showing which criteria to select and there is only EQ value.
In other circumstances it works as I want. But I do not want the popup.
Please help.
I write the code below.
TABLES:
vbak.
SELECT-OPTIONS:
zvbeln FOR vbak-vbeln
NO INTERVALS
MATCHCODE OBJECT zpyp_posid
OBLIGATORY
INITIALIZATION.
PERFORM init_1001.
*& Form init_1001
text
FORM init_1001 .
TYPE-POOLS:
sscr.
DATA:
restriction TYPE sscr_restrict,
wa_opt_list TYPE sscr_opt_list,
ls_*** TYPE sscr_***.
MOVE 'EQ' TO wa_opt_list-name.
MOVE 'X' TO wa_opt_list-options-eq.
APPEND wa_opt_list TO restriction-opt_list_tab.
MOVE: 'S' TO ls_***-kind,
'I' TO ls_***-sg_main,
' ' TO ls_***-sg_addy,
'EQ' TO ls_***-op_main,
'EQ' TO ls_***-op_addy,
'ZVBELN' TO ls_***-name.
APPEND ls_*** TO restriction-***_tab.
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
PROGRAM =
restriction = restriction
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.
ENDFORM.Hi Fuat ,
i don't understand ?!
in my example report comes <b>no addtitional popup</b>:
here's the complete test-report:
REPORT z6.
TABLES:
vbak, bkpf.
SELECT-OPTIONS:
zvbeln FOR vbak-vbeln OBLIGATORY DEFAULT '5300000000'.
INITIALIZATION.
PERFORM init_1001.
START-OF-SELECTION.
SELECT belnr FROM bkpf INTO bkpf-belnr
WHERE bukrs = '0001'
AND belnr IN zvbeln
AND gjahr = sy-datum(4).
WRITE: / bkpf-belnr.
ENDSELECT.
IF sy-subrc <> 0.
WRITE: / 'no entry found!'.
ENDIF.
*& Form init_1001
FORM init_1001 .
TYPE-POOLS:
sscr.
DATA:
restriction TYPE sscr_restrict,
wa_opt_list TYPE sscr_opt_list,
ls_*** TYPE sscr_***.
MOVE 'EQ' TO wa_opt_list-name.
MOVE 'X' TO wa_opt_list-options-eq.
APPEND wa_opt_list TO restriction-opt_list_tab.
MOVE: 'S' TO ls_***-kind,
'I' TO ls_***-sg_main,
'EQ' TO ls_***-op_main,
'ZVBELN' TO ls_***-name.
APPEND ls_*** TO restriction-***_tab.
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
restriction = restriction.
ENDFORM.
regards Andreas -
hi,
How do I use the CASE statement when the variable is a range (so_mes).
so_mes is defined like a select-options.
i have the next code.
case so_mes-low.
when '01'.
move dobli-wtp01 to oejer.
when '02'.
move dobli-wtp02 to oejer.
when '03'.
move dobli-wtp03 to oejer.
when '04'.
move dobli-wtp04 to oejer.
when '05'.
move dobli-wtp05 to oejer.
when '06'.
move dobli-wtp06 to oejer.
when '07'.
move dobli-wtp07 to oejer.
when '08'.
move dobli-wtp08 to oejer.
when '09'.
move dobli-wtp09 to oejer.
when '10'.
move dobli-wtp10 to oejer.
when '11'.
move dobli-wtp11 to oejer.
when '12'.
move dobli-wtp12 to oejer.
in this case only take the low value. How can I asigned the the high value in the statement CASE?.I would suggest doing something like this. Allow the user to enter only single values in the select-option, then you can loop at the select-option and process accordingly.
report zrich_0001.
* Type pools
type-pools: slis, sscr.
data: char2(2) type c.
select-options: so_mes for char2.
initialization.
perform initilization.
start-of-selection.
loop at so_mes.
case so_mes-low.
when '01'.
*move dobli-wtp01 to oejer.
when '02'.
*move dobli-wtp02 to oejer.
when '03'.
*move dobli-wtp03 to oejer.
when '04'.
*move dobli-wtp04 to oejer.
endcase.
endloop.
* INITILIZATION
form initilization.
* Restrict the select options for SO_MES
* to just a date range
data: selopt type sscr_***,
opt_list type sscr_opt_list,
restrict type sscr_restrict.
clear opt_list.
opt_list-name = 'EQ'.
opt_list-options-eq = 'X'.
append opt_list to restrict-opt_list_tab.
clear selopt.
selopt-kind = 'S'.
selopt-name = 'SO_MES'.
selopt-sg_main = 'I'.
selopt-sg_addy = ' '.
selopt-op_main = 'EQ'.
selopt-op_addy = 'EQ'.
append selopt to restrict-***_tab.
call function 'SELECT_OPTIONS_RESTRICT'
exporting
restriction = restrict
exceptions
too_late = 1
repeated = 2
selopt_without_options = 5
selopt_without_signs = 6
invalid_sign = 7
empty_option_list = 9
invalid_kind = 10
repeated_kind_a = 11
others = 12.
endform.
Regards,
Rich Heilman -
How to pass Multiple entries of select-options to FM
Hi friends,
i need to pass values date_from and date_to of FM BAPI_AR_ACC_GETSTATEMENT in my report. i have select-option in the selection screen for the posting date i.e, s_pstgdate-low = date_from and s_pstgdate-high = date_to.
My question is how to pass values if the user enters multiple entries in s_pstgdate (selection-screen).
Hope i'm clear with my question.
Thanks in anticipation.
Regards
PoornaHi,
This is not possible.
You may wish to call it multiple times with each row of your select-option, and consolidate the returned records.
Better is to restrict the select-option with no-extension.
cheers, -
Selection order to follow the select-option order rather than numerical ord
Hi Gurus!
I have created a program to print Form headers. The program selects the documents from nast table based on the document numbers eneterd in selection screen. When I eneter for example documents :
10000007
10000005
10000001
10000002
10000004 and run the program it prints the headers in sequential order rather than the order I put the documents numbers in selection screen.
It prints
10000001
10000002
10000004
10000005
10000007.
Is there by any chnace a way that I can print it exactly in the same order as the documents are entered in the selection screen?
Thanks. Help will be greatly appreciated.Yes, I agree. But my suggestion was to display or call the Form FM within the Select-options loop and Read Nast internal table for details. Hope you have restricted the Select options to restrict the entries only for "=" with no extension.
Loop at S_SELOPT.
Read table GT_NAST into GS_NAST with key OBJKY = S_SELOPT-LOW.
If Sy-Subrc eq 0.
..... your existing logic to display the form....
endif.
Endloop. -
How to restrict more than one 1 range in select option on selection screen.
Hi all,
I have a requirement where I need to restrict user from giving more than 1 range for a date selct option ..other all features of multiple selection will be as usual...
for eg we can do this if we disable / hide other cells if the user clicks on multiple ranges tab.. If only 1 cell is available to give the range user will not be able to give more than 1 range....
I was thinking if I could use select_options_restrict but how do i fill its parameters...
Can anyone send me the sample code or the same to achieve this functionality...I have used select_options_restrict to hide multiple ranges itself ... But here user will be able to give range but only 1....
Thanks and Regards
SwetaHI,
Please try the below logic.
SELECT-OPTIONS: so_addr FOR ADR6-SMTP_ADDR NO INTERVALS.
***********remove_range_for_select_option******************* .
DATA: ls_restrict TYPE SSCR_RESTRICT, "The type for SELECT_OPTIONS_RESTRICT
ls_opt_list TYPE SSCR_OPT_LIST, "One list of options
ls_asn TYPE SSCR_***. "One line of table associating selection screen
"object with opt. list
CLEAR: ls_restrict,
ls_opt_list,
ls_asn.
*Only EQ valid, discrete values, Include & Exclude
ls_opt_list-name = 'EQ'.
ls_opt_list-options-eq = 'X'.
APPEND ls_opt_list TO ls_RESTRICT-OPT_LIST_TAB.
LS_ASN-KIND = 'S'.
LS_ASN-NAME = 'SO_ADDR'. "Select Option
LS_ASN-SG_MAIN = 'I'.
LS_ASN-SG_ADDY = '*'.
LS_ASN-OP_MAIN = 'EQ'.
LS_ASN-OP_ADDY = ' '.
APPEND LS_ASN TO LS_RESTRICT-***_TAB.
*Make use of SELECT-OPTIONS easier on the selection screen
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
RESTRICTION = LS_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.
Edited by: Rajasekhar Reddy P on Mar 16, 2009 2:03 PM -
Restrict Select-Options for Logical Database field
The way we restrict select options for custom defined select option fields on selection screen.. can we restrict select options for standard Logical Database fields?
i.e. report uses PNPCE logical database and has field called PERNR. I want to restrict select options for this PERNR field so that it has options for 'Select single values' only.
Thanks,
Falguni
Edited by: Falguni V on Nov 13, 2010 6:42 AMYou can user AT SELECTION-SCREEN event, and check whether any record is having high value for PNPPERNR.
-
Is there any restriction on no of entries in Select-option-low ?
Is there any restriction on no of entries in Select-option-low ? I have a select option which has 22 thousand entries and the select query is thrwoing a dump.
Any inputs ?
Regards,
Ankur BhandariHi Ankur,
1. i had faced same problem.
2. Virtually the limit in SELECT-OPTION low
is not the problem.
3. The problem is with SQL query and database limit.
4. The R/3 system generates final database query
in the form of (for select option)
FIELD IN ('ABC','DEF','XYZ',........'')
5. Now Oracle/SqlServer
has limit of THESE IN VALUES.
limit is something in 2500 approx.
6. So your approach will not work
using IN.
It will always give error when
entries are more.
7. SOLUTION which i did.
1. First select all appropriate records from
master table in your itab
(without using IN select option clause)
2. After that use this concept.
Loop at ITAB.
If Itab-Field in SelectOption.
Else.
DELETE ITAB.
ENDIF.
The above will take care for any number of records.
I hope it helps.
regards,
amit m.
Message was edited by: Amit Mittal
Message was edited by: Amit Mittal
Maybe you are looking for
-
Hi all, The description of the question that I have put as the title is probably as clear as mud! LOL So i have attached a picture so that you can hopefully see what i am trying to explain! When I sysnc'd my iphone I suddenly has a "spare" black apps
-
Accessing Business Intelligence via Browser?
Hi all, we have a CA Clarity system which we will be using Business Objects with, rather than Actuate. Our Internal Systems team have installed the Business Objects server for use with publishing reports etc. They say that it is Business Intelligence
-
I want to add a SSD to a 13" MacBook.
Hi there! I want to add a SSD to a 13" MacBook Pro I'm going to be purchasing soon. Although I don't no whether its worth getting an Apple SSD or installing my own and using the HDD as an external hard drive. Costs and labor included, whats the best
-
Enabling LAN after reinstalling Windows - Satellite Pro A10
I gave my Toshiba Satellite Pro A10 Laptop a clean format with a copy of Windows XP Pro. Typically, I use a PCMCIA Wireless Internet card, but I do want to connect my laptop via a physical Ethernet cable. Unfortunately I cannot figure out how to enab
-
N96 - Calendar entries in Standby?
The calendar entries that appear on the front screen, ie standby - is there anyway to have more than one or two? The calendar entries I have are very random, for instance, I had 3 calendar items yesterday, 2 calendar items today and 3 tomorrow. Yest