cancel
Showing results for 
Search instead for 
Did you mean: 

DropDown by Index in table control

Former Member
0 Kudos

Hi,

I have this problem with dropdows placed into table control:

When I have inputbox placed into table insted of dropdown, user input written into input box was saved directly into context element on what the table control is binded (and this context node is then saved to DB). But dropdown saves its values to different element in sub-node of main node on which is table binded.

What is the best approach to solve this?

Many thanks for asnwer!

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Why use a drop down by index within a table control? The necessary nesting of the nodes makes this more complicated to deal with. It seems like a better approach to use the drop down by key which can be bound directly to an attribute of the context node of the table control itself. The only reason I can think why you might possibly want drop down by index in this case is if you need a different value set for the DDLB for each row.

Former Member
0 Kudos

Hi,

many thanks for answer. And yes, my table has many rows, each with dropdown and user can change value of each dropdown (and then save this changed data back to DB), so I think I need dropdown by index in the table for this scenario.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Hi,

> many thanks for answer. And yes, my table has many rows, each with dropdown and user can change value of each dropdown (and then save this changed data back to DB), so I think I need dropdown by index in the table for this scenario.

Nothing you described there would require DDLB by Index instead of DDLB by Key. As long as the value sets in each DDLB are the same across rows, the DDLB By Key would actually be simplier.

Former Member
0 Kudos

Hi,

I'm using dropdown by key, but how to fill them with values? With dropdown by index I use special context node, but how with dropdown by key?

Many thansk for answer!

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Do you mean how do you fill the value set of the DDLB By Key? If you are using a DDic element with a fixed domain of values bound to the DDLBByKey, then the value set is filled automatically. If you want to fill the value set yourself, the you use the context api IF_WD_CONTEXT_NODE_INFO=>SET_ATTRIBUTE_VALUE_SET.

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/bb/69b441b0133531e10000000a155106/frameset.htm

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

many thanks Thomas and Lekha, now is all working.

Many thanks!

Former Member
0 Kudos

If the subnode to whcih the dropdwpn is filled is under the main node to whcih the tbale is bound, tehn you might be facing this probelm..

In that dropdwpn selection handler, you must capture the data and modify that internal table with this data for that record..

You could have taken sepearate node for dropddown right...why have you taken as a part of main node..