on 05-17-2009 7:36 AM
Hello WD Experts,
I am receiving this message.
Access via 'NULL' object reference not possible
The ABAP call stack was:
Method: WDDOMODIFYVIEW of program /1BCWDY/5NRD5TKGE1K9JUDKWN52==CP
I have no presumption or idea how this error could result.
Maybe someone had already something similar and can give me crucial hint.
I know just where the program dumps within the Coding:
CONCATENATE `CALCULATOR.` WD_COMP_CONTROLLER->value_help_listener->f4_attribute_info-name into l_binding_string.
component controller's public Attribute defined as :
VALUE_HELP_LISTENER type ref to IF_WD_VALUE_HELP_LISTENER
Friendly Regards
ilhan Ertas
Edited by: Ilhan Ertas on May 17, 2009 8:39 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Radhika,
as mentioned I have originally copied all the code from Thomas Jung.
He was adviced me to do it as follows.
To your question: Yes I did otherwise where else should I heve this method.
It was implemented automatically by the runtime envoronment
You can also try to implement the below example
you will have also a dump
MET set_value_help_listener .
wd_this->value_help_listener = listener.
****Check the data type of the source field - it must be a date data type.
IF wd_this->value_help_listener->f4_attribute_info-rtti->type_kind NE cl_abap_typedescr=>typekind_numeric.
ENDIF.
DATA lo_nd_calculator TYPE REF TO if_wd_context_node.
DATA lo_el_calculator TYPE REF TO if_wd_context_element.
data dyn_node_info type ref to if_wd_context_node_info.
lo_nd_calculator = wd_context->get_child_node( name = wd_this->wdctx_calculator ).
dyn_node_info = lo_nd_calculator->get_node_info( ).
dyn_node_info->add_attribute( wd_this->value_help_listener->f4_attribute_info ).
ENDMET.
met DOMODI .
data lo_tc type ref to cl_wd_transparent_container.
data lo_inputfield type ref to cl_wd_input_field.
if first_time = abap_true.
lo_tc ?= view->get_element( 'TC_INPUTFIELD' ).
data l_binding_string type string.
CONCATENATE `CALCULATOR.` WD_COMP_CONTROLLER->value_help_listener->f4_attribute_info-name
into l_binding_string.
lo_inputfield = cl_wd_input_field=>new_input_field(
bind_value = l_binding_string
enabled = abap_true
id = 'VH_INPUT'
* length = '20'
read_only = abap_true
view = view
* visible = E_VISIBLE-VISIBLE
* width = width
).
data flow type ref to CL_WD_FLOW_DATA.
flow = CL_WD_FLOW_DATA=>new_flow_data(
* cell_design = E_CELL_DESIGN-PADLESS " CELL_DESIGN
element = lo_inputfield
id = 'FLOW_ID'
* v_gutter = E_V_GUTTER-NONE " V_GUTTER
).
lo_inputfield->set_layout_data( flow ).
lo_tc->add_child( lo_inputfield ).
endif.
endmet.
yes but why is it intial. What has to be made in this case ????
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I dont understand your question correctly .......
Yes I did check it while debugging and as already mentioned it is initial. What else must be checked
with WD_COMP_CONTROLLER->value_help_listener
At the very first WDDOMODIFYVIEW is called and above mentioned line the program dumps
with the error message Access via 'NULL' object reference not possible
Did I maybe forget to insert an element under the node in the Component Controller ????
Cause I only have a node single there without any element
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There you go.. So this is your problem.
Your attribute with WD_COMP_CONTROLLER->value_help_listener is initial and you try to acces
f4_attribute_info-name as follows :
CONCATENATE `CALCULATOR.` WD_COMP_CONTROLLER->value_help_listener->f4_attribute_info-name
Hence the dump.
check if you are initializing the attribute value_help_listener i.e. are you passing any value to this attribute ?
Edited by: Radhika Vadher on May 18, 2009 3:07 PM
this line causes this error
CONCATENATE `CALCULATOR.` WD_COMP_CONTROLLER->value_help_listener->f4_attribute_info-name
WD_COMP_CONTROLLER->value_help_listener is in the debugger initial
This is strange. What has to be done to avoid this case
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
what do you mean with
setting WD_COMP_CONTROLLER->value_help_listener with the required value.
This the code:
method SET_VALUE_HELP_LISTENER .
wd_this->value_help_listener = listener.
****Check the data type of the source field - it must be a date data type.
IF wd_this->value_help_listener->f4_attribute_info-rtti->type_kind NE cl_abap_typedescr=>typekind_numeric.
ENDIF.
DATA lo_nd_calculator TYPE REF TO if_wd_context_node.
DATA lo_el_calculator TYPE REF TO if_wd_context_element.
data dyn_node_info type ref to if_wd_context_node_info.
* navigate from <CONTEXT> to <CALCULATOR> via lead selection
lo_nd_calculator = wd_context->get_child_node( name = wd_this->wdctx_calculator ).
dyn_node_info = lo_nd_calculator->get_node_info( ).
dyn_node_info->add_attribute( wd_this->value_help_listener->f4_attribute_info ).
endmethod.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
of course I can.
method WDDOMODIFYVIEW .
data lo_tc type ref to cl_wd_transparent_container.
data lo_inputfield type ref to cl_wd_input_field.
if first_time = abap_true.
lo_tc ?= view->get_element( 'TC_INPUTFIELD' ).
data l_binding_string type string.
CONCATENATE `CALCULATOR.`
WD_COMP_CONTROLLER->value_help_listener->f4_attribute_info-name
into l_binding_string.
lo_inputfield = cl_wd_input_field=>new_input_field(
bind_value = l_binding_string
enabled = abap_true
id = 'VH_INPUT'
read_only = abap_true
view = view
).
data flow type ref to CL_WD_FLOW_DATA.
flow = CL_WD_FLOW_DATA=>new_flow_data(
element = lo_inputfield
id = 'FLOW_ID'
).
lo_inputfield->set_layout_data( flow ).
lo_tc->add_child( lo_inputfield ).
endif.
endmethod.
Furthermore in view's context is also one node named CALCULATOR with no Attribut to its
below. With the other words 'Component Controller' has one node as Calculator
and the view has one node as Calculator too.
For more information refer to my posting regarding this topic.
The Code was given to me by SAP SuperMentor -> Thomas Jung
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Abhi
this value is set in the below shown. Method SET_VALUE_HELP_LISTENER is implemented
within Component Controller. What else can be the reason ?
I also have a node within Component Controller Context and View's context with the name
CALCULATOR. But there is no element under the this node. Is it necessary ?
Regards
ilhan
method SET_VALUE_HELP_LISTENER .
wd_this->value_help_listener = listener.
IF wd_this->value_help_listener->f4_attribute_info-rtti->type_kind NE cl_abap_typedescr=>typekind_numeric.
ENDIF.
DATA lo_nd_calculator TYPE REF TO if_wd_context_node.
DATA lo_el_calculator TYPE REF TO if_wd_context_element.
data dyn_node_info type ref to if_wd_context_node_info.
lo_nd_calculator = wd_context->get_child_node( name = wd_this->wdctx_calculator ).
dyn_node_info = lo_nd_calculator->get_node_info( ).
dyn_node_info->add_attribute( wd_this->value_help_listener->f4_attribute_info ).
endmethod.
Edited by: Ilhan Ertas on May 17, 2009 7:54 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
where you are setting VALUE_HELP_LISTENER, this field needs to be filled with an instance in the method SET_VALUE_HELP_LISTENER of the componentcontroller.
in WDDOMODIFYVIEW simply you are using the VALUE_HELP_LISTENER without any instance.
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.