cancel
Showing results for 
Search instead for 
Did you mean: 

Getting values from a domain

Former Member
0 Kudos

Hi!

When I enter fix values into a domain, it is appearing automatically through the data element in an element of a view (like a dropdown by key). That's nice, it is working perfectly.

However if I don't use fix values in the domain, but I use a value table, the table entries are not appearing automatically. Do I have to code it in the wddoinit, or is there an easier way for showing in the view's dropdown element, the values from the domain's value table?

Thank you

Tamá

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, Just fetch data from your value table and bind it to the node. You can use dropdownbyindex. Create a node; cardinality 0:n -> create an attribute ( keep the attribute name same as the field name of your value table; this will help reduce the coding ) Now use the follwing code;

Data: l_node type ref to if_wd_context_node.
Data: lt_values type wd_this->elements_nodename.

" fetch data from value table.
  Select text            " fieldname
      from .............. into lt_values.

l_node  = wd_context->get_child_node( 'NODENAME' ).
l_node->bind_table( lt_values ).
Regards, Radhika.

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

If you want to use a value table of your own creation, you can set it into the context using IF_WD_CONTEXT_NODE_INFO=>SET_ATTRIBUTE_VALUE_SET. You can then use a *ByKey UI element against this context attribute and it will act just like the domain values from the DDic.

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