on 11-29-2007 11:34 AM
Hello All,
I have a business requirement that the data returned from a BAPI has to be split into sub-sets, and then displayed in seperate tables. I have identified a way to create the tables dynamically.
How do we create Context nodes on the fly (dynamically)? The requirement is that if the BAPI is returning 5 records, then I have to create 5 context nodes. Each of the node then can be attached to a table and displayed. The newly created 5 context nodes should have the same structure as the BAPI output (so that we can get a one-to-one mapping).
Thanks in advance,
PKS
public void wdDoInit()
{
//@@begin wdDoInit()
IWDNodeInfo rootnodeInfo = wdContext.getNodeInfo();
IWDNodeInfo soNodeInfo = rootnodeInfo.addChild(
"SalesOrders",
null,
true,
false,true,
false,false,
true,
null,
null,
null);
soNodeInfo.addAttribute("OrderNo","ddic:com.sap.dictionary.integer");
soNodeInfo.addAttribute("SalesDate","ddic:com.sap.dictionary.date");
soNodeInfo.addAttribute("SalesRep","ddic:com.sap.dictionary.string");
soNodeInfo.addAttribute("LongText","ddic:com.sap.dictionary.string");
IWDNode soNode = wdContext.getChildNode("SalesOrders",0);
IWDNodeElement soElement = soNode.createElement();
soElement.setAttributeValue("OrderNo",new Integer(100));
soElement.setAttributeValue("SalesDate",new Date(System.currentTimeMillis()));
soElement.setAttributeValue("SalesRep","Dhruv Shah");
soElement.setAttributeValue("LongText","Printer Supplies");
soNode.addElement(soElement);
//@@end
}
Use this example to get some idea.....
Regards,
Dhruv Shah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Problem solved. Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In following manner you can create nodes dynamically.
nodeInfo=wdContext.getNodeInfo().addChild("node_name", null,true, CMICardinality.MANY,CMICardinality.MANY, true, null);
IWDNode tableNode = wdContext.getChildNode(nodeInfo.getName(), IWDNode.LEAD_SELECTION);
Now in this table node you can add attributes in following manner.
nodeInfo.addAttribute("attribute","com.sap.dictionary.string");
Feel free to contact for queries ,
Regards,
Praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.