cancel
Showing results for 
Search instead for 
Did you mean: 

How to set a default value for DBDK based on condition.

Former Member
0 Kudos

Hi All,

I got to know how to fill the values for drop down by key and filled in all the values now i have a flag in my table.

if that flag value is 'X' for that particular vendor then only that value should be shown as default. Please let me know.

Thanks,

Sandy.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member199125
Active Contributor
0 Kudos

depends on your logic just use set attribute statement.

and just pass the value( in value and text in valueset ) using the set attribute statement . thats it.

For example check below my sample coding( this is not complete code )

      l_value-value = '30'.

     l_value-text = 'Casual Leave'.

     insert l_value into table lt_valueset.

     l_value-value = '10'.

     l_value-text = ' Priviliged Leave'.

     insert l_value into table lt_valueset.

     node_info->set_attribute_value_set( name = 'ALEAVETYPE' value_set = lt_valueset ).

** for default value

     lo_el_nleavedetails->set_attribute(  exporting   name =  `ALEAVETYPE`

             value = '10' ).

Regards

Srinvias

Former Member
0 Kudos

Thanks Srinivas it helped me and thanks harshith.

Former Member
0 Kudos

Hi,

First get all the vendor which have flag 'X' into an internal table which is of type

WDR_CONTEXT_ATTR_VALUE_LIST and then bind this internal table using the

method SET_ATTRIBUTE_VALUE_SET of interface IF_WD_CONTEXT_NODE_INFO.

data : node_info type ref to if_wd_context_node_info.

data:  lt_valueset type wdr_context_attr_value_list.

*****get your values into lt_valueset*****

node_info = wd_context->get_node_info().

node_info->set_sttribute_value_set(value_set = lt_valueset)