cancel
Showing results for 
Search instead for 
Did you mean: 

Drop down data Population

lokesh_kamana
Active Contributor
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos