on 03-26-2009 11:54 AM
Hi ,
I am using the following code for visibility of a container , have done with binding. Its comming up with an error saying as below :
*****************************************************
The following error text was processed in the system RDU : Access via 'NULL' object reference not possible.
The error occurred on the application server HCCR3DEV2_RDU_00 and in the work process 0 .
The termination type was: RABAX_STATE
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_visible LIKE ls_context-visibility_1.
if lv_budg_mang_check_box = ' '. "Based on some condition
lv_visible = '02'.
lo_el_context->set_attribute(
EXPORTING
name = 'VISIBILITY_1'
value = lv_visible ).
endif.
Please let me know if there are any corrections to the above code
Thanks,
Kumar
Hi,
In your code the reference for lo_el_context is missing........
lo_el_context = wd_context->get_child_node( wd_this->element_context ).
This wil solve your problem..
Thanks,
Shailaja Ainala.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kumar,
Simply use the code wizard to set the value to an attribute. Don't remove any code (for the generated code) because it could lead to dump. Just press ctrl + F7 and select the attribute name and simply pass the value. It'll work.
Regards
Arjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
The code has run with out any problem, But when the condition is 'X' it should display the view which its not doing in for both conditions . Could you please let me know where i am going wrong ?
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_visibility_1 LIKE ls_context-visibility_1.
if lv_budg_mang_check_box = ' '. "Based on some condition
lv_visibility_1 = '01'.
get element via lead selection
lo_el_context = wd_context->get_element( ).
get single attribute
lo_el_context->get_attribute(
EXPORTING
name = `VISIBILITY_1`
IMPORTING
value = lv_visibility_1 ).
else.
lv_visibility_1 = '02'.
get element via lead selection
lo_el_context = wd_context->get_element( ).
get single attribute
lo_el_context->get_attribute(
EXPORTING
name = `VISIBILITY_1`
IMPORTING
value = lv_visibility_1 ).
endif.
Thanks,
Kumar.
Hi
use modify your code like this.
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_visibility_1 LIKE ls_context-visibility_1.
if lv_budg_mang_check_box = ' X'. "Based on some condition
lv_visibility_1 = '02'.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* get single attribute
lo_el_context->get_attribute(
EXPORTING
name = `VISIBILITY_1`
IMPORTING
value = lv_visibility_1 ).
else.
lv_visibility_1 = '01'.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* get single attribute
lo_el_context->get_attribute(
EXPORTING
name = `VISIBILITY_1`
IMPORTING
value = lv_visibility_1 ).
endif.
It will help You.
Regards,
Rohit
Hi Kumar,
The code which you have written, in that you are using get_attribute, instead you need to use set_attribute method.
The code should be like:
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_visibility_1 LIKE ls_context-visibility_1.
if lv_budg_mang_check_box = ' '. "Based on some condition
* get element via lead selection
lo_el_context = wd_context->get_element( ).
lo_el_context->set_attribute(
EXPORTING
name = `VISIBILITY_1`
value = cl_wd_uielement=>e_visible-none ).
else.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
lo_el_context->set_attribute(
EXPORTING
name = `VISIBILITY_1`
value = cl_wd_uielement=>e_visible-visible). "values like 01 or 02 should not be hard coded.
endif.
I hope it helps.
Regards
Arjun
Hi Kumar,
Where exactly r u getting dump?
Try to create an atribute of type char1 in the context to map with property 'visible'.
then apply following logic to make it visible
if lv_budg_mang_check_box = ' '. "make it visible
lv_visible = 'X'.
else " make it invisible
lv_visible = ' '. "space
endif.
lo_el_context->set_attribute(
EXPORTING
name = 'VISIBILITY_1'
value = lv_visible ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.