on 09-24-2009 10:05 AM
Hye techies..
I am learning webdynpro Abap.. i have implemented the UI dropdown by key using WDR_TEST_EVENT.
When i have implemented exactly it is working fine.
I have created a node from data dictonary SBOOK. binded the value SMOKER whcih is the attribute to the dropdown key.. the cardinality of the node is set to 0..1. The smoker has 2 values in its value range. when using the node-> attribute bidning it is giving an error
*Context Path SBOOK.SMOKER Cannot Be Resolved (Last Node Is Empty) *. Please help.
Also help me to fill the dropdown values, through code by using dropdown by key.
Regards,
imran.
Hi,
Have you bound the selectedkey property of drp key to the context attribute smoker.
Create a context attribute somker type S_SMOKER. BInd the selected key proeprty to this attribute. Automatically the values will be made available in dropdown. No explicit coding is required.
This works fine.
Regards,
Lekha.
Edited by: Lekha on Sep 24, 2009 3:16 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
if u r using drop down by key , than proceed like this :
1 declare a context node of cardinality 0..1
2 declare attribute of type string under it . The attribute name should be exactly the same as that in database table '
eg if u want to poulate values for a field ' SYS' from table , than giv the attribute name as 'SYS' in context attribute
3 declare internal table of type standard table
4 populate internal table with values
5 take the refernce of the node , u have created
6 bind it with the internal table
here is one code as an example for ur reference
u can look for ur code in the similar lines
..
TYPES: BEGIN OF str_roles,
-> role TYPE z0cz_roles-role_id,
-> END OF str_roles.
->DATA: it_role TYPE TABLE OF str_roles,
-> wa_role TYPE str_roles.
->DATA: value1 TYPE wdy_key_value,
-> set TYPE wdy_key_value_table.
-> SELECT role_id FROM z0cz_roles INTO TABLE it_role.
->SORT IT_ROLE DESCENDING BY ROLE.
-> LOOP AT it_role INTO wa_role.
-> value1-key = sy-tabix.
-> value1-value = wa_role-role.
-> APPEND value1 TO set.
-> ENDLOOP.
-> 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('CN_DROPDOWN').
->node_info->set_attribute_value_set( name = 'CA_ROLE' value_set = set ).
I hope it wud help u
rgds,
amit
Hi,
I have also created the SMOKER attribute type S_SMOKER under DEMO node with cardinality (1:1) and bound this attribute to the selectedKey property of the drp key.
Everything is working fine. No explicit coding is requried to have the dropdown values as S_SMOKER has fixed values.
Check the cardinality...
Edited by: Lekha on Sep 24, 2009 3:37 PM
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.