cancel
Showing results for 
Search instead for 
Did you mean: 

remove some items from Dropdown by Key

Former Member
0 Kudos

Hi

I have a Dropdown by key UI element which populates list of countries (from a BAPI). I have to change the dropdown so it displays only one country. How can I remove other countries that dont need to be displayed in the list. Any help is appreciated.

Thanks,

Jai

Accepted Solutions (1)

Accepted Solutions (1)

p330068
Active Contributor
0 Kudos

Hi Jai,

Poojith is correct. Based on the condition you need to set value to value set as you only want one value.

Cheers

Arun Jaiswal

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

If the list of countries is used only at one place and u need to display only one country then better ask your Abaper to send only the required country Else u can follow the procedure suggested above.

Regrads

Surender Dahiya

former_member214651
Active Contributor
0 Kudos

Hi,

When u add the values using the IModifableValueSet API to add the values of countried from a BAPI, check for the condition and then add.

Eg:

ISimpleTypeModifiable simpleType = wdContext().getNodeInfo.getAttributeInfo("<attributeName binded to the DD>").getSimpleTypeModifiable();
IModifiableValueSet valueSet = simpleType.getSVServices().getModifiableValueSet();

valueSet.clear();

for(int i = 0; i < <Size of the BAPI table of countries>; i++)
{
  if(condition)
  {
    valueSet.put(countryKey, countryValue);
  }
}

This will help u in adding those values based on the condition. Hope this helps you.

Regards,

Poojith MV