cancel
Showing results for 
Search instead for 
Did you mean: 

how to set values in a DropDown type column

Former Member
0 Kudos

Helllo Everyone,

I need your help: How to set values (from RFC) in a DropDown type column of a table. Could anyone please advise with some sample code. (i.e. the table:is zTable; the datasource is ValueNode vNode; the dropdown column is zDP)

Thank you in advance, Jin

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member214651
Active Contributor
0 Kudos

Hi,

1. Create a context node with the attributes required for a Table

2. Create a context attribute under the Node say "DDValue"

3. Write the following code to populate value to the DD

IWDAttributeInfo attrDD = wdContext().node<ContextNode>().getNodeInfo().getAttribute("DDValue");
ISimpleTypeModifiable simpDD = attrDD.getModifiableSimpleType();
IModifiableValueSet valueDD = simpDD.getSVServices().getModifiableSimpleValueSet();
valueDD.clear();

int RFCTableSize = wdContext().node<ZtableDDValues>().size();

for(int i = 0; i < RFCTableSize; i++)
{
    I<ZtableDDValues>Element obj = wdContext().node<ZtableDDValues>().get<ZtableDDValues>ElementAt(i);
    valueDD.put(obj.get<key>(), obj.get<value>());
}

Hope this helps you

Regards,

Poojith MV

Edited by: Poojith M V on Nov 12, 2010 6:00 AM

Former Member
0 Kudos

Thank you Poojith so much for your quick reply and help with the detail code sample.

I'm going to try it and will let you know ....

Thanks again, Jin

Former Member
0 Kudos

Hi,

You can also use Dropdown by index UI in the Table. Create a Context node ( Cardinality 0:n) for the dropdown in the context node for Table.

You can populate the node as normal procedure.

Regards

Saravanan K

Former Member
0 Kudos

Thanks alot Saravanan for your help and info (sorry for my delay reply).

Could you please provide me some details / sample code (for the normal procedure)?

'Thanks, Jin

former_member185879
Active Contributor
0 Kudos

Hello Jin,

Normal procedure is nothing but, bind the output node of the BAPI directly to the DropDownByIndex.

But i dont think DropDownByIndex will work on Tables. Because if we change in any one of the Elements then all the elements in the table will take the same value. So we need to use DropDownByKey only in Tables.

Revert for any queries.

Regards

Nizamudeen SM

Former Member
0 Kudos

Thanks alot Nizamudeen for your quick reply and help.

I guess I should follow Poojith's sample code for DropDownByKey?

Any other advices (steps/sample code/any detail info are appreciated)?

Thanks, Jin