cancel
Showing results for 
Search instead for 
Did you mean: 

How can I add values on a Drop Down by Index Webdynpro Element by a Model?

Former Member
0 Kudos

How can I add values on a Drop Down by Index Webdynpro Element with a Model RFC?

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

..

Former Member
0 Kudos

Thaks for your help, it helped me

former_member182598
Active Contributor
0 Kudos

The code given by fellow SDNER (Sunitha) is applicable for Drop Down by Key , not for Drop Down by Index. It might even not work with that as well depending on when you are trying to popultae.

When do you want to populate the drop down..?

1. If you want to do it on the first screen, ie before model is executed. Use value nodes, create elements for the drop down and pass the value to the model while executing.

2. If it's after executing the model I will suggest to modify the RFC and include the additional values as adding the value from the WD JAVA side can lead to confusion. RFC when executed from backend giving different result from when executed from frontend.

p330068
Active Contributor
0 Kudos

Hi Jesus,

Please use the below code for DropDownByIndex Elements :-

Suppose you have model node ABC and attribute xyz. Now you have created custom node CustNode and attribute CustAtt.


ICustNodeElement  ele = null;
if(wdContext.nodeABC().size > 0)
{
              for(int i=0; i< CustNode< wdContext.nodeABC().size; i++
              {
	ele = wdContext. createCustNode();
                      ele.setCustAtt(wdContext.nodeABC().getABCElementAt(i).getXYZ)
	wdContext.nodeCustNode.add(ele);
                }
}

Refer to http://help.sap.com/saphelp_nw70/helpdata/en/3b/f1754276e4c153e10000000a1550b0/frameset.htm

Best Regards

Arun Jaiswal

Former Member
0 Kudos

Hi ,

You can add values from a model node to dropdown by Index

check this code

IWDAttributeInfo attinfo = wdContext.node<>().getNodeInfo().getAttribute("XXX");

ISimpleTypeModifiable type = attinfo.getModifiableSimpleType();

IModifiableSimpleValueSet valuset =type.getSVServices().getModifiableSimpleValueSet();

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

{

wdContext.node<>().setLeadSelection(i);

valuset.put(wdContext.current<>().get<code>(),wdContext.current<>().get<desc>());

}

Regards,

Sunitha