cancel
Showing results for 
Search instead for 
Did you mean: 

Need Dropdownbykey and Index code completely in webdynpro ABAP

SatyaGade
Explorer
0 Kudos

Hi Experts,

I want to populate the data into drop down by key and drop down by indexes ,but I am getting error while binding in DdbIndex property text as type compatible If any one knows send me the complete code to populate values into Ddbkey and Index .

Regards,

Satya.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member199125
Active Contributor
0 Kudos

hi Satya,

May i know the exact error you are getting.Anyhow use the below code for DDBK.

For displaying static values in DDBK there are two techniques

1) by directly binding with dataelement

2) with hardcoding

1)Bind an attribute to SELECTED KEY property of DDBK . And attribute should be type of DATA ELEMENT.

That Dataelement should contain fixed values in corresponding domain, then automatically all those fixed values wil be displayed in DDBK

2) with hardcoding

creat a node and an attribute with string data type and assign that attribute to selected key property of DDBK / RGBK / inputfield

goto wddoinit() and implement code like below

data: lt_valueset type wdr_context_attr_value_list,

ls_value type wdr_context_attr_value.

data:

node_info type ref to if_wd_context_node_info.

node_info = wd_context->get_node_info( ).

node_info = node_info->get_child_node( ' DDBK Node' ). '' this should be in capital letters

ls_value_value = 'value1''

ls_value_text = 'text1'.

insert ks_value into table lt_valueset.

ls_value_value = 'value2''

ls_value_text = 'text2'.

insert ks_value into table lt_valueset.

  • like above you can pass as many values as you want

node_info->set_attribute_value_set( name = 'DDBK ATTRIBUTE NAME''

value_set = lt_valueset ).

Hope above code will be useful.

Regards

Srinivas

Former Member
0 Kudos

Hi Satya,

For DDBI and key code related check this..

DDBI

http://www.sapdev.co.uk/sap-webapps/sap-webdynpro/table-dropdown.htm

Cheers,

Kris.

Former Member
0 Kudos

Hi,

Check your node cardinality. Probably it is 0 to n. In that case you need to create the element of the node. Use Pattern and Wizard to get the code to populate the value.

Regards,

Pradip