Retrieving Allowed Values of a property.
Hi,
I created a custom property and have like 5 or 6 values assigned to it.
From the API, as mentioned below, I could only find a way to get these values if they are set to a resource and if the property is a multi-valued.
String namespace = "http://com.sap.netweaver.bc.rf.sample/xmlns/sample";
String name = "property";
IPropertyName propertyName = new PropertyName(namespace, name);
IProperty property = resource.getProperty(propertyName);
if( property.isMultivalued() ) {
// property is multi valued
List values = property.getValues();
If the property is not Multi-Valued and not set to a resource, is there any way to retrieve all the "Allowed Values" for that particular property.
I appreciate if anyone can throw some light on it.
Thanks,
Ravi.
You might not need all this code (depending on what you are doing, and what items you may already have),
the part relevant to fething the allowed values is at the bottom:
IResource fileresource=//however you're getting it.
IPropertyConfigurationService propConfigService = (IPropertyConfigurationService) ResourceFactory.getInstance().getServiceFactory().getService(
"PropertyConfigurationService");
IMetaModel mm = propConfigService.getMetaModel();
metaContext = mm.createEmptyMetaContext();
metaContext.setResource(fileresource);
metaContext.setResourceContext(fileresource.getContext());
IMutablePropertyMap propertymap = fileresource.getProperties().getMutable();
metaContext.setPropertyMap(propertymap);
propName = new PropertyName("yourNamespace", "yourPropertyName");
IMetaName metaname = propConfigService.getMetaModel().searchByPropertyName(propName);
IMetaValueListIterator iml = metaname.allowedValueIterator( metaContext );
while (iml.hasNext()) {
IMetaValue vl = iml.next();
String myvalue = vl.getValue();
//... do something with it
[email protected]
Similar Messages
-
How to get all the allowed values of a property?
Hi all,
I want to read all the allowed values of a property. I have created a new custom property and given 3 values as allowed values.
What i want to do is programtically read all the allowed values of that particular property.
Regards
RajeevHi guys,
I'm trying to do exactly the same, i need a list with all the KM properties, i'm using the very same code thar Romano putted on his post, and i'm getting this:
InitialConfigException: The configuration service locator could not be initialized for any of the environments. The configuration framework is not available.#
On this sentence:
IConfigurationAccess icAccess = Configuration.getInstance();
I'm developing a Webdynpro application on server A and i'm using the KM libraries through an EJB inside a Webservice on server B.
Do you have any suggestions?
Thanks in advance -
Retrieving ALL values from a single restricted user property
How can I retrieve ALL values of a single restricted user property from within
a .jpf file?
I want to display a dropdown list within a form in a JSP which should contain
all the locations listed in the property 'locations'. I ever get just the default
value when I access the property via
ProfileWrapper pw = userprofile.getProfileForUser(user);
Object prop = pw.getProperty("ClockSetup", "Locations");Well, the code you've got will retrieve the single value of the property
for the current user. You're getting the default value because the
current user doesn't have Locations property set, so the ProfileWrapper
returns the default value from the property set.
I assume you want to get the list of available values that you entered
into the .usr file in Workshop. If so, I've attached a
SetColorController.jpf, index.jsp, and GeneralInfo.usr (put in
META-INF/data/userprofiles) I wrote for an example that does just this.
It uses the PropertySetManagerControl to retrieve the restricted values
for a property, and the jsp uses data-binding to create a list from that
pageflow method.
For a just-jsps solution, you can also use the
<ps:getRestrictedPropertyValues/> tag. I've attached a setcolor-tags.jsp
that does the same thing.
Greg
Dirk wrote:
How can I retrieve ALL values of a single restricted user property from within
a .jpf file?
I want to display a dropdown list within a form in a JSP which should contain
all the locations listed in the property 'locations'. I ever get just the default
value when I access the property via
ProfileWrapper pw = userprofile.getProfileForUser(user);
Object prop = pw.getProperty("ClockSetup", "Locations");
[att1.html]
package users.setcolor;
import com.bea.p13n.controls.exceptions.P13nControlException;
import com.bea.p13n.property.PropertyDefinition;
import com.bea.p13n.property.PropertySet;
import com.bea.p13n.usermgmt.profile.ProfileWrapper;
import com.bea.wlw.netui.pageflow.FormData;
import com.bea.wlw.netui.pageflow.Forward;
import com.bea.wlw.netui.pageflow.PageFlowController;
import java.util.Collection;
import java.util.Iterator;
* @jpf:controller
* @jpf:view-properties view-properties::
* <!-- This data is auto-generated. Hand-editing this section is not recommended. -->
* <view-properties>
* <pageflow-object id="pageflow:/users/setcolor/SetColorController.jpf"/>
* <pageflow-object id="action:begin.do">
* <property value="80" name="x"/>
* <property value="100" name="y"/>
* </pageflow-object>
* <pageflow-object id="action:setColor.do#users.setcolor.SetColorController.ColorFormBean">
* <property value="240" name="x"/>
* <property value="220" name="y"/>
* </pageflow-object>
* <pageflow-object id="action-call:@page:index.jsp@#@action:setColor.do#users.setcolor.SetColorController.ColorFormBean@">
* <property value="240,240,240,240" name="elbowsX"/>
* <property value="144,160,160,176" name="elbowsY"/>
* <property value="South_1" name="fromPort"/>
* <property value="North_1" name="toPort"/>
* </pageflow-object>
* <pageflow-object id="page:index.jsp">
* <property value="240" name="x"/>
* <property value="100" name="y"/>
* </pageflow-object>
* <pageflow-object id="forward:path#success#index.jsp#@action:begin.do@">
* <property value="116,160,160,204" name="elbowsX"/>
* <property value="92,92,92,92" name="elbowsY"/>
* <property value="East_1" name="fromPort"/>
* <property value="West_1" name="toPort"/>
* <property value="success" name="label"/>
* </pageflow-object>
* <pageflow-object id="forward:path#success#begin.do#@action:setColor.do#users.setcolor.SetColorController.ColorFormBean@">
* <property value="204,160,160,116" name="elbowsX"/>
* <property value="201,201,103,103" name="elbowsY"/>
* <property value="West_0" name="fromPort"/>
* <property value="East_2" name="toPort"/>
* <property value="success" name="label"/>
* </pageflow-object>
* <pageflow-object id="control:com.bea.p13n.controls.ejb.property.PropertySetManager#propSetMgr">
* <property value="31" name="x"/>
* <property value="34" name="y"/>
* </pageflow-object>
* <pageflow-object id="control:com.bea.p13n.controls.profile.UserProfileControl#profileControl">
* <property value="37" name="x"/>
* <property value="34" name="y"/>
* </pageflow-object>
* <pageflow-object id="formbeanprop:users.setcolor.SetColorController.ColorFormBean#color#java.lang.String"/>
* <pageflow-object id="formbean:users.setcolor.SetColorController.ColorFormBean"/>
* </view-properties>
public class SetColorController extends PageFlowController
* @common:control
private com.bea.p13n.controls.ejb.property.PropertySetManager propSetMgr;
* @common:control
private com.bea.p13n.controls.profile.UserProfileControl profileControl;
/** Cached possible colors from the User Profile Property Set definition.
private String[] possibleColors = null;
/** Get the possible colors, based upon the User Profile Property Set.
public String[] getPossibleColors()
if (possibleColors != null)
return possibleColors;
try
PropertySet ps = propSetMgr.getPropertySet("USER", "GeneralInfo");
PropertyDefinition pd = ps.getPropertyDefinition("FavoriteColor");
Collection l = pd.getRestrictedValues();
String[] s = new String[l.size()];
Iterator it = l.iterator();
for (int i = 0; it.hasNext(); i++)
s[i] = it.next().toString();
possibleColors = s;
catch (P13nControlException ex)
ex.printStackTrace();
possibleColors = new String[0];
return possibleColors;
/** Get the user's favorite color from their profile.
public String getUsersColor()
try
ProfileWrapper profile = profileControl.getProfileFromRequest(getRequest());
return profileControl.getProperty(profile, "GeneralInfo", "FavoriteColor").toString();
catch (P13nControlException ex)
ex.printStackTrace();
return null;
// Uncomment this declaration to access Global.app.
// protected global.Global globalApp;
// For an example of page flow exception handling see the example "catch" and "exception-handler"
// annotations in {project}/WEB-INF/src/global/Global.app
* This method represents the point of entry into the pageflow
* @jpf:action
* @jpf:forward name="success" path="index.jsp"
protected Forward begin()
return new Forward("success");
* @jpf:action
* @jpf:forward name="success" path="begin.do"
protected Forward setColor(ColorFormBean form)
// set the color in the user's profile
try
ProfileWrapper profile = profileControl.getProfileFromRequest(getRequest());
profileControl.setProperty(profile, "GeneralInfo", "FavoriteColor", form.getColor());
catch (P13nControlException ex)
ex.printStackTrace();
return new Forward("success");
* FormData get and set methods may be overwritten by the Form Bean editor.
public static class ColorFormBean extends FormData
private String color;
public void setColor(String color)
this.color = color;
public String getColor()
return this.color;
[GeneralInfo.usr]
[att1.html] -
Is it possible to change Allowed Values (csv) in a property through an API?
Hi everyone
I would like to enable end users to change the Allowed Values (csv) in a property without giving them access to the system administration > system configuration part of the portal. Actually I would like to create a simple iview which could show the list from the Allowed Values (csv) entry of a specific property and let certain users maintain the values from that iview instead of through system administration.
Do any of you know if its possible to develop this in some way? We have not been able to identify possible ways to change the Allowed Values (csv) entry through the KM API.
Any help will be awarded.
Best regards,
Martin SøgaardHi Martin,
This is possible..
try out below code..
public void onActionUpdateProperty(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionUpdateProperty(ServerEvent)
String strPropName = wdContext.currentContextElement().getPropertyName();
String strCurrentProp = wdContext.currentContextElement().getCurrentProp();
String strSelectedProp = wdContext.currentContextElement().getSelectedProp();
String namespace = "";
boolean isNotSaved = false;
//isPropertySaved = true;
com.sapportals.wcm.service.propertyconfig.IMetaModel metaModel = null;
// IPropertyConfigurationService configService=null;
IMutableConfigurable imConf = null;
try
IConfigurationAccess icAccess = Configuration.getInstance();
IWDClientUser wdcu = WDClientUser.getCurrentUser();
com.sap.security.api.IUser sapUser = wdcu.getSAPUser();
IUser user = WPUMFactory.getUserFactory().getEP5User(sapUser);
IConfigClientContext confContext = IConfigClientContext.createContext(user);
IConfigManager icManager = icAccess.getConfigManager(confContext);
IConfigPlugin icPlugin = icManager.getConfigPlugin(ConfigurationProxy.CFG_PLUGIN_CM_SERVICES_PROPERTIES_METADATA);
IMutableConfigurable[] mcs = icPlugin.getConfigurables();
String propertyUniqueID = "";
String propertyNameSpace = "";
for (int i = 0; i < mcs.length; i++) {
IMutableConfigurable mc = mcs<i>;
if (mc.getPropertyValue("property_id").equals(strSelectedProp)) {
propertyUniqueID = mc.getPropertyValue("unique_id");
break;
try {
imConf = icPlugin.getAndLockConfigurable(propertyUniqueID, 0, 0);
imConf.setPropertyValue("values",<b>strCurrentProp</b>);
} catch (RuntimeException e1) {
e1.printStackTrace();
icPlugin.replaceConfigurable(imConf);
catch (Exception e)
wdComponentAPI.getMessageManager().reportException(e.getLocalizedMessage(), false);
finally
if (imConf != null)
try
imConf.unlock();
catch (LockConfigException e)
wdComponentAPI.getMessageManager().reportException(e.getLocalizedMessage(), false);
//@@end
strCurrentProp is the value that is being set.
Regards,
Vikas -
How to get all possible values of a property
I have a single-valued restricted property which has a number of predefined values.
I want to be able to get all of these values to use to populate a drop down list in my portlet.
Does anyone know how I can do this?Hello Angela,
Here is an example portlet that I wrote for WLPS 2.0. It should work for WLPS 3.1 also, but it
didn't verify it on 3.1 yet. The key is that you have to use the SchemaManager to get a Schema
which will allow you to get get PropertyMetaData. See the javadoc for more information.
Here you go:
<%-- This JSP page lists the restricted values for a multiple restricted property --%>
<%@ page import="java.util.*" %>
<%@ page import="com.beasys.commerce.axiom.util.helper.JNDIHelper,
com.beasys.commerce.foundation.property.SchemaManagerHome,
com.beasys.commerce.foundation.property.SchemaManager,
com.beasys.commerce.foundation.property.Schema,
com.beasys.commerce.foundation.property.SchemaManagerConstants,
com.beasys.commerce.foundation.property.PropertyMetaData,
com.beasys.commerce.axiom.util.ToolkitException,
java.rmi.RemoteException,
javax.ejb.CreateException" %>
<%@ page extends="com.beasys.commerce.axiom.jsp.JspBase" %>
<%
I used the admin tool to create a "test" property set with
a multiple, restricted text property called "restrictedWords". The
allowable values are "how", "now", "brown", "cow". I selected one
default value ("brown").
SchemaManagerHome smh = null;
try
smh = (SchemaManagerHome) JNDIHelper.getHome("com.beasys.commerce.foundation.property.SchemaManager");
catch (ToolkitException e)
e.printStackTrace();
PropertyMetaData metaData = null;
try
SchemaManager sm = smh.create();
// Get the schema for the user/group property set called "test"
Schema schema = sm.getSchema("test", SchemaManagerConstants.USER_TYPE);
// Get the meta data for the "restrictedWords" property
metaData = schema.getPropertyMetaData("restrictedWords");
catch (CreateException e)
e.printStackTrace();
catch (RemoteException e)
e.printStackTrace();
Collection restrictedValues = metaData.getRestrictedValues();
Iterator restrictedIter = restrictedValues.iterator();
while (restrictedIter.hasNext())
out.println("<br>restricted value is: " + restrictedIter.next());
%>
Ture Hoefner
BEA Systems, Inc.
2590 Pearl St.
Suite 110
Boulder, CO 80302
www.bea.com
[att1.html] -
How to retrieve multilpe values stored in driectory entry
Hi all,
I have managed to add an entry which containing multiple values for an attribute to the OiD. I am also able to retrieve those values using Sun's JNDI API's. The problem is when i am retrieving duplicate values in the entry. The Attributes.get() returns only the distinct values.
The Attribute definition is
attributetypes: ( 2.1.5.5.2.8.3.3.5.3 NAME 'employeeSpecialAllowance' DESC 'Employee Special Allowance' ORDERING numericStringMatch SYNTAX '1.3.6.1.4.1.1466.115.121.1.36' USAGE userApplications )
The duplicate values what i mean here is, suppose if the attribute has values like
employeeSpecialAllowance: 1000
employeeSpecialAllowance: 2000
employeeSpecialAllowance: 1000
employeeSpecialAllowance: 3000
The Attributes.getAll() retrieves only 1000,2000 and 3000. The second instance of 1000 is not retrieved. The attributes were created specifying its ordered type set to true like this
attr = new BasicAttribute("employeeSpecialAllowance",10000,true);
Can anybody provide me an insight into this?
Thanks in advance,
CheekaThe Attributes.get method in JNDI does not support this. That is why you are only able to fetch non-unique values. It is not a problem with OiD.
-
Re: [iPlanet-JATO] Re: Retrieving all Values from a Tiled View
Todd,
Let me try to explain you this time. I have a text field in a TiledViewBean.
When I display the page, the text field
html tag is created with the name="PageDetail.rDetail[0].tbFieldName" say
five times/rows with same name.
The html tags look like this.
<input type=text name="PageDetail.rDetail[0].tbFieldName" value=""
maxlength=9 size=13>
<input type=text name="PageDetail.rDetail[0].tbFieldName" value=""
maxlength=9 size=13>
<input type=text name="PageDetail.rDetail[0].tbFieldName" value=""
maxlength=9 size=13>
When the form is submitted, I want to get the text field values using the
method getTbFieldName().getValues() which
returns an array object[]. This is in case where my TiledViewBean is not
bound and it is working fine.
Now in case when my TiledView is bound to a model, it creates the html tags
as follows.
<input type=text name="PageDetail.rDetail[0].tbFieldName" value=""
maxlength=9 size=13>
<input type=text name="PageDetail.rDetail[1].tbFieldName" value=""
maxlength=9 size=13>
<input type=text name="PageDetail.rDetail[2].tbFieldName" value=""
maxlength=9 size=13>
Now when I say getTbFieldName().getValues() it returns only the first
element values in the object[] and the rest of the
values are null.
May be we need to create a utility method do get these values from
requestContext.
raju.
----- Original Message -----
From: Todd Fast <toddwork@c...>
Sent: Saturday, July 07, 2001 3:52 AM
Subject: Re: [iPlanet-JATO] Re: Retrieving all Values from a Tiled View
Raju.--
I wanted to know how the getValues() method works the reason being,
when the tiled view is NOT bound to a model, it populates all the
fields with the same name as some thing likeI'm afraid I don't understand your point--can you please clarify? Do you
mean "value" instead of "name"?
What are you trying to do? What behavior are you expecting but notseeing?
>
Without further clarification, I can say that the setValues() methodsNEVER
populates data on multiple rows of a (dataset) model, nor does it affect
multiple fields on the same row. Perhaps what you are seeing is theeffect
of default values. Model that derive from DefaulModel have the ability to
carry forward the values set on the first row to other rows in lieu ofdata
in those other rows. This behavior is for pure convenience and can be
turned off, and it is turned off for the SQL-based models.
Todd
[email protected]Hi,
I wanted to know how the getValues() method works the reason being,
when the tiled view is NOT bound to a model, it populates all the
fields with the same name as some thing like
PageDetail.rDetail[0].tbFieldValue
PageDetail.rDetail[0].tbFieldValue
in which case, the getValues() method works fine.
But in case where the tiled view is bound to a model, it populates
with different field names such as,
PageDetail.rDetail[0].tbFieldValue
PageDetail.rDetail[1].tbFieldValue
in this case, the getValues() doesn't work. Any soultion to this?
We are using Moko 1.1.1.
thanks in advance,
raju.
--- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
Does anyone know of is there a single method to get all values of a
display
field in a tiled view without having to iterate through all the
values ie
resetTileIndex() / nextTile() approach.
ie Something that returns an Object[] or Vector just like ND returned a
CspVector. I tried using the getValues() methods but that allways returns
a
single element array containing the first element.
(I think now, that method is used for multi selecteable ListBoxes)Actually, no. We can add this in the next patch, but for now, I'd recommend
creating a simple utility method to do the iteration on an arbitrary model
and build the list for you.
Todd -
How can i get the all values from the Property file to Hashtable?
how can i get the all values from the Property file to Hashtable?
ok,consider my property file name is pro.PROPERTIES
and it contain
8326=sun developer
4306=sun java developer
3943=java developer
how can i get the all keys & values from the pro.PROPERTIES to hashtable
plz help guys..............The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
InputStream is = new FileInputStream("tivoli.properties");
props.load(is); -
I am getting the following error with IE9 and Firefox 26 with application express 3.2:
SCRIPT5007: Unable to get value of the property 'nodeName': object is null or undefined
apex_ns_3_1.js, line 589 character 10
this.dialog.check2 = function (e){
var tPar = html_GetTarget(e);
var lEl = $x('apexir_col_values_drop');
var l_Test = true;
****** while(tPar.nodeName != 'BODY'){
tPar = tPar.parentNode;
if(tPar == lEl){l_Test = false;}
if(l_Test){$x_Remove('apexir_col_values_drop')}
This happens when I click the Gear Icon, then Filter, then I click the dropdown arrow under expressions and pick an expression from the list.
If I set (through IE Developer tools) back to IE8 mode, I don't get the error.Guess no one is using 3.2 any longer or no one else gets this error..... Guess I can edit the JavaScript file to trap the error since it really doesn't seem to cause an issue. Just didn't want to have to go that route.
-
How to retrieve 2 values from a table in a LOV
Hi
I'm pretty new to APEX. I try to retrieve two values from a table using a LOV. I have a table named DEBIT with then columns SITE, NAME and KEY
I want to display NAME to the user in a list. When the user select an item from the list, I want to retrieve the data of the SITE and KEY column of this item in order to launch an SQL command based on this two values.
How to retrieve thes two values whant the user chooses an item from the list ?
I apologize for my english, being french.
Regards.
ChristianChristian,
From what I understood about your requirement, you want a 'select list with submit' which displays "NAME" and based on the value selected, you want to get the corresponding values for "SITE" and "KEY" from the table.
<b>Step 1: Create a select list with submit, say P1_MYSELECT </b><br><br>
Use something like this in the dynamic list of values for the select list: <br>
SELECT NAME display_value, NAME return_value
FROM DEBIT<br><br>
<b>Step 2: Create a page process of type PL/SQL block. Also create 2 hidden items P1_KEY and P1_SITE. </b><br><br>
In the PL/sQL, write something like:
DECLARE
v_key DEBIT.KEY%TYPE;
v_site DEBIT.SITE%TYPE;
CURSOR v_cur_myvals IS
SELECT KEY, SITE
FROM DEBIT
WHERE NAME = :P1_MYSELECT;
BEGIN
OPEN v_cur_myvals;
LOOP
FETCH v_cur_myvals
INTO v_key,v_site;
EXIT WHEN v_cur_myvals%NOTFOUND;
:P1_KEY := v_key;
:P1_SITE := v_site;
END LOOP;
CLOSE v_cur_myvals;
END; <br><br>
Then you can use these values for whatever purpose you need to.
Hope this helps. -
How to retrieve the values from a LinkedList
Hello,
I have just put this question in java programming forums by mistake...I think that it should be here ...
I have created a LinkedList to store the results of a query to a database.
These reasults are decimal numbers and then I want to sum all these numbers to be able to make the average.
But when I try to retrieve the values of the Linked List I always receive an incopatible types error..
Here is an extract of my code in a jsp page.
LinkedList Average = new LinkedList();
String Media = rst.getString(10);
Average.add(Media);
int Size = Average.size();
double Sum = 0.0;
for (int i=0; i<=Size; i++)
double Result = Average.get(i)
Sum = Sum + Result;
}If I try to retrieve the value of only one node from the list , I can just putting <%=Average.get(i)%>...but..how can I retrieve all the values (they are decimal numbers) to be able to add them?If you want to sum all the values, is there any reason you just don't retrieve the sum from the database rather than the list of values?
anyway
List average = new LinkedList();
while (rst.next()){
// retrieve the number:
String mediaString = rst.getString(10);
Double media = Double.valueOf(mediaString);
// or maybe like this if it is a number in the database
Double media = new Double(rst.getDouble(10));
average.add(media);
doubleSum = 0.0;
for (Iterator it = average.iterator(); it.hasNext(); ){
Double result= (Double) it.next();
doubleSum += result.doubleValue();
} -
Retrieving checkbox values from JSP
In my program I have an 'ADD' form.
In that form I ask the question "Do you have a car?"
with a single checkbox for reply.
The code I use is below.
Can anyone tell me how to set the checkbox to 'ticked' or 'unticked' in my
main jsp by sending paramters from the ADD form's checkbox??
ADD FORM...
<form action='post' method='servlet/controller?task=addEmployee'>
<input type'text' name='emplpoyee'>
<input type='checkbox' name='car' value='true'>
<input type='submit' name='submit' value='Add'>
</form>
Through a class I retrieve the values posted
public Page doTask() {
Employees employee = new Employees();
employee.setName(request.getParameter("name"));
employee.setCar(Boolean.getBoolean(request.getParameter("car")));
try{
String submit = request.getParameter("submit");
if(submit.equals("Add")){
model.addEmployee(employee);
Page nextPage = new Page("/servlet/Controller?task=GetAllEmployeesTask");
return nextPage;
This class sends the parameters to my main JSP where
this information is inserted. ('employees.jsp')
my name is retrieved so...
<= employees.getName()>
how would I retrieve/set a checkbox valuerequest.getParameter("car")
the thing is that the browser will not send unchecked checkbox values. so you can only know it was checked by the presense or absense of the value. -
Retrieving all values from hashmap in order you put them in
Hi guys,
I want to retrieve all values from a HashMap in the order I put them in.
So I can't use the values() method that gives back a collection and iterate over that.
Do you guys know a good way to do that ?You can just do something like this:
class OrderedMap
private final Map m_rep = new HashMap();
private final List m_keys = new ArrayList();
public Object get( final Object key )
return m_rep.get( key );
public Object put( final Object key, final Object value )
final Object result = m_rep.put( key, value );
if ( result != null )
m_keys.add( key );
return result;
public Object remove( final Object key )
final Object result = m_rep.remove( key );
if ( result != null )
m_keys.add( key );
return result;
public Iterator keyIterator()
return m_rep.iterator();
}Then use it like this:
for ( Iterator it = map.keyIterator(); it.hasNext(); )
final Object value = map.get( it.next() );
}This will be in the order you put them in. However, if you want to do this correctly, you should implement the Map interface and add all the methods. Another thing you can do is download the JDK 1.4 source, learn how they did and do it the same way for 1.2.
R. -
How to retrieve the values from a table if they differ in Unit of Measure
How to retrieve the values from a table if they differ in Unit of Measure?
If no data is read
- Insure that you use internal code in SELECT statement, check via SE16 desactivating conversion exit on table T006A. ([ref|http://help.sap.com/saphelp_nw70/helpdata/en/2a/fa0122493111d182b70000e829fbfe/frameset.htm])
If no quanity in result internal table
- There is no adqntp field in the internal table, so no quantity is copied in itab ([ref|http://help.sap.com /abapdocu_70/en/ABAPINTO_CLAUSE.htm#&ABAP_ALTERNATIVE_1@1@]).
- - Remove the CORRESPONDING, so quantity will fill the first field adqntp1. ([ref|http://help.sap.com/abapdocu_70/en/ABENOPEN_SQL_WA.htm])
- - Then loop at the internal table and move the quantity when necessary to the 2 other fields.
* Fill the internal table
SELECT msehi adqntp
INTO TABLE internal table
FROM lipso2
WHERE vbeln = wrk_doc1
AND msehi IN ('KL','K15','MT').
* If required move the read quantity in the appropriate column.
LOOP AT internal_table ASSIGNING <fs>.
CASE <fs>-msehi.
WHEN 'K15'.
<fs>-adqnt2 = <fs>-adqnt1.
CLEAR <fs>-adqnt1.
WHEN 'MT'.
<fs>-adqnt3 = <fs>-adqnt1.
CLEAR <fs>-adqnt1.
ENDCASE.
ENDLOOP.
- You could also create another table with only fields msehi and adqntp and then collect ([ref|http://help.sap.com/abapdocu_70/en/ABAPCOLLECT.htm]) the data to another table.
Regards,
Raymond -
How to retrieve the values from PL/SQL table types.
Hi Every one,
I have the following procedure:
DECLARE
TYPE t1 IS TABLE OF emp%ROWTYPE
INDEX BY BINARY_INTEGER;
t t1;
BEGIN
SELECT *
BULK COLLECT INTO t
FROM emp;
END;
This procedure works perfectly fine to store the rows of employee in a table type. I am not able to retrieve the values from Pl/SQL table and display it using dbms_output.put_line command.
Can anybody help me please!!!!!
Thanks
Ahmed.You mean, you can't add this
for i in t.first..t.last loop
dbms_output.put_line(t(i).empno||' '||t(i).ename||' '||t(i).job);
end loop;or you can't add this
set serveroutput onor maybe, you are working in third party application where dbms_output is not applicable at all?
You see, not able like very similar it is not working - both are too vague...
Best regards
Maxim
Maybe you are looking for
-
Remote Desktop Connection - Authentication error
Hello, I wish to connect to my work PC from my laptop. The remote desktop connection was working fine till yesterday, but today i receive the following error when i try to connect - "An authentication error has occurred. The Local Security Authority
-
IC Webclient: document search not showing documents for contacts
Hi, I am working with SAP CRM 4.0, SP7. I have created an account(a001) with three contacts(c001, c002, c003). I have attached a document(d001) to account a001 and two documents(d002, d003) to contact c001. Now when I open the IC-Web client UI and go
-
Photoshop Elements will not sync
When I first used my Apple TV, I selected some collections from Photoshop Elements to synch. This worked very well. Now when I go to the Photo tab, and select Photoshop Elements, none of my collections appear there. I can no longer sync any content.
-
Customer consignment stock- REPORTING stock level & goods depatched
Hi all I'm looking for a report (or reports) which shows the following (bare in mind that this will all be customer consignment stock): - the delivery numbers - the previous month's stock level - the quantity of goods despatched the following month w
-
Hi all, Can anyone tell me, how to find whether my DB is RAC or not? Its bit urgent. Thanks in advance!!! Regards, Mithra.