Select-option to restrict to single value
Hi,
I have select-option for company code (i dont want to use parameter) and used no-intervals but it still displays right arrow which will allow users to enter more than one company code. is there any way I can supress this right arrow button.
Regards
Kasi
Say also NO-EXTENSION.
tables: t001.
select-options: s_bukrs for t001-bukrs no intervals no-extension.
Regards,
Rich Heilman
Similar Messages
-
Checking against Select-Options with "CP" using "IF value IN select_option"
Dear experts,
first of all: I'm sorry, if this question already should have been asked and answered!
I tried quite a lot of search terms but didn't find anything helpful.
We are using a statement like "IF value IN select_option" to perform comparisons after the Select-Options have been used in a SELECT statement. This logical expression fails (compared to the results of the DB-SELECT) whenever a select-option line contains the option CP (Contains Pattern). To be more specific: The case sensitivity of the LOW value doesn't seem to play a role any more. A variable with the value 'ABCD' would be positively checked against a select-option with OPTION 'CP' and LOW 'abc*', whereas this value wouldn't have been selected if the select-option had been used in a DB-SELECT.
Does anybody know a workaround?
Thanks in advance
AndreasDear Keshav,
it's an own field in an own table, defined as CHAR of length 140 (lowercase allowed), reflecting to a line of remittance info of an account statement. A regular Select-Option for this field is provided in a report which works perfectly fine regarding the case sensitivity. For reasons I don't want to point out in detail we need to check a value in this field against the select-option without selecting it from the db again.
Let's assume that a field remittance_info contains the value 'ABCD'.
A line of the select-option table looks like this:
select_option_table-SIGN = 'I'
select_option_table-OPTION = 'CP'
select_option_table-LOW = 'abc*'.
Then an ABAP statement such as
IF remittance_info IN select_option_table.
* would be true !!!
ENDIF.
but wouldn't deliver a result in a SELECT such as
SELECT * FROM my_table INTO TABLE my_internal_table WHERE remittance_info IN select_option_table.
because of the differences in lower/upper case.
regards
Andreas -
Unable to handle event --Select-Options as Dropdown filled with Value Set
Hi all,
I seem to be having no luck with this problem. I have searched enough, and not come across any relevant documentation either.
I am using a select options field made as a dropdown and am populating the dropdown values using the Value Set where i can provide a table of key values versus descriptions. Additionaly, I have hidden the standard buttons -- CANCEL, CHECK, RESET, EXECUTE.
This appears exactly like a dropdown, just as desired.
However, no event seems to be triggered whenever I select any value from this dropdown field.
The interface controller of the select-options component offers 5 events and I have tried creating event handlers for all of these; with no success. With no event to track, I am frozen.
I know I may be able to create such a dropdown list without using select-options either; but the point is if this functionality is provided by select-options, there should be a way of using it.
I have browsed through the helper class as well as the interface controller, but am not getting a clue.
The bottomline is, with my current situation, how can i track the on-click or on-change kind of event?
Could anybody melt the ice?
Thanks.I went to the source code of the select-options class (CL_WDR_SELECT_OPTIONS) and found the method where the UI elements are rendered (RENDER_SELECTION_SCREEN_ITEM). In the spot where the DDLB is rendered, there is simply no code to register any events for the DDLB. So it doesn't appear that there is any intention to allow you to handle such events from the DDLB.
=> add the dropdown as dropdownbykey
prefix_id mc_dropdown_id i_field-m_id id.
concatenate i_field-m_id '.VALUE' into path.
lr_dropdown = cl_wd_dropdown_by_key=>new_dropdown_by_key(
id = id
bind_selected_key = path
read_only = i_field-m_read_only
state = state
explanation = i_field-m_explanation
tooltip = i_field-m_tooltip
view = lr_cur_container->view ).
lr_label_low->set_label_for( id ).
lr_matrix_data = cl_wd_matrix_data=>new_matrix_data( element = lr_dropdown width = '1%' ).
lr_dropdown->set_layout_data( lr_matrix_data ).
lr_cur_container->add_child( lr_dropdown ). -
Select options : period restriction
Hi,
I have one select option Inventory period(S_INVPRD) in my selection screen.
I want to restrict the date range to one year period. i.e the user should not be allowed to enter the date range which is more than one year.
Could you please help on this.
Regards,
SankarHi,
Please you the code below :
data : days type i,
year type i.
select-OPTIONS : so_budat for bsis-budat.
at SELECTION-SCREEN.
CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS'
EXPORTING
beg_da = so_budat-low
end_da = so_budat-high
IMPORTING
NO_DAY = days
* NO_MONTH = month
NO_YEAR = year
* NO_CAL_DAY =
* EXCEPTIONS
* DATEINT_ERROR = 1
* OTHERS = 2
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF YEAR > 1.
MESSAGE 'More than One Year' type 'E'.
endif.
if days > 0.
message 'More than one year' type 'E'.
endif.
Thanks,
Sriram Ponna. -
Need a select statement to trim a single value out of a column
I have a column which can and does contain single and multiple values. For instance, there could be a single value, value, or it could look like this value, value, with there being a comma and a space between the two values. I need a select statement that will only and always return the value to the left or in the case of a single value with no comma, just that value. TIA
If your single value has no comma, just the value, then you need an extra DECODE to resolve that case.
SELECT DECODE(INSTR(text,','),0,text,SUBSTR(text,1,INSTR(text,',')-1))
FROM (SELECT 'value1' text
FROM dual
UNION
SELECT 'value2, value3'
TEXT from dual)TTFN
John -
Select-options How to assign Default value as "Not equal to something"
My req. is to asssign default value for a select-option as <> "DS1" . I am able to give default value as DS1 But dont know how to give "<> DS1" . Please help me
Thanking u in advance ..INITIALIZATION.
s_lifnr-low = '0001'.
s_lifnr-high = '0002'.
s_LIFNR-sign = 'I'.
s_lifnr-option = 'NE'.
append s_lifnr.
Regards,
Subramanian V.
P.S. - Raja, still mode = BSP ??? :-P
Message was edited by: Subramanian Venkateswaran -
Read select-options before enter or execute
Hi,
I need to read the contents of a select-options from a dynpro before executing the report or even pressing enter.
The thing is that I need to capture those values in order to show a matchcode based on previous data.
I've used in the past: DYNP_VALUES_READ, but this function works with parameters
Please help!
thanks in advance!!!
FifoChávezYou can do it in this way:
There are three possible ways to provide inputs to SELECT-OPTIONS
1. Enter single value at lower limit
2. Enter single value at lower limit and one at upper limit (range)
3. Enter multiple value for lower limit
To cover all the above scenarios -->
Solution:
Don't worry about third option, as soon as user clicks on EXTEN button to enter single values, select options will get populated automatically. You really need not to read it via FM.
Pass S_DATE-LOW to READ_DYNP and also pass S_DATE-HIGH to READ_DYNP. Based on result what you get from the function module. You can utilize the values.
Thanks,
Naveen Inuganti -
How to get the values of Select-options from the screen.
The value of parameter can be obtained by function module 'DYNP_VALUES_READ' but How to get the values of Select-options from the screen? I want the F4 help values of select-options B depending on the values in Select-option A.So I want to read the Select-option A's value.
Hi,
Refer this following code..this will solve your problem...
"Following code reads value entered in s_po select options and willprovide search
"help for s_item depending upon s_po value.
REPORT TEST.
TABLES : ekpo.
DATA: BEGIN OF itab OCCURS 0,
ebelp LIKE ekpo-ebelp,
END OF itab.
SELECT-OPTIONS s_po FOR ekpo-ebeln.
SELECT-OPTIONS s_item FOR ekpo-ebelp.
INITIALIZATION.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_item-low.
DATA:
dyn_field TYPE dynpread,
temp_fields TYPE TABLE OF dynpread,
zlv_dynpro TYPE syst-repid.
zlv_dynpro = syst-repid.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = zlv_dynpro
dynumb = syst-dynnr
request = 'A'
TABLES
dynpfields = temp_fields
EXCEPTIONS
OTHERS = 0.
LOOP AT temp_fields INTO dyn_field.
IF dyn_field-fieldname EQ 'S_PO-LOW'.
SELECT * INTO CORRESPONDING fields OF TABLE itab FROM ekpo
WHERE ebeln EQ dyn_field-fieldvalue.
EXIT.
ENDIF.
ENDLOOP. -
Values of select-options lost in tabbed screen when in batch mode
Hi,
I have a very strange problem. When I run the following program in online mode (with values given for s_time1-low, s_time1-high and p_time1 on the second tab), everything is fine and the values given for s_time1 and p_time1 are printed. However, if I run the program in background (batch mode), the values s_time1-low and s_time1-high are initial and this is what is printed out.
Does anyone have a clue what could be the reason for this behavior? Any help is much appreciated!
Best regards,
Michael.
Demo-Program:
REPORT zdemo.
SELECTION-SCREEN: BEGIN OF TABBED BLOCK maintab FOR 26 LINES,
TAB (20) button1 USER-COMMAND pushmain DEFAULT SCREEN 100,
TAB (20) button2 USER-COMMAND pushtime DEFAULT SCREEN 200,
END OF BLOCK maintab.
*********** MAIN SCREEN (100) ***********
SELECTION-SCREEN: BEGIN OF SCREEN 100 AS SUBSCREEN.
PARAMETERS: p_test TYPE i DEFAULT 10000.
SELECTION-SCREEN: END OF SCREEN 100.
*********** TIMEFRAME SCREEN (200) ***********
SELECTION-SCREEN: BEGIN OF SCREEN 200 AS SUBSCREEN.
SELECT-OPTIONS: s_time1 FOR sy-timlo NO-EXTENSION.
PARAMETERS: p_time1 AS CHECKBOX DEFAULT ' '.
SELECTION-SCREEN: END OF SCREEN 200.
START-OF-SELECTION.
WRITE:/ 's_time1-low:', s_time1-low.
WRITE:/ 's_time1-high:', s_time1-high.
WRITE:/ 'p_time1:', p_time1.Hi,
I played around with the code a little bit: When I load a variant containing data for both tab strips and I do not click on the second tabstrip and run the program then in online mode, se values for s_time1 are also missing. It seems that SELECT-OPTIONS are only initialized with values when the user activated the tab. Strange enough that this does not hold for normal PARAMETERS where the values are alway initialized.
Unfortunately, I did not find a solution for this problem yet.
Help is appreciated very much!
Regards,
Michael. -
Passing value to select options screen.
Hi All,
Can anybody help me how to pass a value to select option screen from another screen?
It's like a user enters a value in a input field and press a button to navigate to the next screen which contains the select option fields.How can i show the value enterd in the previous screen to be shown in one of teh input field in the select option screen.Hi,
Store the values that you have to pass in a global variable declared in component controller and
Use the following piece of code in the second view,
DATA: lt_range_table TYPE REF TO data,
rt_range_table TYPE REF TO data,
read_only TYPE abap_bool,
typename TYPE string.
* create a range table that consists of this new data element
lt_range_table = lo_r_helper_class->create_range_table( i_typename = 'MATNR' ).
FIELD-SYMBOLS: <tab> TYPE INDEX TABLE,
<struct> TYPE ANY,
<wa> TYPE ANY,
<option> TYPE char2,
<sign> TYPE char1,
<high> TYPE ANY,
<low> TYPE ANY,
<wa_values> TYPE ANY.
ASSIGN lt_range_table->* TO <tab>.
APPEND INITIAL LINE TO <tab> ASSIGNING <wa>.
ASSIGN COMPONENT 'OPTION' OF STRUCTURE <wa> TO <option>.
ASSIGN COMPONENT 'HIGH' OF STRUCTURE <wa> TO <high>.
ASSIGN COMPONENT 'LOW' OF STRUCTURE <wa> TO <low>.
ASSIGN COMPONENT 'SIGN' OF STRUCTURE <wa> TO <sign>.
<sign> = 'I'. "Default sign which you want to give
<option> = 'EQ'. "Default option you want to give
<low> = 'M-01'." pass your valriable name here
*<high> = 'High_value'.
* add a new field to the selection
lo_r_helper_class->add_selection_field( i_id = 'S_MATNR'
i_description = 'Material'
it_result = lt_range_table ).
Regards,
Radhika. -
How to assign select-option values to internal table
hi all,
how to assign select-option values to internal table
thanks in advance.Hi,
You just need to loop at your select-option field and take the values from low and high fields.
for. e.g
loop at s_werks .
move:s_werks-low to <your itab>
if not s_werks-high is initial .
move: s_werks-high to <youritab>
endif .
append <your itab>
endloop .
OR use select statement.
regards,
Omkar.
Message was edited by:
Omkaram Yanamala
Message was edited by:
Omkaram Yanamala -
How to prevent the use of wild cards in select-option
Hello experts,
Is it possible to prevent the use of wild cards in a select-option? If yes, how is it done please?
I have a
SELECT-OPTIONS: o_comp FOR dbtab-field OBLIGATORY DEFAULT 'FI'.
and, I want to prevent the users for giving in some thing like FI* with the wildcard bc it would lead to dump.
I want an error message to display and prevent the users for making such entry.
Please I need your help and I would be very grateful.
Thanks
NadinYou have to use SELECT_OPTIONS_RESTRICT to restrict input allowed. Call this FM in INITIALIZATION or SELECTION-SCREEN OUPUT sections.
Sample :
TYPE-POOLS: sscr.
INITIALIZATION.
* Restrict SELECT-OPTIONS
PERFORM restrict_select.
FORM restrict_select.
DATA: restrict TYPE sscr_restrict,
opt_list TYPE sscr_opt_list,
*** TYPE sscr_***.
* Défine select-options modes (aka option list)
* - ALL standard - all options allowed
CLEAR opt_list.
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.
* - EQU only equality allowed (list of values)
CLEAR opt_list.
MOVE 'EQU' TO opt_list-name.
MOVE 'X' TO opt_list-options-eq.
APPEND opt_list TO restrict-opt_list_tab.
* Affect modes to parameters or block of parameters
* ALL by default
CLEAR ***.
MOVE: 'A' TO ***-kind,
'*' TO ***-sg_main,
'ALL' TO ***-op_main.
APPEND *** TO restrict-***_tab.
* EQU to internal material number
CLEAR ***.
MOVE: 'S' TO ***-kind,
'S-MATNR' TO ***-name,
'I' TO ***-sg_main, " no exclusion
'EQU' TO ***-op_main. " only value list
APPEND *** TO restrict-***_tab.
* Call FM
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
restriction = restrict
EXCEPTIONS
OTHERS = 1.
ENDFORM. " restrict_select
In the sample, only select-options for matnr is restricted to single value list.
For your request build a mode with all options except "pattern" ones : CP and NP.
Regards -
How can we Restict the Char single value Variables with , , =
Hi Experts,
How can we Restict the Char value Variables with <, >, <= (without selecting Inverval or only passing single value)
For Example
We have a standard Query 0FIAR_C03_Q1005, in this
New Selection
"1 - 15 Days, Posting Date<=Key Date, Clearing Date>Key Date"
This is restricted with the
Clearing(0CLEAR_DATE)
<Clearing key date(0P_KEYD3) It is a single value SAP Exit Varible
PostingDate(0PSTNG_DATE)
<= Posting keydate(0P_KEYD3) It is a single value SAP Exit Varible
When seeing these 0P_KEYD3, 0P_KEYD3 variables in the New selection screen they looks like >0P_KEYD3, <=0PSTNG_DATE
if you define any custom variables these are looks like =ZV_DATE.
to enable < , >, <= symbols for variables what we need to do.
In other way
Say we created one variable ZV_DATE single value, processing type as customer exit.
for this we populated current day,
Now Requirement is we need to display the all the records which are <= current date,
instead of passing low and high values, i want to restrict the calday <=ZV_DATE
New selection
0calday
<=ZV_DATE
How can we achive this, this is how the business content report having the restrictions
Please sugget me.
Thanks
Chandra
Edited by: Chandra Gandla on Jun 18, 2010 11:01 AM
Edited by: Chandra Gandla on Jun 18, 2010 11:01 AMOk,
In the InfoObject 0calday in the query designer under the filter area, under characteristic restrictions right-click over that InfoObject (0calday).
In the next window (select Values for [0CALDAY] Calendar Day in the dropdown box for "Show" choose Value Ranges. Under the word "Between" dropdown box select "Less than or equal to"
Below that word click on the button of the dropdown box Select from list.
In the new window select instead of History Variables and double-click on your variable ZV_DATE.
Click on the right blue arrow to move it to the right.
And there you go.
Tip: It exists a SAP standard variable named 0DAT which is exactly the current date (don't need to use ZV_DATE variable).
Diogo. -
Select-options and Parameters, when to use what?
Hi gurus,
I have been using Parameters for long. Now I want to choose a range of values, which I need to retrieve from database.
I tried using select-options. Can't I use 2 parameters that is parameter1 and parameter2 and mention query BETWEEN para1 AND
para2, and when I use NO INTERVALS and NO EXTENSION together, it behaves same like parameter, then why did SAP gave these
extensions.Hi friend,
Simple differences between Select-options and parameters.
Select-Options Uses keyword 'for'
Parameters Uses keywords 'like', 'type'
Select-Options Uses operator 'in'
Parameters Uses operator '='
Select-Options Provides ranges for selection
Parameters No ranges only single value
Select-Options Creates selection table
Parameters No selection table
Select-Options When i/p blank all records selected
Parameters When i/p blank none is selected
Note:
Select options can act as parameters by using 'no-extension' 'no intervals', but all records will be selected when i/p is blank unlike parameters.
Might be helpful..
Thanks...
Edited by: Guest77 on Feb 10, 2009 5:44 AM -
Validation of Select Options for a field
Hi All,
I need to write a validation logic for a select option for VTWEG (Distribution Channel).
select-options: s_vtweg for komg-vtweg.
I need to check whether the user has entered the correct value based on the search help. The check table of this particular field is TVTW.
Following is the code i wrote under the AT SELECTION-SCREEN block:
IF NOT S_VTWEG-LOW IS INITIAL.
SELECT SINGLE VTWEG INTO KOMG-VTWEG FROM TVTW
WHERE VTWEG IN S_VTWEG.
IF SY-SUBRC NE 0.
CONCATENATE ' Please enter the correct
Distribution Channel '
Z_MSG INTO Z_MSG.
SET CURSOR FIELD 'S_VTWEG-LOW'.
MESSAGE E000 WITH Z_MSG.
ENDIF.
ENDIF.
It works fine when the user enters a wrong value in the S_VTWEG-LOW field, where as if i gives more than one wrong value in the range or giving individual values its not working. Let me know how to do the validation check for multiple values entered individually or in ranges.
Could you please suggest how to resolve this problem.
Thank You,
SureshYou could do something like this.....here looping at the select-option table and check the values for low and high.
report zrich_0003.
tables: komg.
data: z_msg(100) type c.
select-options: s_vtweg for komg-vtweg.
at selection-screen.
loop at s_vtweg.
if not s_vtweg-low is initial.
select single vtweg into komg-vtweg from tvtw
where vtweg = s_vtweg-low.
if sy-subrc ne 0.
concatenate ' Please enter the correct
distribution channel '
z_msg into z_msg.
set cursor field 'S_VTWEG-LOW'.
message e001(00) with z_msg.
endif.
endif.
if not s_vtweg-high is initial.
select single vtweg into komg-vtweg from tvtw
where vtweg = s_vtweg-high.
if sy-subrc ne 0.
concatenate ' Please enter the correct
distribution channel '
z_msg into z_msg.
set cursor field 'S_VTWEG-HIGH'.
message e001(00) with z_msg.
endif.
endif.
endloop.
Regards,
Rich Heilman
Maybe you are looking for
-
Dear All, In my company there is finished material which is having both purchase & sale,when i m doing return to vendor through movt type 161,part1 & part2 is not updated.if we do J1IS through ref of matrl doc for cancelling excise invoice will the r
-
Removing 'i' from swf skins???
I know I can remove the exit button from swf skins, but what about the info button? also, is there a way to have a 'on' state for a button, so when the cc button is clicked it stays highlighted? Can I build this in flash and have my custom skin show
-
Reply all when CC List Truncated
Hi, Some of us in our organization noticed that if there are more than 32 cc: addresses on a message received, that a reply-to-all message would only go to those 32 addresses (plus whomever was in the To: fields), and none of the original recipients
-
VMware problem for Ecc 6.0 nd BI
Hi I have installed ecc 6.0 on windows 2003 and i installed one vmware where I installed BI . now i took IP of the ecc 6.0 and connected on other system. How to connect Bi on other system. thnks in advance
-
G'day all. I am wondering what are options available in SAP if we'd like to put additional user restriction base on organisation structure. I know the structural authorization but if we don't have HR module, what sort of options available in the sta