cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in DropDownByKey

Former Member
0 Kudos

Hi all,

I want to add values to the dropdownbykey UI Element at run time. Also I want to know how to get the selected item in the dropdown at runtime.

If anybody knows let me know Please.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I hope this code will help you:

monthName :-Is value attribute of type string.

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

// Set allowed values for this data type

IModifiableSimpleValueSet values = myType.getSVServices()

.getModifiableSimpleValueSet();

values.put("0", "January");

values.put("1", "February");

values.put("2", "March");

values.put("3", "April");

values.put("4", "May");

wdContext.currentContextElement().setMonthName("4");

to get the selected value:

1. create an action and add that action to your dropdownbykey.

2. On action write this code:

wdContext.currentContextElement().getMonthName()

Regards,

Rajeev

Message was edited by: Rajeev Ranjan

Former Member
0 Kudos

Hi,

Thanks a lot for your time and code.

I need the data for dropdown to be fetched from SAP R3 at run time.

Is i am able to follow the same approach as you said for this also.

Former Member
0 Kudos

Hi,

Yes I think you can use this code to populate your dropdown once you get data from r/3 system.

Regards,

Rajeev

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Krishnaveni,

You can try this link to set the BAPI values into Dropdown

kind regards

Mukesh