on 07-15-2008 3:45 PM
hello...
i m fetching data frm r/3 system...
but how to display this data in a drop down list.....
i refered so many links which explained by using creating a simple type n displaying data
here i dont hav any simple type. im using bapi to get data
could you please provide me code to display the data in drop dwn
thanks in advance
renu
Renu,
try the following:
ISimpleTypeModifiable attrType = wdThis.wdGetAPI().getContext().getModifiableTypeOf("Output.Flightlist.AirlineID");
IModifiableSimpleValueSet valueSet = attrType.getSVServices().getModifiableSimpleValueSet();
int size=wdContext.nodeFlight_List().size();
for (int i = 0; i < size ; i++)
{
valueSet.put(i, wdContext.nodeFlight_List().getFlight_ListElementAt(i).getAirlineid());
}
Note that, in the first statement give the correct path of the Context Node. ("Output.Flightlist.AirlineID")
Try this and let me know.
--MLS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Renu,
Is your table binded to nodeFlight_List(),then try this steps
1.String dropdownvalue = wdContext.currentFlight_ListElement().getAirlineid();
2.Create a for loop with the node size() of the table, i.e, for(int i=0;i>nodeFlight_List().size();i++)
3.Inside the for loop, check for the if condition(dropdownvalue.equals(wdContext.nodeFlight_List().getelementat(i).getAirlineid()). If the condition is false remove that elements.
Regards,
Lakshmanan.
Hi Pls. try the Following.
1. Use adaptive RFC while creating a model...
2.the output node of flight_getlist_input to ur controller context..
3. map the same from controller to view.
4. execute the bapi and dont forget to invalidate the output node.
5. map the node u want to see to a table. chck if this is working..
6. next try it with deropdownby index UI...
Reward useful answer..
Yusuf
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are two ways of using drop down
1)Dropdown by Key
Create an attribute under a node and bind the key property of the ui element to this attribute
IWDAttributeInfo attributeInfo =
wdContext.node<nodename>().getNodeInfo().getAttribute("<attributename>");
ISimpleTypeModifiable attrType = attributeInfo.getModifiableSimpleType();
IModifiableSimpleValueSet valueSet =
attrType.getSVServices().getModifiableSimpleValueSet();
//Iterate over your model node and populate valueset
int size=wdContext.node<ModelNode>().size();
for (int i = 0; i < size ; i++){
valueSet.put(wdContext.node<ModelNode>().get<ModelNode>ElementAt(i).get<attr1>(),wdContext.node<ModelNode>().get<ModelNode>ElementAt(i).get<attr2>());
}
2)Dropdown by index
Bind text property of ui elemnt to one of the attributes under value node. The binded attribute's value will be shown as the text in dropdown. To access other attributes value you can use wdContext.current<modelnode>element().get<attributename>();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Here node is output
child node is flightlist
under chilnode haivng some attributes like, airlineid,airlinename etc..,
my code is like this
IWDAttributeInfo attributeInfo = wdContext.nodeFlight_List().getNodeInfo().getAttribute(Airlineid);here i m getting error airline id is not resolved
ISimpleTypeModifiable attrType = attributeInfo.getModifiableSimpleType();
IModifiableSimpleValueSet valueSet = attrType.getSVServices().getModifiableSimpleValueSet();
// Iterate over your model node and populate valueset
int size=wdContext.nodeFlight_List().size();
for (int i = 0; i < size ; i++)
{
valueSet.put(wdContext.nodeFlight_List().getFlight_ListElementAt(i).getAirlineid(),
wdContext.nodeFlight_List().getFlight_ListElementAt(i).getAirlineid());
}
in valueSet.put()what i mentioned above is wrong.what should i mention above to get values?
regards,
Renu
Renushree,
use a dropdownbyIndex uielement and bind the attribute to the texts property of this element.
What is the structure of your bapi?
--MLS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
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.