cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownByKey

Former Member
0 Kudos

Hi,

I got the material no from R/3 like this

String materialNo = wdContext.nodeY_Ep_Demo_Material_Mm_View_Output().getY_Ep_Demo_Material_Mm_View_OutputElementAt(i). getMatnr_Out();

but now i have an DropDownByKey element to which i want to add these material number dynamically....

How to do this....

Help me

Thanks & Reagards

Ravi Shankar B

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

hi

hi.....

String materialNo = wdContext.nodeY_Ep_Demo_Material_Mm_View_Output().getY_Ep_Demo_Material_Mm_View_OutputElementAt(i). getMatnr_Out();

ISimpleTypeModifiable myType=wdThis.wdGetAPI().getContext().getModifiableTypeOf("AllocateDriver.IdDriver");

IModifiableSimpleValueSet val = myType.getSVServices().getModifiableSimpleValueSet();

val.put("1" ,materialNo);

where "AllocateDriver.IdDriver" is in the form of <node>.<dropdownkey element>

Former Member
0 Kudos

Hi Ravi,

You can use DropDownByIndex rather than DropdownByKey.It is much easy to code

Regards,

Saravanan K

Former Member
0 Kudos

Why do you want to use DropDownBy<b>Key</b>?

Armin

Former Member
0 Kudos

Hi,

The DropDownByKey UI element has a property called selectedKey. You will need to populate the context variable which is bound to this property.

Create a simple type in your local dictionary, say Material, and base it on String. Create a context attribute, say MaterialNr and make it's type as Material. Bind the selectedKey property of the DropDownByKey to this context attribute.

Then once you have fetched your values, loop through the BAPI output node and use a code like this:


IWDAttributeInfo aInfo = wdContext.getNodeInfo().getAttribute("MatrialNr");
if(aInfo != null){
IModifiableSimpleValueSet valSet = aInfo.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
valSet.put("Key_1",<your String value here>);
}

Regards,

Satyajit.

Message was edited by: Satyajit Chakraborty

Former Member
0 Kudos

Hi Satyajit,

I have a similar requiremt, like I hardcode these values as said by you exactly, but while inserting in the database, it shud be stored like FERT for Finished Product in database, but when i run my appl->in my DropDown list it shud show like Finished Product.

When i Click on save button it shud store like FERT in database. Also plz let me know the sample code for saving/writing to database, wdInit(),onActionSave() methods....Plz help me no one is answering my question.My Bapi does the work of saving.

Thanks in advance.

Former Member
0 Kudos

Hi ganesh,

Your Key is "Fert" And Value is Finished Product, To show the Value and store the Key as invisible,

Create the node with two atrributes Key and Value

Set the Value as Selected Key of Dropdown Index by Key.

when you load the values into dropdown,Set the Key attribute with Key and Value attribute with Value

After Loading it,

Get the current Keyvalue as wdContext.Current<Drop>Element.get<Attribute>;

and set it as an input to the BAPI

Regards

Saravanan K