cancel
Showing results for 
Search instead for 
Did you mean: 

DropdownbyKey -- unable to display binded values

Former Member
0 Kudos

Hi All,

I'm new to Web dynpro ABAP.

I want to display all values for different fields(eg. AA,LH for field carrid) from the table SFLIGHT.

I have created a node, added all necessary attributes to the node and finally binded the attributes to the dropdowndbykey component in a view. Now when I test the application n click on the dropdown button I get a blank (no values are present for any of the attributes) dropdown.

Can anyone tell me wat i'm doing wrong n wat I'm supposed to do.

Thanks in Advance

Murli.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

For the values what is the Select Query you have written .

Select carrid from SFLIGHT into table t_sflight upto 100 rows.

( You can change the query for your own list of records).

Or In debugging check the internal table for the values. I think the table is intiital.

Or check the VALUESET table for the initital or not.

We fill this VALUESET table using the t_sflight internal table values.

Please have a look at this sample code-



select * from t005t into corresponding fields of table lt_t005t  where
           spras = 'E'.
sort lt_t005t by land1 descending.


 lr_node = wd_context->get_child_node( 'COUNTRY' ).
  lr_nodeinfo = lr_node->get_node_info( ).

*GET the database table values into internal table and fill lt_valueset
*like the example

  read table lt_t005t into ls_t005t index 1.
  ls_valueset-value = ls_t005t-land1.
  ls_valueset-text = ls_t005t-landx.
  append ls_valueset to lt_valueset.


  read table lt_t005t into ls_t005t index 2.
  ls_valueset-value = ls_t005t-land1.
*   Key that is bound to context attribute
  ls_valueset-text = ls_t005t-landx.
  append ls_valueset to lt_valueset.

  read table lt_t005t into ls_t005t index 3.
  ls_valueset-value = ls_t005t-land1.
  ls_valueset-text = ls_t005t-landx.
  append ls_valueset to lt_valueset.

  lr_nodeinfo->set_attribute_value_set(
  exporting
  name = 'LAND1'
  value_set = lt_valueset ).

You can replace the READ with the LOOP for 'N' values.

Here i have bound only 3 values.

In the context Node 'COUNTRY', I have boiund the SelectedKey value to the LAND1.

Regards

Lekha

Answers (4)

Answers (4)

Former Member
0 Kudos

Thank u everyone for ur time and expertise.

Regards,

Murli

former_member342104
Participant
0 Kudos

write code to doinit method.

DATA: TABLE TYPE TABLE OF TABLENAME

DATA : test TYPE REF TO IF_WD_CONTEXT_NODE_INFO.

test = WD_CONTEXT->GET_NODE_INFO( ).

test = NODE_INFO->GET_CHILD_NODE( `BC` ).

FIELD-SYMBOLS: <ABC> TYPE TABLENAME.

CALL METHOD CL_WD_DYNAMIC_TOOL=>GET_TABLE_DATA

EXPORTING

TAB_NAME = TABLENAME'

ROW_COUNT = 0

IMPORTING

DATA = TABLE.

LOOP AT TABLE ASSIGNING <ABC> .

VALUE-KEY = <ABC>-FIELDNAME.

VALUE-VALUE = <ABC>-FIELDNAME.

INSERT VALUE INTO TABLE VALUE_SET.

ENDLOOP.

TEST->SET_ATTRIBUTE_VALUE_SET( NAME = `BC` VALUE_SET = VALUE_SET ).

Former Member
0 Kudos

...

Content removed by moderator because the link provided was not related to the question of this thread.

Edited by: Thomas Jung on Oct 23, 2008 9:19 AM

Edited by: Thomas Jung on Oct 23, 2008 9:20 AM

Former Member
0 Kudos

Hi,

First of all what do you want to display.do you want to display all the values of carrid of sflight in drop down list am i right?

check this sample extract. page no is 35

http://www.sap-press.de/download/dateien/1079/sappress_web_dynpro_for_abap.pdf