cancel
Showing results for 
Search instead for 
Did you mean: 

dropdown by key

Former Member
0 Kudos

hi

I have desinged a form using NWDS in that it consists of a UI element DROP DOWN BY KEY for this the values must get populated as soon as the user runs the application.

the values to be populated must come from a table which is present in the SAP R/3..

can anyone tell me the code how to do this

thanks in advance

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hey,

if you populate the values in input screen side then the varaible should have contain key-value pair of values then only u can bind to DDK.

if your variable coming with KEY-VALUE pair of values u can bind to your UI Element DDK in Input form.

If it is O/P

itterate the output node values and bind to ur DDK.

Thanks,

Lohi.

Former Member
0 Kudos

Hi,

To Populate values into Dropdown by Key ........

IWDAttributeInfo attr = wdContext.getNodeInfo().getAttribute(<attributename>);

ISimpleTypeModifiable sim = attr.getModifiableSimpleType();

IModifiableSimpleValueSet vs = sim.getSVServices().getModifiableSimpleValueSet();

for(int i=0; i<wdContxt.node><outputnode>().sixe();i++)

{

String temp = wdContext.node<outputnode>().getElementAt(i).get<attribute>();

vs.put(temp,temp);

wdContext.currentContextElement().set<attribute>(<value>);

}

Thanks

Sunitha Hari.

Former Member
0 Kudos

Hi Sunitha,

I'm having the same scenario as what you have mentioned. I'm having some 25 names and 5 dropdowns. i'm populating 5 names in each dropdowns based on their user group respectively.

I'm getting all the 25 names in a single attribute and user group in the another attribute. i'm looping it out and binding it to the appropriate dropdown.

And its working fine.

Now i need to save the selected name from each dropdown along with their respective user group. The same way i need to pass all the 5 selected names to the single attribute along eith their user group. the same format with which i got the input.

Help me with detailed procedure.

Thanks & Regards,

Suresh

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Rev,

You create method for pupulating dropdown list from R/3 system. Call the method in doinit() this will list the dropdown value while application loading itself.

Refer the following link for sample code: [Populating dropdown list|;

Regards, Suresh KB

Former Member
0 Kudos

Hi

To access a table in R/3, you hav to create one RFC which can give you the contents of the table,

for that RFC you can create an Adaptive RFC Model in Webdynpro Project and access it in your application.

Refer to the link below

[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/11c3b051-0401-0010-fe9a-9eabd9c216de|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/11c3b051-0401-0010-fe9a-9eabd9c216de]

Regards

Deepak

Former Member
0 Kudos

hai,

try

{

IPrivateKv_bus.IKvnodeNode kvlevel=wdContext.nodeKvnode();

List lis=new ArrayList();

for(int i=0;i<4;i++)

{

if(i==0)

{

IPrivateKv_bus.IKvnodeElement el11 = kvlevel.createKvnodeElement();

el11.setKvlevel("Select kvlevel");

lis.add(el11);

}

if(i!=0)

{

IPrivateKv_bus.IKvnodeElement el11 = kvlevel.createKvnodeElement();

el11.setKvlevel("kvlevel"+i);

lis.add(el11);

}

}

kvlevel.bind(lis);

}

catch(Exception e)

{

}

I have hard coded the values here instead you run a for loop for the size of table in database and get the values and set in in el11.setkvlevel("your value").

Thanks n Regards

Sharanya.R