cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown element in table; how to bind different value sets?

matteo_montalto
Contributor
0 Kudos

Hi all,

apparently, this sounds like an easy question... however, I'm stuck at this.

Suppose to work on a Custom Web Dynpro, in which there's a simple table which shows on each row a couple:

- fixed text (Text View element);

- a dropdown field.

So... suppose we've to render this situation:

Row 1  --->  FixedText1    --> available choices: A, B

Row 2  --->  FixedText2    --> available choices: C, D

There's a binding between the table and the context, so avaiable values (A,B) and (C,D) are stored in the same context element that represents a row.

I tried using a DropDownByKey and I'd like to BIND the VALUE_SET in order to use a specific Context Path.

However, as far as I've seen, the only way to set the value_set is from NODE_INFO element; that is to say, same values in every dropdown of the given column.

Any advice? How can I have different dropdown on the same column?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Instead of Dropdown by key, you can try dropdown by index.

And the node which will be binded to the dropdown should have a supply function.

Your supply function will get called for each row and you will be able to set dynamically different values for dropdown in each row.

matteo_montalto
Contributor
0 Kudos

Hi Hitesh,

this sounds interesting... I used to manage DropdownByKey as they seems more simple to manage so I don't know much about DDByIndex.

However, your solution seems actually to be the simplest one; do you  have any sketch of code/example showing:

- how to bind the node to the dropdown ? (easy, this should be similar to the way a DDByKey is binded to the node)

- how to wrote supply function so that the VALUE_SET is dynamically calculated for each row?

Thanks again!

Sharathmg
Active Contributor
0 Kudos

Check this example: ABAP Web dynpro dropdown by index.

To replicate it in the table, you have to the same for each element, while loading/adding to the node.

Regards,

Sharath

Former Member
0 Kudos

Hi,

Please refer this Document.

If you get stuck somewhere let me know.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c03227f9-e48f-2c10-4bad-8ebdec704...

Answers (2)

Answers (2)

Sharathmg
Active Contributor
0 Kudos

In Web Dynpro Java, the runtime/dynamic value assignment to the element->variable is  accomplished using Extended Value Selector.

However, in WD ABAP that option is not available.

Check the tread and also the sap help link. It may be useful in your solution.

SVS, EVS, and OVS, Value Help and Search Help | SCN

Input Help - Developing Web Dynpro ABAP Applications - SAP Library

Regards,

Sharath

amy_king
Active Contributor
0 Kudos

Hi Matteo,

You can use table cell variants to create multiple Dropdown elements-- say Dropdown_1 with values (A,B) and Dropdown_2 with values (C,D)-- then display just one of the Dropdowns depending on the value of FixedText for the row. The document below should give you an idea of how this can work.

Cheers,

Amy

matteo_montalto
Contributor
0 Kudos

Hi Amy and thanks for your help,

I've seen your tutorial, my scenario is however a bit different because I have to handle various rows in my table ( I don't know table's cardinality in terms of rows - and different dropdowns - if not at runtime ).

So, I can't work on cell variants statically as you did in your tutorial; I should proceed with dynamic programming and handle even cell variant creation at runtime.

This could be a feasible solution, even if it seems quite complex.... Suppose my table will be populated at runtime with 100 rows. As I told before, each row has an attribute of type WDR_ELEMENT_SET which contains the available entries for the dropdown.

I should at runtime create 100 different cellvariants...