cancel
Showing results for 
Search instead for 
Did you mean: 

unable to get values into dropdownbykey from sap backend .

Former Member
0 Kudos

Please post procedure for getting dropdownbykey options from sap backend.

KotiReddy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Koti Reddy,

DropDownByKey provides static data in DropDown and DropDownByIndex makes it dynamic.

DropDownByKey: Dropdown by key is a UI element which is having key-value pair. You can put this key- value using the SVS service or from the dictionary simple type.

When u want to use data dictionary type.For this create a dictionary of simple type in the dictionary.

Creating the Simple Type:

Ur project>dictionaries>Data Types-->Simple Types right click and select Create Simple Type.

After entering the name and package, open that and click on "enumeration" tab at the bottom of the same. Now add the Value and Description to be displayed.The created simple type can be used for DropDownByKey.

Binding it to the UI element:

Now create a valueattribute and change the type to the dictionary type(created simple type). Finally bind the DropDownByKey UI element to the value attribute.

DropDownByIndex: Is used while we have to get the data from the database. Here we directly bind the DropDownByIndex UI element to the context node(attribute).

Regards,

Jhansi Miryala

Former Member
0 Kudos

I have to display 3 options yes , No - same leave ,No - different leave in the dropdown .These options comes from sap ecc backend.

I should return A ,if user select yes , B if user selects No-same leave and C if user selcts No-different leave.

which dropdown shouldbe used bykey / byindex?

and please post sample code.

Koti Reddy

Former Member
0 Kudos

Hi Koti Reddy,

Either you can use the DropDownByKey or DropDownByIndex.If you want to use the DropDownByKey then create a Simple Type with the required values and pass it to the RFC.

If they haven't done any code regarding this in the backend and If you want to use DropDownByIndex then while passing the values to the backend put the if-else condition and pass the values.

if(yes){

//pass A to the backend

}

elseif(No - same leave){

//pass B to the backend

}else{

//pass C to the backend

}

Thanks n Regards,

Jhansi Miryala

Answers (0)