Skip to Content
0

sap personas scripting document flow and Nodes

Jul 27, 2017 at 04:43 PM

168

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member Aug 02, 2017 at 05:50 PM
0

Thank you clemens .

Share
10 |10000 characters needed characters left characters exceeded
Clemens Gantert
Aug 01, 2017 at 03:13 PM
0

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

Show 5 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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.

0

Hello Pradeep,

my scripts are examples on how to deal with the control type GuiTree. It's not a ready-to-go script, but you have to adjust it to your specific needs.

Best Regards,

Clemens

0

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.

0

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));
}

0

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.

0