SELECT-OPTIONS Multiple selection
Hello
I have the following line of code:
SELECT-OPTIONS: p_matnr FOR mara-matnr.
The users would like to use the multiple selection button to paste/upload from the clip board but unable until at least one entry is entered before the multiple selection will work. Is there a way for the multiple selection to work without entering a material?
THANKS
Hi Gary, Clicking the button shown below bring up the multiple selection screen without requiring a value. Do not add the obligatory keyword on the select-options statement as pointed out by Ramon.
see below:
Similar Messages
-
Issue with Select options in select statement - ABAP Question
Hi
I am facing an issue with select options. Select statement is returning sy-subrc as 4.
I wrote the program as below:
SELECT-OPTIONS:
s_kunnr FOR bsad-kunnr,
s_lifnr FOR bsak-lifnr,
s_gjahr FOR bsad-gjahr,
s_bukrs FOR bsad-bukrs,
s_saknr FOR bsad-saknr,
s_budat FOR bsak-budat.
In start of selection I have written the select statement as
SELECT * FROM bsak INTO TABLE lt_bsak
WHERE bukrs IN s_bukrs AND lifnr = s_lifnr AND gjahr IN s_gjahr AND budat IN s_budat AND saknr IN s_saknr.
In selection screen I have not entered any values and executed the program. I am not getting any result. When I debug that, sy-subrc is 4 at above select statement. But table has records.
If am removing the "lifnr = s_lifnr " condition in select then select is returning values.
I am not getting where I made the mistake. Please suggest.
Thank you
HanuHi,
The problem here with where condition select option lifnr = s_lifnr.
Use below select query.
SELECT * FROM bsak INTO TABLE lt_bsak
WHERE bukrs IN s_bukrs
AND lifnr IN s_lifnr
AND gjahr IN s_gjahr
AND budat IN s_budat
AND saknr IN s_saknr.
s_lifnr is a select option and you are passing it as parameter lifnr = s_lifnr.
if you want to pass this s_lifnr as single vale then pass in below mentioned way.
lifnr = s_lifnr-low
BR,
Vijay -
Problem with table-indexes when using select-options in select
Hello experts,
is it right that table-indexes will not be used if you take select-options to select data from the database?
in detail:
i have build up an table-index for one of our db-tables and test it via an test-programm. The first test with '=' comparisons worked fine. Every key of the index was used; checked via ST05!
e.g.: SELECT * FROM TABLEA INTO ITAB WHERE keya = '1' AND keyb = '2' AND keyc = '3'.
Now i startet the test with select-options
e.g.: SELECT * FROM TABLEA INTO ITAB WHERE keya IN seltabA AND keyb IN seltabB AND keyc IN seltabC.
First of all i just filled the seltabs with only 1 value: eg: seltabA= SIGN = 'I' OPTION = 'EQ' LOW = '1' etc.
Everything worked fine. Every key of the index was used.
But now, I putted more than one entries in the seltabs e.g.
seltabA: SIGN = 'I' OPTION = 'EQ' LOW = '1'
SIGN = 'I' OPTION = 'EQ' LOW = '2'
SIGN = 'I' OPTION = 'EQ' LOW = '3'
From now on, the indexed was not used completely (with all keys).
Isn't that strange? How can i use select-options or sel-ranges with using the complete table-indexes?
Thanks a lot,
MarcelHi Hermann,
i hope this helps:
this is the first one, which uses the complete index:
SELECT
"KOWID" , "LIFNR" , "KLPOS" , "ORGID" , "KOART" , "MATNR" , "GLTVON" ,
"GLTBIS" , "WERT" , "ABLIF" , "FAKIV" , "AENAM" , "AEDAT" , "AFORM" ,
"HERSTELLER" , "ARTGRP" , "OE_FREITXT" , "ARTFREITEXT" , "STATUS" ,
"TERDAT"
FROM
"/dbcon/01_con"
WHERE
"MANDT" = ? AND "LIFNR" = ? AND "ORGID" = ? AND "KOART_BASIS" = ? AND
"STATUS" = ? AND "GEWAEHR_KOWID" < ? AND ( "STATUS" = ? OR "STATUS" = ? OR
"STATUS" = ? ) WITH UR
RESULT: 5 IXSCAN /dbcon/01_con05 #key columns: 4
And the second one, which does not use the complete index! The 3 ranges are filled each with 2 values. Remember; when i fill them each with only one value, the result is the same as you can see above(/dbcon/01_con05 #key columns: 4):
SELECT
"KOWID" , "LIFNR" , "KLPOS" , "ORGID" , "KOART" , "MATNR" , "GLTVON" ,
"GLTBIS" , "WERT" , "ABLIF" , "FAKIV" , "AENAM" , "AEDAT" , "AFORM" ,
"HERSTELLER" , "ARTGRP" , "OE_FREITXT" , "ARTFREITEXT" , "STATUS" ,
"TERDAT"
FROM
"/dbcon/01_con"
WHERE
"MANDT" = ? AND "LIFNR" IN ( ? , ? ) AND "ORGID" IN ( ? , ? ) AND
"KOART_BASIS" IN ( ? , ? ) AND "GEWAEHR_KOWID" < ? AND ( "STATUS" = ? OR
"STATUS" = ? OR "STATUS" = ? ) WITH UR
and here the access-plan
0 SELECT STATEMENT ( Estimated Costs = 5,139E+01 [timerons] )
5 1 RETURN
5 2 NLJOIN
5 3 [O] TBSCAN
5 4 SORT
5 TBSCAN GENROW
5 6 <i> FETCH /dbcon/01_con
7 IXSCAN /dbcon/01_con05 #key columns: 2
As you can see, only 2 keys were taken for indexed selection!
Any idea?
Kind regards,
MArcel
Edited by: Marcel Ebert on Jul 28, 2009 5:25 PM -
Length of select-options in selection screen.
Hi,
I was able to give the lemgth of select-options only upto 8 characters.
Select-options :S_Mtrial for mara-matnr.
But my requirement is I want total name which is more than 8 characters.
Select-options:Material_numberl for mara-matnr.
Can any one help how to do.
Thanks in advance.The Statement...
Select-options :S_Mtrial for mara-matnr
The selection screen length depends on the type that you are assigning to it. Since the length of type
mara-matnr is less, the selection option S_Mtrial will be displayed with short length in the selection screen.
The alternate to do this is...
selection-screen begin of line.
selection-screen comment 2(10) text-001.
select-options : <ur select option name>
selection-screen end of line.
Text element,text-001 contains the select option text to be displayed in the screen
Hope it helps. -
Side by side select options in selection screen
Hai Gurus,
In a report, I need to place Period From and Period To date select-options in selection screen.
In one line (i.e side by side).
Appreciate your immediate response.
Thanks and Regards,
Kiran.Thanks to all,
I got it.
my code here.
SELECTION-SCREEN: BEGIN OF BLOCK sel1 WITH FRAME TITLE text-sel.
PARAMETERS: SUMMARY AS CHECKBOX USER-COMMAND SUMMARY.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(13) text-pfr.
SELECT-OPTIONS: VALID_FR FOR ZZUTIL_RATE-VALID_FR MODIF ID RAM no intervals NO-EXTENSION. "changed
SELECTION-SCREEN COMMENT 30(13) text-pto.
SELECT-OPTIONS: VALID_TO FOR ZZUTIL_RATE-VALID_TO no intervals NO-EXTENSION. "changed
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN: END OF BLOCK SEL1. -
PS:Copy of MBBS report with Date(GR) selection option in selection screen.
Hi,
We are developing a report, which is Copy of MBBS report, addition as Date(GR) selection option in selection screen to view historical data {i.e.Project Stock(Q) on back dates}.
MBBS is showing Project Stock w.r.t. WBS. So pls suggest Table, which can fulfill the requirement to show the Project Stock from GR w.r.t. Purchase and Production order in back date w.r.t. that WBS.
Pls do the needful.
Thanks,
Amit Jain.Hi Amit ,
The Project Stock Table is MSPR , and the Project stock history table is MSPRH .
Though not through with your actual requirement , There is a standard Report MB5B -- Stock on Posting Date . In the selection screen , we can have the Special Stock Q (Project Stock ) .
If you can develop copying this report instead of MBBS , it would take care of receipts as well as issues ,and from the material Document you can build a relation to the account assignment WBS/Network Activity through MSEG Table .
Hope it helps .
thanks and regards
Kish -
Number of options selected in multiple selection
Hi,
I have a multiple selection, how can i get the number of options selected from this multiple selection?
So that i can change CHART width accordingly?
For example, if i choose one option, chart width = 150
if i choose two options, chart width = 300
thanks for the reply.
wcyHi
If your using standard charts then I gues the easy way would be to have multiple charts and make them conditional on INSTR(:P_ITEM, ':') + 1, this would give you the number of items in the string generated by the multi-select list.
If you are building XML in PL/SQL then you could do this dynamically in one chart.
You could also try having hidden item defined as INSTR(:P_ITEM, ':') + 1 and then use the &P_HIDDEN_ITEM. substitution in the chart width field. I have no idea if this would work but you could give it a try.
Cheers
Ben
http://www.munkyben.wordpress.com
Don't forget to mark replies helpful or correct ;) -
How to disable the SELECT-OPTINS multiple selection screen's Ranges options
Hi this is sekhar,
I have used the Select-options: statement with 'No-Interval' option. Now I need to restrict the user not to enter the values in the Ranges column of multiple selection screen. How can I do it....You can also refer this code as below : CHECK OUT SELECT OPTION sel_1_0.
*& Report ZTESTREP
REPORT ztestrep.
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 *** TYPE sscr_***.
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 ***-kind,
'*' TO ***-sg_main,
'NOPATTERN' TO ***-op_main,
'NOINTERVLS' TO ***-op_addy.
APPEND *** TO restrict-***_tab.
KIND = 'B': applies to all SELECT-OPTIONS in block BLOCK_0,
that is, SEL_0_0, SEL_0_1, SEL_0_2
CLEAR ***.
MOVE: 'B' TO ***-kind,
'BLOCK_0' TO ***-name,
'I' TO ***-sg_main,
'*' TO ***-sg_addy,
'NOINTERVLS' TO ***-op_main.
APPEND *** TO restrict-***_tab.
KIND = 'S': applies to SELECT-OPTION SEL-0-2
CLEAR ***.
MOVE: 'S' TO ***-kind,
'SEL_0_2' TO ***-name,
'I' TO ***-sg_main,
'*' TO ***-sg_addy,
'EQ_AND_CP' TO ***-op_main,
'ALL' TO ***-op_addy.
APPEND *** TO restrict-***_tab.
KIND = 'S': Applies to SELECT-OPTION SEL_0_3
CLEAR ***.
MOVE: 'S' TO ***-kind,
'SEL_0_3' TO ***-name,
'I' TO ***-sg_main,
'N' TO ***-sg_addy,
'JUST_EQ' TO ***-op_main.
APPEND *** TO restrict-***_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. -
Single Multiple select option in selection screen
Dear All,
I want to have single multiple selection functionality on the selection screen.I have used function module 'SELECT_OPTIONS_RESTRICT'. but my problem is it only allows to include single vals but does not give me an option to exclude single vals. how should I go about it. If you have some example or piece of code , i would be grateful.
Thanks
AmitHi Amit,
Where have you written this code?
It normally should be in AT SELECTION-SCREEN OUTPUT.
(Infact even in INITIALIZATION, try it out)
Also did you declare SELECT-OPTION with NO INTERVALS addition?
Here is a sample code that works,
REPORT zsritest.
TYPE-POOLS: sscr.
TABLES vbak.
SELECT-OPTIONS: so_vbeln FOR vbak-vbeln NO INTERVALS.
AT SELECTION-SCREEN OUTPUT.
DATA: s_restrict TYPE sscr_restrict,
s_opt_list TYPE sscr_opt_list,
s_*** TYPE sscr_***.
s_opt_list-name = 'EQ_ONLY'.
s_opt_list-options-eq = 'X'.
s_opt_list-options-ne = 'X'.
APPEND s_opt_list TO s_restrict-opt_list_tab.
CLEAR s_***.
s_***-kind = 'S'.
s_***-name = 'SO_VBELN'.
s_***-sg_main = '*'. "This will allow I/E signs
s_***-sg_addy = ' '.
s_***-op_main = 'EQ_ONLY'.
APPEND s_*** TO s_restrict-***_tab.
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
restriction = s_restrict
EXCEPTIONS
OTHERS = 0.
Sri
Message was edited by: Srikanth Pinnamaneni -
Doubt on select-option multiple option.
hi friends,
i have a select option called condition type(so_kschl) declared with no intervals. but not with no-extension so user can enter more than one condition type at a time .
the select statement i have written is
select (some fields) from a004 where kschl in so_kschl.
is this select statement for one value ? or can we use this for multiple selection also ,since there are more than one value in select option do we need to use loop .
any sample code will be of great use ..
thank you
with regards,
gokul.Hi Gokul,
Your statement is correct which can take multiple values for select-options. If will takes single value when specifies both NO-INTERVALS and NO-EXTENSION.
Give some values to the SO_KSCHL in the INITIALIZATION event
<b>INTIALIZATION.</b>
SO_KSCHL-LOW = 'VALUE1'.
APPEND SO_KSCHL.
SO_KSCHL-LOW = 'VALUE2'.
APPEND SO_KSCHL.
SO_KSCHL-LOW = 'VALUE3'.
APPEND SO_KSCHL.
SO_KSCHL-LOW = 'VALUE4'.
APPEND SO_KSCHL.
select (some fields) from a004 where kschl in so_kschl.
Thanks,
Vinay -
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 -
Reading the select options of selection screen
Hi All,
I have a problem in reading the select options from the selection screen.
I have two select-options on the selection screen. Based on the first select-option value, I need to get the F4 values for the second select-option.
I am using the function module 'RS_REFRESH_FROM_SELECTOPTIONS' for getting the select-options values. But here there is small problem.
This FM is returing the values if i select the multiple values. But if I give a single value in the select-options i.e., If i give only the low value, I am getting the blank entries from the function module.
How can I get the value of the select-option if i give only the low field.
Please help me in this regard.
Regards,
Kishore.Hi,
Try to use FM "DYNP_VALUES_READ"
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = i_dynpfields
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.
and after this you can read the internal table i_dynpfields. -
Select-options in SELECT query - syntax error
Hi all,
I get the error below when I try to use the select options in a SELECT query . Please help me.
"The IN operator with "SO_AWART" is followed neither by an internal
table nor by a value list."
The code i have used(Logical database PNP is used):
TABLES: pernr,
catsdb.
INCLUDE ztime_cwtr_top. " global Data
INCLUDE ztime_cwtr_f01.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
SELECT-OPTIONS SO_AWART FOR CATSDB-AWART.
PARAMETERS P_THRES TYPE I.
SELECTION-SCREEN END OF BLOCK B1.
Get data from CATSDB table. Workdates within the date interval are considered.
SELECT pernr workdate awart catsquantity beguz enduz status
FROM catsdb
INTO TABLE it_catsdb
WHERE pernr = pernr-pernr AND
workdate GE pn-begda AND
workdate LE pn-endda AND
status IN ('20', '30') AND
awart IN so_awart .
awart IN ('1100', '1137', '1138', '1139', '1140',
'1147', '1148', '1149', '1157', '2003' ).
when I give the values directly i do not get any syntax error, but when I use select options in the where condition I get the syntax error.
I have tried different options like using only the select-options in the where condition.
Thanks in advance.....
MadhuSolved.
Code with syntax error:
include z...top .
include z...fo1.
select-options: xxxxxxx
Code with no syntax error:
select-options: xxxxxxx
include z...top .
include z...fo1.
Thanks for all your help,
Madhu -
How can i display Value in Report which i select from Multiple select list
Dear All,
i am using multiple select List in form with report page.
When i create new Entry with select Multiple value in Multiple Select List then in report Value display me in below format
my SQL Query are
select NAME D, CODE R from COUNTRY_MAS WHERE ACTIVE_FLG ='Y' order by NAME
AS:AI:AG:AM these are return value .i want to display NAME in report .
How can i do this ?
Thanks
Edited by: Vedant on Apr 25, 2012 11:14 PMShort answer, use the apex_util.string_to_table to convert to a table; then you can either iterate through the table to generate a string of names, or accomplish the same with a bulk operation.
http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_util.htm#CHDFEEJD
Encapsulate all this within a pl/sql function. -
Select option in select list and navigate to different page
Hello,
I have a tabular form.One of the item is a select list with 2 options. Selecting option one should take the user to page10(just an example) and display all the values of that particular row. Similarly selecting option 2 should take the user to page 20 and display all the values of that row.
Can some one guide me how to do above mentioned job.
Thanks in advance.
Pravish@Avinash
if f_cat-seltext_m = 'Select'.
f_cat-col_pos = 1.
f_cat-seltext_l = 'EDIT'.
f_cat-Checkbox = 'X'.
f_cat-EDIT = 'X'.
endif.
I am already passing f_cat-checkbox = 'X'.
Thanks
Kumar.
Maybe you are looking for
-
Strange issue here. I did the update from iOS 6 to iOS 7, after I did the update, I noticed my synced music has just a random photo of the artist / group, that seems to be downloaded from the iTunes sites, because these pictures of the artist/group i
-
I just purchased match to download my itunes music library from my computer to my android phone. How do I do that?
-
I want to install Adobe Reader for an attachment that I cannot open. The Keychain comes up with password. I forgot my password how do I retrieve it?
-
I extended keyword expansion also for TAPI's. The headstart CAPI generator utility and the keyword expansion module were changed such that a revision label is now added to both the TAPI and the CAPI. The revision label added to the TAPI reflects the
-
Problem In finding a collection
Hi Friend, I am having two different ways to get a data value. The data value is mapped with respect to a number or a name. By that I mean a data value can be found out on the basis of name or number. Can anyone suggest a collection or method to impl