cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a column to a table and fill in the rows.

Former Member
0 Kudos

Hi all,

I have to fill a table according to the search criteria.

The table is mapped with the context variables which i am getting from the BAPI which is a web service.

But apart from all these fields which I will get after mapping, I need one more column to be added called "LINK" and have the row value as "click to view".

The no of rows for this column should synchronize with the actual data that is coming after mapping from PSCD.ie SAP

Kindly help me. Thanx in advance

Regards

DK

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Try this:

1. Create a value node, say LinkNode in your context.

2. Create a value attribute under this node, say LinkText of type String. Bind this LinkText to your new column.

Now use this code after you have executed your model:


int outputNodeSize = wdContext.node<your model output node>().size;
for(int i=0; i<outputNodeSize; i++){
IWDNodeElement elem = wdContext.nodeLinkNode().createElement();
elem.setAttributeValue("LinkText","Click to View");
wdContext.nodeLinkNode.addElement(elem);
}

Regards,

Satyajit.

Former Member
0 Kudos

Hi,

U can proceed this way :

1. Create a node with all the required elements that u need to show in the table.Bind this node to the table.

2. Fill the created node from the BAPI result node using a for loop.

Do get back if you require further explanation.

Thanks & Regards,

Vijith

Former Member
0 Kudos

Hi,

U can proceed this way :

1. Create a node with all the required elements that u need to show in the table.Bind this node to the table.

2. Fill the created node from the BAPI result node using a for loop.

Do get if you require further explanation.

Thanks & Regards,

Vijith

Former Member
0 Kudos

That is ok but the LINK column is not related to the BAPI and how to set the "click to view" value for the rows.

Moreover, how to increase the row size for LINK column according to the rows or the data coming from BAPI for the other fields.

Can u explain it programatically.

Regards

DK

Former Member
0 Kudos

Hi,

When u are creating a new node add a attribute (This is in additional to the attributes that u are getting from BAPI)to it and set the value as "Click to view". Let the name of the attribute be Link.

Consider that the newly created node is A and the view name is Test then :

For Eg :

for(int i=0;i<wdContext.node"Bapioutput".size();i++)

{

IPrivateTest.IAelement ele = wdContext.nodeA.createAelement();

//Do also set the other values from BAPI

ele.setlink("click to view");

wdContext.nodeA.addElement(ele);

}

Hope u got this ....Revert back if u have any problems.

Regards,

Vijith