cancel
Showing results for 
Search instead for 
Did you mean: 

How to get static values into DropDown list and save to database?

Former Member
0 Kudos

Hi all,

In my appl, I have 2 dropdown lists and some input feilds. How to populate static values into dropdown lists. In Dropdown lists, the values are like FinishedProduct and the corresponding database value is FERT.I mean while storing into the database, it shud be stored like this. How to do this? Plz give me step-by-step procedure. Help me. Its urgent.

Thanks a lot.

Accepted Solutions (0)

Answers (2)

Answers (2)

chintan_virani
Active Contributor
0 Kudos

I do not see the BAPI call to save the values....

<b>- Chintan</b>

Former Member
0 Kudos

Hi,

If you want to show values in Dropdown UI Element create one node(SampleDrop) with one attribute(productid) and bind into DropDownByIndex UIElement's text property.

Using the following code to load data into dropdown UIElement.

IPrivate<ViewName>.ISampleDropNode node=wdContext.nodeSampleDrop();

node.invalidate();

int j=0;

while(j<5){

IPrivate<ViewName>.ISampleDropElement ele=wdContext.createSampleDropElement();

ele.setProductid("Product"+j);

node.addElement(ele);

j++;

}

in the above code add 5 values into dropdown UI Element. If you want to access selected value use the following code:

String prodid=wdContext.currentSampleDropElement().getProductid();

while selecting the first dropdown,you have to add coresponding value to second dropdown. use the following code. Create action and bind into First dropdown's onSelect Event and put the following code:

String prodid=wdContext.currentSampleDropElement().getProductid();

Then you have to pass prodid into database then get coressponding value. After execute SQL query you store value into Resultset(rs).

IPrivate<ViewName>.I<SeconddropdownNode> snode=wdContext.node<SeconddropdownNode>();

snode.invalidate();

while(rs.next()){

IPrivate<ViewName>.I<SeconddropdownNode>Element ele=wdContext.create<SeconddropdownNode>Element();

ele.setPrice(rs.getString("ColumnName"));

snode.addElement(ele);

}

As same as first drop down you can get second dropdown value.

Kind Regards,

S.Saravanan.

Former Member
0 Kudos

Hi,

Thanks for your inputs. I have to show values like FinishedProduct in dropdown list. which is easy readable format, but the actual value is 'FERT' in database. How to do this? When i select Finished product from dropdown lits, it shud store as FERT in database. The way am following is displaying by means of SimpleValuesSelector. By declaring some Values and desc in Enumaeration tab of Local Dictionary->DataType->Simple Type->Industry_Sector &

LocalDictionary->DataType->SimpleType->Material_Type.I am displaying the Description in dropdown list. While inserting into the databse it shud its corresponding value which FERT for Finished Product. The code am writing in wdDoInit() method of View.

public void wdDoInit()

{

//@@begin wdDoInit()

Y_Ep_Demo_Material_Mm_View_Input ip=new Y_Ep_Demo_Material_Mm_View_Input();

IWDMessageManager msg= wdComponentAPI.getMessageManager();

ip.setMbrsh(wdContext.currentContextElement().getIndustry_Sector());

ip.setMtart(wdContext.currentContextElement().getMaterial_Type());

wdContext.nodeY_Ep_MatInst().bind(ip);

//@@end

}

Correct me where&what code shud i write to get this done?

Help me.

Thanks a lot.