Get path to nodes by value
Can enybody please help me. I don't know really how to get path from xml
for example, this is xml:
<?xml version="1.0"?>
<purchase_order>
<po_items>
<item>
<name>#Name#</name>
<quantity>#number#</quantity>
</item>
</po_items>
</purchase_order>
and get out path by variebles #Name# and #number#.
In this case i need to get result:
purchase_order/po_items/item/name
and
purchase_order/po_items/item/quantity
Pitty you did not mention your db version.
putting together some functions from FunctX one can write
SQL> with t as (
select xmltype('<?xml version="1.0"?>
<purchase_order>
<po_items>
<item>
<name>#Name#</name>
<quantity>#number#</quantity>
</item>
</po_items>
</purchase_order>') xml from dual
select x.*
from t t,
xmltable('declare function local:index-of-node ( $nodes as node()* , $nodeToFind as node() ) as xs:integer*
for $seq in (1 to count($nodes)) return $seq[$nodes[$seq] is $nodeToFind]
declare function local:path-to-node-with-pos ( $node as node()? ) as xs:string
fn:string-join( for $ancestor in $node/ancestor-or-self::*
let $sibsOfSameName := $ancestor/../*[fn:name() = fn:name($ancestor)]
return fn:concat(fn:name($ancestor),
if (fn:count($sibsOfSameName) <= 1)
then "" else fn:concat( "[", local:index-of-node($sibsOfSameName,$ancestor),"]"))
element e {local:path-to-node-with-pos(//item/name[. = "#Name#"]), element name {//name}},
element e {local:path-to-node-with-pos(//item/quantity[. = "#number#"]), element name {//quantity}}'
passing t.xml
columns value varchar2(50) path 'name',
path varchar2(50) path 'text()'
) x
VALUE PATH
#Name# purchase_order/po_items/item/name
#number# purchase_order/po_items/item/quantity
2 rows selected.
Similar Messages
-
GetTreeCellRendererComponent(): get path to value without using row-arg?
I'm using a JTree to display hierarchical data which include cyclic dependencies (i.e. an item may be its own ancestor).
If a node shows up for the second time in a hierarchical tree path, I put a stop to further expansion (using the getPath() of a TreeExpansionEvent in a TreeWillExpandListener), and I give the node a special display (using a tree-cell renderer with a custom implementation of getTreeCellRendererComponent()). The implementation uses tree.getPathForRow(row) to get the path by which can be detected if a node is cyclic, but this does not always work: sometimes tree.getPathForRow(row).getLastPathComponent() corresponds to the value-object given as argument to getTreeCellRendererComponent(), but sometimes it does not.
The example below shows the difference (switch the lines marked "Not OK" by the line marked "OK"; to keep it simple, I left the cyclic dependencies out).
Checking the swing source files reveals that if getTreeCellRendererComponent() is called by paintRow() in BasicTreeUI, value and row correspond. But if getTreeCellRendererComponent() is called by getNodeDimensions() in one of the LayoutCache-classes, the given value-object does not correspond to the object at the given tree-row. Somewhere I read that getNodeDimensions() is called to determine preferred sizes of nodes before they are shown for the first time. If that's the case, it is logical that value and row do not correspond, although I would have liked to get a hint, e.g. a row value of -1.
To detect a cyclic node, I need a treepath, but the row-argument is unreliable. Is there another way to determine the path corresponding to the value-object passed to getTreeCellRendererComponent(), so without having to use the row-argument?
* treeUpdate.java
package treeupdate;
import java.awt.Component;
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JLabel;
import javax.swing.JTree;
import javax.swing.event.EventListenerList;
import javax.swing.event.TreeModelListener;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
public class treeUpdate extends javax.swing.JFrame {
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTree jTree1;
private ItemInHierarchy root = null;
private SimpleTreeModel htm = new SimpleTreeModel();
private SimpleTreeCellRenderer htcr = new SimpleTreeCellRenderer();
public treeUpdate() {
initComponents();
generateHierarchy();
jTree1.setModel(htm);
jTree1.setCellRenderer(htcr);
// init
private void initComponents() {
setTitle("row-value correspondence");
setSize(new Dimension(300,500));
jScrollPane1 = new javax.swing.JScrollPane();
jTree1 = new javax.swing.JTree();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jScrollPane1.setViewportView(jTree1);
add(jScrollPane1);
// generate data
private void generateHierarchy() {
root = new ItemInHierarchy("Joverra");
ItemInHierarchy c1 = new ItemInHierarchy("Kondat Kalbendate");
c1.children.add(new ItemInHierarchy("Linovar Welchessante Somtanessia"));
c1.children.add(new ItemInHierarchy("Muzarra Frontiminoi Wioppallae"));
c1.children.add(new ItemInHierarchy("Niobitia Fyttichiokla Quantianou"));
root.children.add(c1);
ItemInHierarchy c2 = new ItemInHierarchy("Orud Kalbene");
c2.children.add(new ItemInHierarchy("Pascalite Welchessante Somtanessia"));
c2.children.add(new ItemInHierarchy("Quinnime Frontiminoi Wioppallae"));
c2.children.add(new ItemInHierarchy("Ruttinovi Fyttichiokla Quantianou"));
root.children.add(c2);
ItemInHierarchy c3 = new ItemInHierarchy("Si Kae");
c3.children.add(new ItemInHierarchy("Tonniate Welchessante Somtanessia"));
c3.children.add(new ItemInHierarchy("Uvverten Frontiminoi Wioppallae"));
c3.children.add(new ItemInHierarchy("Vlioppala Fyttichiokla Quantianou"));
root.children.add(c3);
* Tree model
private class SimpleTreeModel implements TreeModel {
protected EventListenerList listenerList = new EventListenerList();
public Object getRoot() {
return root;
public Object getChild(Object parent, int index) {
ItemInHierarchy i = (ItemInHierarchy)parent;
return i.children.get(index);
public int getChildCount(Object parent) {
ItemInHierarchy i = (ItemInHierarchy)parent;
return i.children.size();
public boolean isLeaf(Object node) {
ItemInHierarchy i = (ItemInHierarchy)node;
return i.children.size()==0;
public void valueForPathChanged(TreePath path, Object newValue) {
// do nothing
public int getIndexOfChild(Object parent, Object child) {
ItemInHierarchy i = (ItemInHierarchy)parent;
for (int k = 0; k < i.children.size(); k++) {
if (i.children.get(k).equals((ItemInHierarchy)child)) {
return k;
return -1;
public void addTreeModelListener(TreeModelListener l) {
listenerList.add(TreeModelListener.class, l);
public void removeTreeModelListener(TreeModelListener l) {
listenerList.remove(TreeModelListener.class, l);
* Cell renderer
private class SimpleTreeCellRenderer extends JLabel implements TreeCellRenderer {
public SimpleTreeCellRenderer() {
setOpaque(true);
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
// OK
// setText(value.toString());
// Not OK
TreePath tp = tree.getPathForRow(row);
if (tp!=null) {
setText(tp.getLastPathComponent().toString());
} else {
setText("?");
return this;
* Item in hierarchy
public class ItemInHierarchy {
public List<ItemInHierarchy> children = new ArrayList<ItemInHierarchy>();
public String name;
public ItemInHierarchy() {
public ItemInHierarchy(String name) {
this.name = name;
@Override
public String toString() {
return name;
// main
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new treeUpdate().setVisible(true);
}Kleopatra wrote:
The only general way to hack-around, as far as I remember, is to force the VariableSomething out of the way and make a FixedSomething takes it place. No api, but you can reach that by doing both:
- tree.setLargeModel(true)
- tree.setRowHeight(somevalueabovezero)
Your memory's fine. I ran a short test, this seems to make row- and value-arguments correspond to each other consistently.
Kleopatra wrote:
... before expanding a node it calls the renderer with the row set to the the row following the row of the node to expand (same for all children)...I suspected something like this, and it opens up a way to solve my question, but it seemed like a too shallow basis for coding. I'm satisfied with fixed row heights, so I'll stick to your suggestion above, and I'll include a short equality test in getTreeCellRendererComponent(), just to make sure:
value.equals(tree.getPathForRow(row).getLastPathComponent())Thanks for the help - Jan -
JTree get selected node/object values
I wan to get all the selected nodes/objects values that I added to the JTree. How can I do this?
Thanks.TreePath[] paths = tree.getSelectedPath();
for(int i = 0; i < paths.length; i++){
TreeNode node = (TreeNode)paths.getLastPathComponent();
Object mySelectedObject = node.getUserObject();
}Some minor Errors
We have to use array paths[i] instead of paths
The correct code as used by me is
javax.swing.tree.TreePath[] paths = jTree1.getSelectionModel().getSelectionPaths();
for(int i = 0; i < paths.length; i++){
javax.swing.tree.TreeNode node = (javax.swing.tree.TreeNode)paths.getLastPathComponent();
System.out.println(((javax.swing.tree.DefaultMutableTreeNode)node).getUserObject());
CSJakharia -
How to get the selected node value of a tree which is build on java code
Hi Experts,
How can i get the selected node value if I build the tree programatically.
I am using the following code in selectionListener but it is throwing error.
RichTreeTable treeTable = (RichTreeTable)getQaReasontreeTable();
CollectionModel _tableModel =
(CollectionModel)treeTable.getValue();
RowKeySet _selectedRowData = treeTable.getSelectedRowKeys();
Iterator rksIterator = _selectedRowData.iterator();
String selectedQaCode ="";
while (rksIterator.hasNext()) {
List key = (List)rksIterator.next();
JUCtrlHierBinding treeTableBinding =
(JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
JUCtrlHierNodeBinding nodeBinding =
treeTableBinding.findNodeByKeyPath(key);
String nodeStuctureDefname =
nodeBinding.getHierTypeBinding().getStructureDefName();
selectedQaCode = selectedQaCode + nodeBinding.getAttribute(0);
where I am using following link to create a tree with java code.
http://one-size-doesnt-fit-all.blogspot.com/2007/05/back-to-programming-programmatic-adf.html
Please help me in resolving this issue.
Regards
GayazHi,
you should also move
JUCtrlHierBinding treeTableBinding =
(JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
out of the while loop as this is not necessary to be repeated for each key in the set
Frank -
How to get a Tree Node Value when a Tree is Expanded
My reqiurement is when i Expand a Tree i need the Expanded tree Node Value. For Example Consider Parent as a Root Node of a Tree, and Consider its two Children Child1 and Child2.
When + Parent Expanded
I will Get the Output as --Parent
- Child1
- Child2
so As when i expand the Tree i must Get the String Value Parent.duplicate
How to get a Tree Node Value when a Tree is Expanded -
HOw to get parent node name value through its child node?
Hi,
Experts,
I am able to get child node name values but according to attribute name value i want to get its parent name value how to achieve that. For that i have used If_Ixml_element->Get_parent. Please pass some idea on it.
Thanks in advance,
Shabeer ahmed.Hello Shabeer
I think the coding should be straightforward:
DATA: lo_element TYPE REF TO if_ixml_element,
lo_child TYPE REF TO if_ixml_node,
lo_parent TYPE REF TO if_ixml_node.
" NOTE: LO_ELEMENT holds your child node
lo_child ?= lo_element.
lo_parent = lo_child->get_parent( ).
Regards
Uwe -
Value not getting resetted for Node inside Node
Hi All
I have created the node structure as below
A (Value Node)
|_ID (value attribute)
|_B (Value Node)
|__Val (Value Attribute for Node B)
Now the code is as follows
for(i = 0 ; i < n ; i++ ){
Ele Aele = createElement
Aele.setID("1")
nodeA.addElement(Aele)
for(j = 0 ; j < n ; j++ ){
Ele Bele = createElement
Bele.setVal("Val1")
nodeB.addElement(Bele)
Now i want for ID - 1 , Val - a,b,c
when sec time loop iterates
ID - 2 , Val - d,e,f
But the problem is that
For ID - 1 , i am getting Val - a,b,c,d,e,f
when sec time loop iterates
ID - 2 , Val - a,b,c,d,e,f
I hope you all can get what my problem is..
Kindly comment and help me out
Regards
Sonal Mangla
Message was edited by:
Sonal ManglaHi ,
There are a lot similar posts in forum.
You can also search help.sap.
Try this link. They have explained creation of similar context structure.
http://help.sap.com/saphelp_nw04/helpdata/en/13/4cde139306304480e89d815ffcf891/frameset.htm
Regards
Bharathwaj -
TreeModel - get path of selected node
How can I get path of selected node. I know getRowKey will return me for example [0,1,0] , but how can I use that to get string representation [Test, Folder1, Node0]
I tried to loop thru it but the results are inccorect.public String pickPara_action() {
// Add event code here...
setCurrentParagraphNumberFromRow();
return null;
private void setCurrentParagraphNumberFromRow() {
FacesContext ctx = FacesContext.getCurrentInstance();
//java.lang.ClassCastException: oracle.jbo.uicli.binding.JUCtrlHierNodeBinding
/*JUCtrlValueBindingRef*/JUCtrlHierNodeBinding tableRowRef =
/*(JUCtrlValueBindingRef)*/(JUCtrlHierNodeBinding)this.getParagraphTreeTable().getRowData();
try
paragraphPk = (Double)tableRowRef.getRow().getAttribute("pk");
catch (Exception ex) {
System.err.println ("backingToc: exception at get attribute"+ex);
String paragraphPk_str = paragraphPk.toString();
System.err.println("backingToc: before store");
IMS_UserSystemState.storeCurrentParagraphNumber(paragraphPk_str);
} -
How to get the current node element by its value?
e.g,:
wdContext.current<b>Deal</b>Element().setAttributeValue("<i>deal_id</i>","<i>aaaaaaa</i>");
above code can get the result i wanna.
but now i wanna in terms of its node'name to set attribute vaue of itself. in other words,i have no idea about how to get the current node element by its name"<b>Deal</b>".Hi Wing,
The answer is there in your question itself.
wdContext.currentDealElement()
will give you the current node element by its name"Deal" or you could use
wdContext.nodeDeal().getCurrentElement()
or you could use
wdContext.nodeDeal().getElementAt(wdContext.nodeDeal().getLeadSelection())
Regards,
Sudeep -
How to get all tree node parents upon select
I have a tree, and when user clicks an item in the tree, I want to get all the parents of the selectedItem node.
So if I have this XML:
<products>
<item>
<sku>1001</sku>
<quantity value="100" />
</item>
<item>
<sku>2001</sku>
<quantity value="250" />
</item>
<item>
<sku>3001</sku>
<quantity value="300" />
</item>
</products>
If user clicks on the 1001 sku, I want to get something like this:
<products><item><sku>
Also if I have a custom component, perhaps based on tree or but maybe not, and if this custom component shows the actual XML and used can click on XML elements or XML attributes, how can I use the selected item to get the parent nodes, so if they click on the value="100", I want to get this:
<products><item><sku><quantity>
I need this because I have a set of fields, and users will drag their XML node elements or attributes to my fields, to define a mapping between their XML and my fields.
The selectedItem is just a snippet of XML cut off from its source XMLListCollection, and I might be able to search the XMLListCollection, but what if there were say <sku> elements at more than one level in the XML? I'm guessing a search might return multiple hits for a selected element, when I want the actual parent nodes for the actual selected node.
Thanks very much!var path:Array=[]
var parent:XML = xxxx.selectedItem.parent()
while(parent){
path.push(parent.localName())
parent = parent.parent()
Or, i didn't get your question and xxxx.selectedItem is "detached" XML snippet ? -
How to get Text for nodes in Tree Structure
Hi Friends,
How to get Text for nodes in Tree Structure
REPORT YFIIN_REP_TREE_STRUCTURE no standard page heading.
I N I T I A L I Z A T I O N
INITIALIZATION.
AUTHORITY-CHECK OBJECT 'ZPRCHK_NEW' :
ID 'YFIINICD' FIELD SY-TCODE.
IF SY-SUBRC NE 0.
MESSAGE I000(yFI02) with SY-TCODE .
LEAVE PROGRAM.
ENDIF.
class screen_init definition create private.
Public section
public section.
class-methods init_screen.
methods constructor.
Private section
private section.
data: container1 type ref to cl_gui_custom_container,
container2 type ref to cl_gui_custom_container,
tree type ref to cl_gui_simple_tree.
methods: fill_tree.
endclass.
Class for Handling Events
class screen_handler definition.
Public section
public section.
methods: constructor importing container
type ref to cl_gui_custom_container,
handle_node_double_click
for event node_double_click
of cl_gui_simple_tree
importing node_key .
Private section
private section.
endclass.
*& Classes implementation
class screen_init implementation.
*& Method INIT_SCREEN
method init_screen.
data screen type ref to screen_init.
create object screen.
endmethod.
*& Method CONSTRUCTOR
method constructor.
data: events type cntl_simple_events,
event like line of events,
event_handler type ref to screen_handler.
create object: container1 exporting container_name = 'CUSTOM_1',
tree exporting parent = container1
node_selection_mode =
cl_gui_simple_tree=>node_sel_mode_multiple.
create object: container2 exporting container_name = 'CUSTOM_2',
event_handler exporting container = container2.
event-eventid = cl_gui_simple_tree=>eventid_node_double_click.
event-appl_event = ' '. "system event, does not trigger PAI
append event to events.
call method tree->set_registered_events
exporting events = events.
set handler event_handler->handle_node_double_click for tree.
call method: me->fill_tree.
endmethod.
*& Method FILL_TREE
method fill_tree.
data: node_table type table of abdemonode,
node type abdemonode.
types: begin of tree_node,
folder(50) type c,
tcode(60) type c,
tcode1(60) type c,
tcode2(60) type c,
text(60) type c,
text1(60) type c,
text2(60) type c,
end of tree_node.
data: wa_tree_node type tree_node,
t_tree_node type table of tree_node.
wa_tree_node-folder = text-001.
wa_tree_node-tcode = text-002.
wa_tree_node-text = 'Creditors ageing'.
wa_tree_node-tcode1 = text-003.
wa_tree_node-text1 = 'GR/IR aging'.
wa_tree_node-tcode2 = text-004.
wa_tree_node-text2 = 'Bank Balance'.
append wa_tree_node to t_tree_node.
clear wa_tree_node .
wa_tree_node-folder = text-005.
wa_tree_node-tcode = text-006.
wa_tree_node-text = 'Creditors ageing'.
wa_tree_node-tcode1 = text-007.
wa_tree_node-text1 = 'Creditors ageing'.
wa_tree_node-tcode2 = text-008.
wa_tree_node-text2 = 'Creditors ageing'.
append wa_tree_node to t_tree_node.
clear wa_tree_node .
wa_tree_node-folder = text-009.
wa_tree_node-tcode = text-010.
wa_tree_node-text = 'Creditors ageing'.
wa_tree_node-tcode1 = text-011.
wa_tree_node-text1 = 'Creditors ageing'.
wa_tree_node-tcode2 = text-012.
wa_tree_node-text2 = 'Creditors ageing'.
append wa_tree_node to t_tree_node.
clear wa_tree_node .
node-hidden = ' '. " All nodes are visible,
node-disabled = ' '. " selectable,
node-isfolder = 'X'. " a folder,
node-expander = ' '. " have no '+' sign forexpansion.
loop at t_tree_node into wa_tree_node.
at new folder.
node-isfolder = 'X'. " a folder,
node-node_key = wa_tree_node-folder.
clear node-relatkey.
clear node-relatship.
node-text = wa_tree_node-folder.
node-n_image = ' '.
node-exp_image = ' '.
append node to node_table.
endat.
at new tcode .
node-isfolder = ' '. " a folder,
node-n_image = '@CS@'. "AV is the internal code
node-exp_image = '@CS@'. "for an airplane icon
node-node_key = wa_tree_node-tcode.
node-text = wa_tree_node-text .
node-relatkey = wa_tree_node-folder.
node-relatship = cl_gui_simple_tree=>relat_last_child.
endat.
append node to node_table.
at new tcode1 .
node-isfolder = ' '. " a folder,
node-n_image = '@CS@'. "AV is the internal code
node-exp_image = '@CS@'. "for an airplane icon
node-node_key = wa_tree_node-tcode1.
node-relatkey = wa_tree_node-folder.
node-relatship = cl_gui_simple_tree=>relat_last_child.
node-text = wa_tree_node-text1.
endat.
append node to node_table.
at new tcode2 .
node-isfolder = ' '. " a folder,
node-n_image = '@CS@'. "AV is the internal code
node-exp_image = '@CS@'. "for an airplane icon
node-node_key = wa_tree_node-tcode2.
node-relatkey = wa_tree_node-folder.
node-relatship = cl_gui_simple_tree=>relat_last_child.
node-text = wa_tree_node-text2.
endat.
append node to node_table.
endloop.
call method tree->add_nodes
exporting table_structure_name = 'ABDEMONODE'
node_table = node_table.
endmethod.
endclass.
*& Class implementation
class screen_handler implementation.
*& Method CONSTRUCTOR
method constructor.
create object: HTML_VIEWER exporting PARENT = CONTAINER,
LIST_VIEWER exporting I_PARENT = CONTAINER.
endmethod.
*& Method HANDLE_NODE_DOUBLE_CLICK
method handle_node_double_click.
case node_key(12).
when 'Creditors'.
submit YFIIN_REP_CREADITORS_AGING via selection-screen and return.
when 'Vendor'.
submit YFIIN_REP_VENDOR_OUTSTANDING via selection-screen and return.
when 'Customer'.
submit YFIIN_REP_CUSTOMER_OUTSTANDING via selection-screen and
return.
when 'GR/IR'.
submit YFIIN_REP_GRIR_AGING via selection-screen and return.
when 'Acc_Doc_List'.
submit YFIIN_REP_ACCOUNTINGDOCLIST via selection-screen and return.
when 'Bank Bal'.
submit YFIIN_REP_BANKBALANCE via selection-screen and return.
when 'Ven_Cus_Dtl'.
submit YFIIN_REP_VENDORCUST_DETAIL via selection-screen and return.
when 'G/L_Open_Bal'.
submit YFIIN_REP_OPENINGBALANCE via selection-screen and return.
when 'Usr_Authn'.
submit YFIIN_REP_USERAUTHRIZATION via selection-screen and return.
endcase.
endmethod.
endclass.
Program execution ************************************************
load-of-program.
call screen 9001.
at selection-screen.
Dialog Modules PBO
*& Module STATUS_9001 OUTPUT
text
module status_9001 output.
set pf-status 'SCREEN_9001'.
set titlebar 'TIT_9001'.
call method screen_init=>init_screen.
endmodule. " STATUS_9001 OUTPUT
Dialog Modules PAI
*& Module USER_COMMAND_9001 INPUT
text
module user_command_9001 input.
endmodule. " USER_COMMAND_9001 INPUT
*& Module exit_9001 INPUT
text
module exit_9001 input.
case sy-ucomm.
when 'EXIT'.
set screen 0.
endcase.
endmodule.
exit_9001 INPUTyou can read the table node_table with nody key value which imports when docubble click the the tree node (Double clifk event).
Regards,
Gopi .
Reward points if helpfull. -
How to get the latest credit limit values per each customer in the report.
Hi All,
Can anybody give me an idea on how to get the latest credit limit values per each customer in the report.
I have below requiremnt.
I have cube which is having transactional data on document and customer level .and it also having master data info object in the cube which is credit management view having all the customer numbers .
This credit management view is master data info object having credit limit key figure as attribute.These credit limit are per each customer.
So we need these credit limits in the report as dynamic values .(I mean whatever be the current credit limit in the master data table for that paricular customer that should show up in the reporting).
one more thing these credit limits should roll up correctly at the HTR level.
One HTR having number of customers .
for example HTR 100 can have customer number 200,300,400.
Those 200,300,400 customer credit limits should roolup correctly at the HTR 100 level.
Example below :
Cube DATA :
HTR Customer Doct number Credit managment view
100 200 10001 200
100 200 10002 200
100 300 10004 300
100 300 10005 300
100 400 10006 400
100 400 10007 400
100 400 10008 400
Master data tabel (P Table)(Credit managment view)
Credit managment view Credit limits
200 1000.00
300 50000.00
400 90000.00
Please remeber :
We can not make these credit limits as navigational becasue these are keyfigure attributes not characteristics.
one more thing we can not make them as charatistics because we need use these credit limits to derive other calkculation. so it is not possibel to derive calculations on charactristics .Create a formula variable of type replacement path with reference as attibutes of Credit management view and choose your key figure credit limit,say zcredit.
Now create a formula or CKF and use zcredit.
This should display the credit limit in your report as normal key figure.
I didnot get this part "one more thing these credit limits should roll up correctly at the HTR level.", may be the above will solve this too.Try it.
Hope this helps. -
I can't get the correct node (a real beginner)
I have an XML file which looks like this:
[code<lawyer>
<Country>Singapore</Country>
<Company>Allen & Gledhill</Company>
</lawyer>
<lawyer>
<Country>Singapore</Country>
<Company>Allen & Gledhill</Company>
</lawyer>.
</Lawyers>
But I can't get the right node names and values.
Here is my code:
File file = new File("lawyers.xml");
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.parse(file);
NodeList nlLawyers = doc.getElementsByTagName("lawyer");
for (int i = 0; i < nlLawyers.getLength(); i++) {
Element elLawyer = (Element) nlLawyers.item(i);
NodeList columns = elLawyer.getChildNodes();
for (int j=0; j<columns.getLength(); j++) {
Node col = columns.item(j);
String colName = col.getNodeName();
String colVal = col.getNodeValue();
System.out.println(colName + ": " + colVal);
}What I would like to print out would be something like this:
Country: Singapore
Company: Allen & GledhillBut I am getting extra nodes and cannot get the text values. Here is the output I am getting:
#text:
Country: null
#text:
Company: nullI don't understand this output at all. Please help me get the list of node names and values?
Thank you.
-JeffIt seems that the #text nodes represent the whitespace between the formal nodes. Also, the nodes that I want to extract have a NodeTypeValue of 1. Once I had determined that I had the correct node, I had to get its child node to get the text. Here is the final code:
File file = new File("lawyers.xml");
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.parse(file);
NodeList nlLawyers = doc.getElementsByTagName("lawyer");
for (int i = 0; i < nlLawyers.getLength(); i++) {
lawyer = new Lawyer();
Element elLawyer = (Element) nlLawyers.item(i);
NodeList columns = elLawyer.getChildNodes();
for (int j=0; j<columns.getLength(); j++) {
Node col = columns.item(j);
if (col.getNodeType() == 1) {
String strColumn = col.getNodeName();
Node txt = col.getFirstChild();
String strValue = txt.getNodeValue();
System.out.println(strColumn + ":\t" + strValue); }
} // for each column
} // for each lawyer -
Hi to all!
I' m using JTree combined with DefaultMutableTreeNode and DefaultTreeModel.
My problem is that I have the path of a certain node and I just want to get a certain node of this path in order to edit (or better to update) its "userObject".
Maybe it's a silly question but I'm new to JTree and I feel a little lost with all these methods provided.
Thank you in advance.For starters: excellent photography, and great lighting knowledge and skills. With great photography and lighting, you really don't need to do major alterations other than some minor improvements. i would say instead of looking for lightroom to make it better, instead improve the quality of your photos. lightroom is a tool, not a result to good photos.
with that said, reference these links:
http://thelightroomlab.com/2009/10/camera-raw-profiles-in-adobe-photoshop-lightroom/
http://layersmagazine.com/photographic-workflow-from-lightroom-to-photoshop.html
http://tv.adobe.com/watch/getting-started-with-adobe-photoshop-lightroom-4/lightroom-4-cre ate-stunning-images/
janelle -
Using IClusterInformation Interface to get the server node.
Hi ,
I have created a portal application which contains an Abstract Portal Component to display the server node the user logs on.
I have written the following code :
IClusterInformation clusterContext =
(IClusterInformation) PortalRuntime.getRuntimeResources().getService( IClusterInformation.KEY);
I too added the Sharing Reference , "com.sap.portal.runtime.system.clusterinformation" to Application Config property in Portalapp.xml file.
But still am getting an error "IClusterInformation cannot be resolved".
Do I need to add some external JAR File to the Java Build Path of my portal Application. If so , Which JAR file I need to add?
Regards,
Eben Joyson.I use this to get the server - node:
String node = "";
Enumeration props = System.getProperties().keys();
while (props.hasMoreElements()) {
String thisProp = props.nextElement().toString();
if (thisProp.startsWith("dsr.") && thisProp.endsWith(".buffersize")) {
node = thisProp.substring(5 + thisProp.indexOf("_" + SID + "_"), thisProp.indexOf(".buffersize"));
if (node != null) {
String cluster = node.substring(0, 6) + "00";
node = node.substring(0, 8);
Hope it helps
Johannes
Maybe you are looking for
-
How to override cache config in application target server ?
Hi, I have a coherence cluster and multiple application clusters in my WLS. I am trying to override cache config as I wan to creating write behind and read through caches specific to my application cluster. Please provide a guideline on how to add ad
-
Use more than 2 GB ram for oracle
I have 16 GB ram but I only can use 2 GB of that for oracle database , how can i increase that ???
-
Why did Lep make Keynote et. al. my default programs?
90% of the work stuff I do in on Office. Why did the Leopard upgrade switch every thing to Keynote, ect, that I do not even own? How do I turn that off?? It is a serious pain in the butt!
-
SELECTs in user exists (P/S modules)
Hi, I am implementing user exist triggered when an accounting document is posted ... P/S event no. 00001030. The problem is, that I need to read some records from BSID table ... this event is triggered right before a commit is executed, therefore I s
-
NoClassDefFoundError: oracle/sql/OPAQUE
I've got some configuration problem with the XSU utility. It runs the getXML with all these settings fine. But when I run the putXML I get this result: C:\Documents and Settings\kstclair>java OracleXML putXML -user "jandj/xprojxabc" -conn "jdbc:oracl