on 06-19-2008 2:01 PM
Hi all,
I had a requirement in which i need to display the data from a model object in a drop down.
Here my model is from import RFC model i created BAPI and getting the data from The BAPI.
can anyone send me the code for this particular thing.
Thanks & regards,
Lokesh
Hi Lokesh,
First of all take the data that has to be displayed in dropdown which comes from Bapi into an arraylist.
Use the following code
lsCounterNode=new ArrayList();
//Initilizing an arraylist to hold the data of the dropdown
int iC=wdContext.node<Resultant node of bapi>().size(); //to get the number of counters
String strC[]=new String[iC]; //An array to store the values
for(int iIndex=0;iIndex<iC;iIndex++) //Rotate the loop to get all the values
{
strC[iIndex]=wdContext.node<Resultant node of bapi>().<Resultant node of bapiElementAt(iIndex).getVall();
}
if(strC.length>0 && strC!=null)
{
for(int j=0;j<strC.length;j++)
{
IPrivate<View name>.I<Value node> countval= wdContext.create<Valuenode name>Element();
countval.setVal(strC[j]);
lsCNode.add(countval);
}
} //end if
wdContext.node<value node>().bind(lsCounterNode);
Regards
Padma N
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lokesh,
Use the DropDownByIndex UI element and bind it to the context attribute in which you are getting data. When you run your application you will get the data in the Dropdown.
Thanks & Regards,
Jhansi Miryala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Refer this
http://help.sap.com/saphelp_nwce10/helpdata/en/4a/8613e41629344194e4f40393740d51/content.htm
http://help.sap.com/saphelp_nwce10/helpdata/en/08/13dbfb6e779743bb2ca641ebcb3411/content.htm
Edited by: Sudhir Gorantla on Jun 19, 2008 3:39 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.