cancel
Showing results for 
Search instead for 
Did you mean: 

[Webdynpro java]Population of data in a dropdown List box

Former Member
0 Kudos

I am creating a view which has to populate all the "employee names" in a dropdown list from

which a have to choose one employee.....after that I would click "go" button which displays the details of the corresponding employee.

Let the employee names are in "EMPLOYEE" table in SQL DB.

Please let me know the corrsponding UI element to be used and how to access and map to display all the employee names in the dropdown list.

Here I found two UI elements

"DropdownbyIndex" and "DropDownByKey".....please let me know the correct UI element to be used.

Regards,

Cris

Accepted Solutions (0)

Answers (4)

Answers (4)

saraswathi_d
Participant
0 Kudos

Hi,

Refer the below link you will get useful information

Dropdownlist to display r3 table

see this link for when to use DropDownByIndex (DDI) vs DDK (DropDownByKey) and how populate data from R/3.

create context value attribute and bind to drop down by key

Dynamically adding values to dropdown by key thread

Dropdown by key

http://help.sap.com/saphelp_nw04/helpdata/en/4a/8613e41629344194e4f40393740d51/content.htm

Regards,

Saraswathi.

Pls reward points for useful info

Message was edited by: Saraswathi D

sridhar_k2
Active Contributor
0 Kudos

Hi Cris,

You can use either DropDown - Index or Key.

Use the below code for DropDownByKey Control. This control gives you Key of the Selected Emplpoyee.

For this create a Context element(Employee) and assign it to the DropDown "selectedKey" Property.


IContextElement conElement=wdContext.currentContextElement();
IWDNodeInfo nodeInfo=wdContext.getNodeInfo();
IWDAttributeInfo aInfo=wdContext.getNodeInfo().getAttribute("Employee");
IModifiableSimpleValueSet dropValueSet=matAttrInfo.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
String employeeName =null;
int nodeLength=wdContext.node<Response>().size();
for(int i=0;i<nodeLength;i++)
{
employeeName =String.node<Response>().getEmployee();
dropValueSet.put(employeeName ,employeeName );
}

Regards,

Sridhar

Former Member
0 Kudos

Hi

Thanks for quick response.

The Thread which is provided contains the "web services part".

Please let me know the process to populate the data into dropdown list box.

Regards,

Cris

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Cris,

Sorry see this thread:

Regards, Suresh KB

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Cris,

I got this content from experts.

It's very interesting question: DropDownByIndex (DDI) vs DDK (DropDownByKey).

Here is how I usually choose between both:

if (I need not to have different values per row in table) {

if (I do not alter valueset || valueset is from R3) {

use DDK;

}

else if (I may alter valueset) /Here I need to alter valueset/

{

if (I'm creating dynamic UI controls)

use DDK; //it is simpler

else // Design-time controls

use DDI;

}

else {

use DDI;

}

}

else {

use DDI;

}

see this thread for code:

Regards, Suresh KB