on 07-27-2017 5:43 PM
Hi SAP personas team,
I have to capture multiple deliveries for a sales order . In SAP when i go to document flow i can see the nodes and once i expand nodes i can see the respective delivery numbers .
how do i script the nodes and capture the list of deliveries .
Kindly suggest .
Best regards,
pradeep.
Thank you clemens .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Pradeep,
The document flow page of sales order is a GuiTree.
We can expand the node and get item text of the column required.
var o = session.findById("wnd[0]/usr/cntlTREE1/shellcont/shell/shellcont[1]/shell[1]");
o.expandNode(" 1");
o.expandNode(" 2");
o.clickLink(" 3", "C 3");
var _ITEMTEXT = o.getItemText(" 3", "C 3");
Use getSubNodes() to get all nodes and them loop through them:
var o = session.findById("wnd[0]/usr/cntlTREE1/shellcont/shell/shellcont[1]/shell[1]");
var subNode= o.getSubNodes(" 2");
var length = subNode.length;
for (i = 3; i < length; i++) {
var data = o.getItemText(" "+i, "C 3");
session.utils.log(data);
}
Best Regards,
Clemens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Clemens ,
When i try to execute i am getting the following error .
UnidentifiedControl - There is no control with id 'wnd[0]/usr/cntlTREE1/shellcont/shell/shellcont[1]/shell[1]' in the current
there is a control.
wnd[0]/usr/cntlTREE1/shellcont/shell/shellcont[1]/shell[1]"
But when i tried to use this ,it does not work
Kindly suggest .
Best regards,
pradeep.
Hello Clemens,
In the request:
getItemText(String nodeKey, String itemName);
How to know what to put in the String itemName?
I try to play with your script.
I can now figure what to put in the Sting NodeKey, but for the Sting itemName, I'm stuck.
If I put :
getItemText(" "+i, "C 3");
I get the date, but how to get the document number?
What is C?
Thanks,
Emmanuel.
Hello Clemens,
In the request:
getItemText(String nodeKey, String itemName);
How to know what to put in the String itemName?
I try to play with your script.
I can now figure what to put in the Sting NodeKey, but for the Sting itemName, I'm stuck.
If I put :
getItemText(" "+i, "C 3");
I get the date, but how to get the document number?
What is C?
Thanks,
Emmanuel.
Hello Emmanuel,
roughly speaking, nodeKey is row key and item name is the column.
The node key often can be figured out by recording the selection of the line in question or by looping over all the entries delivered by method getNodes() or getSubNodes().
The item names can be accessed through the columnNames property. The following script logs the item (=column) names of a table and the values of their top node (unfortunately there is not scripting method to access the column's title):
var itemName;
var tree = session.findById("wnd[0]/usr/cntlTREE1/shellcont/shell/shellcont[1]/shell[1]");
var items= tree.columnNames;
for(var i=0; i<items.length; i++){
itemName = items.elementAt(i);
session.utils.log(">"+itemName+"<:"+tree.getItemText(tree.topNode, itemName));
}
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.