on 01-03-2007 11:01 AM
Hi,
I've created a application in webdynpro where i have 2 dropdownbykey list boxes.. One is Course Group listbox and other is the Course Type list box. Once i select a value in Couse Group listbox, the onselect event is triggered and some set of code is executed to populate the corresponding values in the Course Type list box. The application is activated and also works, but while testing i faced a problem....
When i select a value from Course Group corresponding Course Type is listed but when i select a course type and go back to select a course group again(repeating the same process) then the error condition is arising that "The ASSERT condition was violated".
I'm not able to get what exactly is the problem and why is it arising.... Please help me out...
Thanks,
Sachidanand.B
Hi Sachidanand.B,
Perhaps the error is caused because the function for populating the second Drop-downbox is called for the second time and that this causes problems.
Could you provide some more information, such as code and a more specific error message?
Regards,
Jos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The first dropdownbykey list box is binded with a context attribute of type string, In WDDOINIT method the values for that attribute are filled using following code,
method wddoinit .
data:
node_info type ref to if_wd_context_node_info,
itl_key_value_set type wdy_key_value_table,
wa_key_value_set type wdy_key_value.
*Get the object reference to the root node.
node_info = wd_context->get_node_info( ).
select egrid egrsht from zwhrvmegroup into wa_key_value_set.
insert wa_key_value_set into table itl_key_value_set.
endselect.
*set values to the context attribute
node_info->set_attribute_value_set( name = 'FLIGHT_TYPE_DYN'
value_set = itl_key_value_set ).
endmethod.
When a value is selected in Ist dropdown, the OnSelect Event is triggered and the following code is executed to fill up the 2nd context attribute(string type) which is associated with 2nd dropdownbykey listbox.
method onactionselect .
data:
elem_context type ref to if_wd_context_element,
node_info type ref to if_wd_context_node_info,
stru_context type if_demo_screen=>element_context,
itl_key_value_set type wdy_key_value_table,
wa_key_value_set type wdy_key_value,
item_flight_type_dyn like stru_context-flight_type_dyn.
*get element via lead selection
elem_context = wd_context->get_element( ).
*get single attribute
elem_context->get_attribute(
exporting
name = `FLIGHT_TYPE_DYN`
importing
value = item_flight_type_dyn ).
*Get the object reference to the root node.
node_info = wd_context->get_node_info( ).
*fill values into the table of type wdy_key_value_table.
clear itl_key_value_set.
refresh itl_key_value_set.
select etyid etysht from zwhrvmetype
into wa_key_value_set
where egrid eq item_flight_type_dyn.
insert wa_key_value_set into table itl_key_value_set.
endselect.
if itl_key_value_set is not initial.
*set values to the context attribute
node_info->set_attribute_value_set( name = 'COURSE_TYPE'
value_set = itl_key_value_set ).
endif.
endmethod.
When a value is selected in 2nd dropdown, an empty method is executed.
method onactionselect_course .
endmethod.
Error Message:
The URL http://appln.server.com:8000/sap/bc/webdynpro/sap/ztestdropdownkey/ was not called due to an error.
Note
The following error text was processed in the system NSP : The ASSERT condition was violated.
The error occurred on the application server KURINJI_NSP_00 and in the work process 1 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
Method: RENDER_VIEW of program CL_WDR_CLIENT_SSR=============CP
Method: RENDER_MAIN_WINDOW of program CL_WDR_CLIENT_SSR=============CP
Thanks,
Sachi
The problem is that you are trying to insert new records into the node.
Then you will get this dump because the program already has found the same entry and therefore can't insert these entries. The key already exists.
Try clearing your context node for the second dropdown list before inserting the new values.
I think that might help.
Use the method node_info->remove_dynamic_attributes( ).
Or clear the entire context node with the method node->set_static_attributes_null( ).
Regards,
Jos
Hi Jos,
I tried both methods, but i faced an error stating,
"Access over 'ZERO' object reference not possible"
I placed the statements in the onselect method of the Ist dropdown and tested. It showed the error in the beginning of the screen.
When i placed th e statement in the onselect event of th second controller, then the screen renders but when i select a value in second dropdown it again shows same error..
Thanks,
Thomas: Can u please tell me what to do to avoid it. My both attriutes are of string types.
Hi Sachidanand,
This problem occurs because your course type values are already bound to the context node and in populating your drop down box you will be binding it again. It will fail here.
Invalidate the course type node by calling Node_Course_Type->Invalidate( ). Then populate the drop down, it should work fine.
Let me know if this helps.
Regards
Nithya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Which Data Element are you using?
Maybe you are trying to fill the value_set with values in conflict with the DDIC.
Let me know...
Sergio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sachi,
The value speficied in selectedKey is not inside of the valueSet and is not initial either.
Best regards,
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The Dump will have you answer. St22.
Most likely the contents you added to the attribute set violate the field type of the attribute in question. EG Numeric, with chars, length wrong etc.
Cheers
Phil.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.