cancel
Showing results for 
Search instead for 
Did you mean: 

Populating DropdownByKey by accessing backend

Former Member
0 Kudos

Hi All,

As i am new to this Webdynpro and SAP,I want to know how should I populate the value in Dropdown list box by Accesing Bapi Functions.I want to show all of my available networks (BAPI_NETWORK_GETLIST) in Dropdown list.Is there any document for that,Could anyone plz suggest me some pdfs.

Thankx in Advance.

Shakthi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Shakthi,

If u want to populate values using a DropDownByKey UI Element this code will help you.

IWDAttributeInfo ainfo = wdContext.node<<NodeName>>().getNodeInfo().getAttribute("<<Value Attribute that is bound to the Drop Down by Key element>>");

ISimpleTypeModifiable st = aiinfo.getModifiableSimpleType();

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

for(int i=0;i<wdContext.node<<name of the node>>().size();i++)

{

vs.put(Key,Value}

}

Also go through the following link to know more about Drop Down by key element.

http://help.sap.com/saphelp_nw04/helpdata/en/08/13dbfb6e779743bb2ca641ebcb3411/frameset.htm

Check this for a sample application using Drop Down by key UI element.

http://help.sap.com/saphelp_nw04/helpdata/en/c6/a5d4a523bf4b4c9085a114e46c6ed3/frameset.htm

Also check out the following discussion in forum :

https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/s...

Hope this helps.

Regards,

Vijith

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Shakthi,

If you execute the BAPI with only these three ilnes(i.e without giving any input data),all the avaialble networks will be returned.

If you want to specify some input parameters like max_rows or any table, you can do so by setting it using input.set....().

Execute the BAPI by writing the following three lines :

1) Bapi_Network_Getlist_Input input = new Bapi_Network_Getlist_Input();

************

You can specify the input parameters here eg: max_rows

input.setMax_Rows(10);

*************

2) wdContext.nodeBapi_Network_Getlist_Input().bind(input);

3) wdContext.currentBapi_Network_Getlist_InputElement().modelObject().execute();

Hope this helps,

Regards,

Nibu.

Former Member
0 Kudos

Hi Vijith Kumar,

Thanks for your timely help.The problem is almost solved I think.If I have any Doubt moreover I'll get in touch.

Thankx again.Thanks for all.

With Luv,

Shakthi

Former Member
0 Kudos

Hi,

Sorry, I do not have any documents to refer for you. But to implement the said functionality, create a Dropdown by index UI element, map the "texts" property to the BAPI's return node's attribute (Bapi_Network_Getlist_Input.Output.Network_List.Network). When the BAPI is executed, the dropdown will be automatically populated. Hope this helps

1) Create a model out of Bapi_Network_Getlist.

2) Map the Bapi_Network_Getlist_Input node across the model,controller & the view.

3) Create a dropdown by index UI element & map it's "texts" property to Bapi_Network_Getlist_Input.Output.Network_List.Network or Bapi_Network_Getlist_Input.Output.Network_List.Short_Texts whichever you want.

4) Execute the BAPI by writing the following three lines :

Bapi_Network_Getlist_Input input = new Bapi_Network_Getlist_Input();

wdContext.nodeBapi_Network_Getlist_Input().bind(input);

wdContext.currentBapi_Network_Getlist_InputElement().modelObject().execute();

The dropdown will be populated with the result.

Regards,

Nibu

Message was edited by: Nibu Wilson

Former Member
0 Kudos

Hi Nibu Wilson,

Thankx for your great help.I got solution for this.

Thank you again.

With luv,

Shakthi.

Former Member
0 Kudos

Hi Nibu Wilson,

If I added that 3 lines of code.But in 3rd line

wdContext.currentBapi_Network_Getlist_InputElement(?).modelObject().execute();

What parameter I have to pass in ?

Plz let me know.

Thank you.

With Luv,

Shakthi

0 Kudos

Hi

get a drop down by index UI and map the node of the BAPI (which has the data to be populated)to the "texts" property of the drop down UI. that should do. hope it helps.

regards,

shyam.