Set Default Value In list box
Dear All,
I am using the F4IF_INT_TABLE_VALUE_REQUEST this FM for filling the list box .Now i want to set default value in the list box
Example-
Supose i have 2 List box A & B and in list box i have to set default value in A list box X value and in B list box Y value .
X and Y value is coming in the list box from the master table .
Thanks & Regards
Code Snippet for your referance:
*F4 Help for Output Type
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_KSCHL
DATA: l_repid TYPE syrepid,
l_dynnr TYPE sydynnr.
MOVE: sy-repid TO l_repid,
sy-dynnr TO l_dynnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'KSCHL'
dynpprog = l_repid
dynpnr = l_dynnr
dynprofield = 'P_KSCHL'
window_title = text-001
value_org = 'S'
TABLES
value_tab = it_value_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3
Similar Messages
-
hi,
i need to know how to set default value for a list box in selection screen.Hi
check this code
at selection-screen output.
name = 'P_DATE'.
value-key = '1'.
value-text = 'Today'.
append value to list.
value-key = '2'.
value-text = 'Last 7 days'.
append value to list.
value-key = '3'.
value-text = 'Last 30 days'.
append value to list.
value-key = '4'.
value-text = 'Last 90 days'.
append value to list.
value-key = '5'.
value-text = 'Last year'.
append value to list.
Call the ''VRM_SET_VALUES' to display the values in Listbox
call function 'VRM_SET_VALUES'
exporting
id = name
values = list.
at selection-screen.
if sy-ucomm = 'CLI1'.
sscrfields-ucomm = 'ONLI'(001).
endif.
if p_date = '1'.
p_date11 = sy-datum .
elseif p_date = '2'.
p_date11 = ( sy-datum - 7 ).
elseif p_date = '3'.
p_date11 = ( sy-datum - 30 ).
elseif p_date = '4'.
p_date11 = ( sy-datum - 90 ).
elseif p_date = '5'.
p_date11 = ( sy-datum - 365 ).
endif.
Reward points if useful...
Regards
Sreenivas -
Set Default value in dropdown box.
I used selection= "Default Value" in dropdown box to do this functionality.But when i selected other value it is
selecting the default value and saving also.but i want that page initiated the default value should be there and user can select other values and save.
Please give me solution for that as soon as possible.
Thnks in advance.Actually i m using the following code and it is fetching value from a table.Can u understand this code n provide me solution for default value.
<htmlb:gridLayoutCell columnIndex = "5"
rowIndex = "2"
colSpan = "1"
wrapping = "FALSE"
verticalAlignment = "TOP" >
<htmlb:dropdownListBox id = "unitDropdownListBox"
table = "<%= IT_MSEHI %>"
nameOfKeyColumn = "MSEHI"
nameOfValueColumn = "ZMSEHI"
onSelect = "setunitValue"
disabled = "<%= LV_MODEITEM %>"
selection = "<%= it_item-unit %>" /> -
How can we set default value within html:file
Hai,
To set default value to text box i use the following code. It works well.
<html:text property="modifyserverdesc" value="<%= serverDesc%>" styleClass="text" size="38"/>But for file i use the code
<html:file styleClass="file" property="modifyserverimgfile" value="<%= serverImage%>" size="40"/>It doesn't display value. What is problem here?Hi,
guess that one option in a RowImpl would be to check if the attribute is null or if the attribute value can be found in the VO that populates the list. If first is true or seconds false (cannot be found) you return the first value of the VO, making it the current attribute value
Frank -
Plsss help me: how to set default values in html:file and html:radio
Hai,
To set default value to text box i use the following code. It works well.
<html:text property="modifyserverdesc" value="<%= serverDesc%>" styleClass="text" size="38"/>But for file i use the code
<html:file styleClass="file" property="modifyserverimgfile" value="<%= serverImage%>" size="40"/>It doesn't display value. What is problem here?
how to set default selection in <html:radio>.No it won't help.
You can't set a value into an <input type="file"> control at all. The user has to put values in themselves.
The reason behind this is security. If the programmer could put any value they liked in there, you could upload any file at all from a users computer without their intervention. eg C:\windows\system32\passwords.txt
Bottom line: you can't put a default value into the input type="file" control.
And a good thing too ;-) -
Set Default Value of Multi-select list item
I have a multi-select list item I want to default the value of to '%' (which is really '%null%') and have it selected. I tried setting default value of item, but it doesn't take '%null%'. I also tried a computation with a static of
:P507_ITEM := '%null%'; How do you get the default value set and selected?Hi
Shijesh is right, you need to change your null return value and use that return value as your default. Try and use something of the same datatype as your real return values if you plan to use '%' to display all as it will make your queries simpler. eg.
Company A returns 1
Company B return 2
% returns 0
Then your query would be...
SELECT ...
FROM ...
WHERE company_id = DECODE(:P_COMPANY,1,1,2,2,0,company_id)
Hope this makes sense.
Cheers
Ben -
How to Set default value to dropdown list in oracle ADF
hi,
I need to set default value in the drop down list in oracle ADF.
If you take in HTML :
<select>
<option value="">Select Value </option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
Like this i need to set default value in drop down llist in oracle ADF.
Thanks and Regards,
M. Ramu.Hi Ramu,
Please be more clear on ur post whts ur Jdev version and wht type of dropdown u r using model driven or static list..?????
Its hard to help u without proper info..
Just have a look into this before u post a thread...
https://forums.oracle.com/forums/ann.jspa?annID=56
Regards,
Suganth.G -
Set Default Values in Listbox with Dialog Programming
Hi all,
I am stuck with a problem i.e I am working with Dialog Programming Screen
where i have to set default values in some n numbers of Listbox which i have created on Screen.
This default value is needed to be fetched from database table.
I am using single table. Hence no confusion that i have to first fetch data from 1st listbox then corresponding data is fetched into second & so on ..NO NO This is not required.
Simple one screen which will update a table in database, where some fields on the screen needs to be default set as per tables domain default values set while table creation.
Please help me out in this.
Thanks & Regards,
Sandhya.Please search SDN, before you post a new forum from next time... any ways just follow the below code..
u need to use the FM 'VRM_SET_VALUES' to implement list box in module pool. Check the below code. u have to write this code in PBO..
if c = 0.
select land1 landx from t005t into table wi_country.
sort wi_country by land1.
delete adjacent duplicates from wi_country comparing all fields.
loop at wi_country.
wa_ctry-key = wi_country-land1.
wa_ctry-text = wi_country-landx .
append wa_ctry to wi_ctry.
endloop.
call function 'VRM_SET_VALUES'
exporting
id = 'ZCUST_MASTER1-COUNTRY'
values = wi_ctry
exceptions
id_illegal_name = 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.
c = 1.
endif.
Hope this helps u,
Regards,
Rajesh -
Combobox - set default value; get selected value
Hi!
I have a combobox (h:selectOneMenu) in my application. I put the values in it from a java bean. I would like to set the default value of combo box, but I don't know how.
And I would like to know which value is selected, but I don't know as well.
Please help mt to find the solution of these 2 problems!
Thanks!
rfalir
******************************* JSP ***************************
<h:selectOneMenu id="type" binding="#{myComboBoxValuesBean.myBindingValuesForType}">
<f:selectItems value="#{myComboBoxValuesBean.valuesForType}"/>
</h:selectOneMenu>
***********************************bean***********************************
package bean;
import java.util.HashMap;
import java.util.Map;
import javax.faces.component.html.HtmlSelectOneMenu;
public class ComboBoxValuesBean {
HtmlSelectOneMenu myBindingValuesForType;
Map valuesForType;
// ************************** getter **************************
public HtmlSelectOneMenu getMyBindingValuesForType() {
return myBindingValuesForType;
public Map getValuesForType() {
if (valuesForType == null) {
initValuesForType();
return valuesForType;
// ************************** setter **************************
public void setMyBindingValuesForType(HtmlSelectOneMenu myBindingValuesForType) {
this.myBindingValuesForType = myBindingValuesForType;
public void setValuesForType(Map valuesForType) {
this.valuesForType = valuesForType;
// ************************** others **************************
private void initValuesForType() {
valuesForType = new HashMap();
valuesForType.put("Karakter","C");
valuesForType.put("Sz�m","N");
valuesForType.put("D�tum","D");
}h:selectOneMenu works as following:
JSF<h:selectOneMenu value="#{myBean.selectedItem}">
<f:selectItems value="#{myBean.selectItems}" />
</h:selectOneMenu>MyBeanprivate String selectedItem;
public String getSelectedItem() {
if (selectedItem == null) {
selectedItem = "key2"; // default value;
return selectedItem;
public void setSelectedItem(String selectedItem) {
this.selectedItem = selectedItem;
public List getSelectItems() {
List selectItems = new ArrayList();
selectItems.add(new SelectItem("key1", "value1");
selectItems.add(new SelectItem("key2", "value2");
selectItems.add(new SelectItem("key3", "value3");
return selectItems;
} -
Extending flash: how do I set default values for filenames
Hi,
I am trying to set default values for filenames
<choosefile> and <popupslider>s that will show up when
my XMLpanel first loads in my jsfl extension file. It seems that I
can only set default values for textbox items.
How do I do this for filenames and popups?
As a workaround, I also tried using a flash object dialog box
to look like a <choosefile>, or any jsfl command, but then
how do I return those values back to the XMLpanel that calls them.
and pass the data back to my jsfl script.
lemme know if you know a way,Create two constants for the Allocate Mode input (right click > create > constant). Place one in the true case of the case structure, and place the other one in the false case. Wire them to the same tunnel (border of the case structure), then wire the tunnel to the Allocate Mode terminal of the AO Config. I don't have Traditional DAQ installed, but that should do it.
Misha -
How to set default values in matrix combo
hai everybody.
i want to set default values in a matrix combo box. how to do that
pls.......Hi Priya,
Public Sub comboload1()
Try
ds = oform.DataSources.DBDataSources.Add("OUSR")
oitem = oform.Items.Item("pm7")
omatrix = oitem.Specific
ocolumns = omatrix.Columns
ocolumn = ocolumns.Item("V_2")
ocombo = ocolumn.Cells.Item(r).Specific (r = row number)
LoadEroToCombo1(ocombo)
Catch ex As Exception
oapp.MessageBox(ex.Message)
End Try
End Sub
load to combo function is below
Public Sub LoadEroToCombo1(ByRef ocombo As SAPbouiCOM.ComboBox)
Dim rset As SAPbobsCOM.Recordset
Dim querystring As String
Dim rcount As Long
Dim rindex As Long
Try
rset = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
querystring = "SELECT T0.U_NAME FROM OUSR T0"
rset.DoQuery(querystring)
rcount = rset.RecordCount
rset.MoveFirst()
ocombo.ValidValues.Add("0", "Select")
For rindex = 0 To rcount - 1
ocombo.ValidValues.Add(rset.Fields.Item(0).Value, rindex)
rset.MoveNext()
Next rindex
ocombo.Select("0")
rset = Nothing
System.GC.Collect()
Catch ex As Exception
oapp.MessageBox(ex.Message)
End Try
End Sub
try this code if it helps please reward points
Regards
Cool Ice
Edited by: Cool Ice on Jul 28, 2008 1:43 PM -
Set default value based on sql query?
Hi,
is it possible to set default value of an BC entity attribute by using sql expression?
Eg. "select max(x)+1 from y where userid=?"
Rgs
JernejJernej,
Yes, you can do this. Edit your entity object attribute, and in the Edit Attribute dialog select "Derived from SQL Expression". Then you can enter your expression in the Expression text box.
Blaise -
Set default value for people picker only when user checks a checkbox (Sharepoint 2010)
The javescript in below link works for me.
http://social.technet.microsoft.com/Forums/sharepoint/en-US/2b130f64-3db2-484a-9a53-ccbe18d2c5de/set-default-value-for-people-picker-in-list-template-current-user?forum=sharepointgenerallegacy
However, I'd like to set default user for people picker only when user checks a checkbox.
I am new to development. Could you please help me on this requirement ?
Thank you very much.Hello,
Use this link to to validate checkbox value, if true then set the person or group value (i.e. as posted in your link).
http://geekswithblogs.net/haniamr/archive/2011/03/10/validate-that-a-checkbox-is-checked-using-javascript.aspx
Hope it could help
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
Set default value for product type
I want to set default value in product type drop down box
in component PRD01QR.
view SearchHelp.
I tried with setter and getter , but not working
they are using query string.Hi,
You can achieve this by redefining the method GET_VH_PRODUCT_TYPE() in IMPL class of searchHelp view. Just copy paste the implementation of this method from super class and now control the internal table as per your requirement like
comment out the line APPEND INITIAL LINE TO lt_ddlb. (line no: 47)
as it will add an empty line at the starting of internal of product type values which you dont want. In you case there should be some default value for product type field, so arrange the inetrnal table values according to you requirement and what ever value you want to default for product type that should be the first value in the drop down without empty line and add an empty line at the end of the internal table.
No need to call super->GET_VH_PRODUCT_TYPE() in your implementation as you have written all the required code in your implemenation itself.
Hope this would help you!
Regards,
Ajay -
Pass variable and set default value based on user's group
Hello
I'm using SharePoint 2010 and SQL 2012. I need to send a variable to the page and based on its value, set default value for a drop down list and send it to other web part to filter the data. Is it possible for certain users to send that value as a default
and limit user to see only this value in the text field or drop down list; for others - to allow to see the drop down list, but also set the default value for that list?
The main page was designed in SharePoint designer, using web parts (aspx page). I had setup a connection to Active Directory and already have the code to get user's groups and based on their group, I have that variable pulled into the web page for further
use. But I don't know how to pass that value as a default value to the web part (currently using SharePoint Filter web part). When I tried to set a default value for the web part - it automatically puts the quotation marks around the name of the variable
and shows it as a text instead of showing the value of the field.
Thank you!
P.s. I have limited knowledge of SharePoint and need guidance (links, examples, recommendations)!
Alla SandersThank you for your response. I'll try to give you more details. On PageA I check user's groups and based on the group, assign the value and pass it to the next page (no input from the user, all done behind the scene and user is redirected to PageB).
On the next page I read that value and would like to send it to the SharePoint List Filter Web as a default value, as well as send it to another web part that displays the list from SQL, filtered using that default value. Ideally, if the user is from Group
A, I'd like for them to have only one value in that drop down list; if user is from Group B - give him drop down list with 40 items to choose from. Below there is a part of the code and variable fnum has the value from PageA (if I print the value on the screen
- I do see that it has correct value, so the code that gets groups from Active directory works correctly). If I assign fnum as a default value of the list, it shows "fnum" instead of the value of variable fnum. I connect to SQL database, using external
content - so the other list that I'm filtering based on the value in that drop down list - is XSLT Data View Web part. I also have 2 more filters on that page, that user will have full access to and based on their input, it is also sent to the XSLT web part
to filter out more data. Since one of the filters is the date and I am filtering data starting from the date that user chooses - XSLT is the only web part that I was able to make it work with.
I looked at the link you provided (thank you). It is using Content Query Web part. Will it work with external content, as well as accepting multiple filtering, including custom starting date? I appreciate your help!
<%
string fnum = Request.QueryString["field1"];
%><table cellpadding="4" cellspacing="0" border="0" style="height: 1000px">
<tr>
<td id="_invisibleIfEmpty" name="_invisibleIfEmpty" colspan="2" valign="top" style="height: 101px">
<WebPartPages:WebPartZone runat="server" Title="loc:Header" ID="Header" FrameType="TitleBarOnly"><ZoneTemplate>
<WpNs0:SpListFilterWebPart runat="server" FilterMainControlWidthPixels="0" RequireSelection="False" ExportMode="All" PartImageLarge="/_layouts/images/wp_Filter.gif" AllowHide="False" ShowEmptyValue="True" MissingAssembly="Cannot import this Web Part." AllowClose="False" ID="g_1ccc4bca_3ba1_480b_b726_adfdb1e9e02d" IsIncludedFilter="" DetailLink="" AllowRemove="False" HelpMode="Modeless" AllowEdit="True" ValueFieldGuid="fa564e0f-0c70-4ab9-b863-0177e6ddd247" IsIncluded="True" Description="Filter the contents of web parts by using a list of values from a Office SharePoint Server list." FrameState="Normal" Dir="Default" AllowZoneChange="True" AllowMinimize="False" DefaultValue="fnum" Title="Facilities List Filter" PartOrder="2" ViewGuid="2da5d8db-6b55-4403-80a8-111e42049f8b" FrameType="None" CatalogIconImageUrl="/_layouts/images/wp_Filter.gif" FilterName="Facilities List Filter" HelpLink="" PartImageSmall="/_layouts/images/wp_Filter.gif" AllowConnect="True" DescriptionFieldGuid="2d97730a-cd0d-4cb9-8b55-424951201081" ConnectionID="00000000-0000-0000-0000-000000000000" ExportControlledProperties="True" TitleIconImageUrl="/_layouts/images/wp_Filter.gif" ChromeType="None" SuppressWebPartChrome="False" IsVisible="True" ListUrl="/Lists/FacilitiesList" AllowMultipleSelections="False" ZoneID="Header" __MarkupType="vsattributemarkup" __WebPartId="{768E2035-0461-4A09-8DDD-CA7020C2B23D}" WebPart="true" Height="" Width="615px"></WpNs0:SpListFilterWebPart>
Alla Sanders
Maybe you are looking for
-
Short X1 Carbon 1 month Review (its going back)
The X1 Carbon is a lovely design. Unfortunately it doesn't live up. I got the model before the latest where they messed up the keyboard even more. Its the 3444CUU model loaded with touch, i7, 240gb, 8gb ram. The Good: Price $1500 with 3 year warrany.
-
How to get a color from point in layout?
Hi All, I am trying to find RGB value of a color at a mouse location same as Eye-Dropper tool, I checked some HitTest methods but couldn't figure out which interface will give me color? Any pointers in right direction would be appreciated. Thanks, Pr
-
Payment Requisitions and/ or Invoices?
Hi All, I've a question regarding the Payment Requisitions. First I describe my Contrcat Manager Set up and use: I manage contracts related to projects. I have invoices of committed Contracts and from the Project Subcontrcators,, which I receive and
-
HT1657 in order to watch the dowloaded movied do I need internet connection for it?
in order to watch the dowloaded movied do I need internet connection for it?
-
Delete System/Library/Speech
I'm trying to free disk space on my iBook HD (so I can store photos during a trip). I've never used the speech synthesis or recognition software. The voices take up over 700MB. Is it safe to delete the Speech folder from the system library? I'm sorry