on 04-15-2011 6:27 AM
Hi All,
Below is the code i executed for Drop down list for a field in my Alv table. But i get a error like "Access via 'NULL' object reference not possible". Can any one please tell me what mistake i have done please.
data: lo_interfacecontroller type ref to iwci_salv_wd_table .
lo_interfacecontroller = wd_this->wd_cpifc_assesstment_alv( ).
data: lt_valueset type table of wdr_context_attr_value,
ls_valueset type wdr_context_attr_value.
data : lv_value type ref to cl_salv_wd_config_table,
lo_value type ref to cl_salv_wd_config_table.
DATA ls_assesstment1 type table of if_v_main=>element_assesstment.
lv_value->if_salv_wd_table_settings~set_data_check( if_salv_wd_c_table_settings=>data_check_on_cell_event ).
data: lr_column1 type ref to cl_salv_wd_column,
lr_dropdown type ref to cl_salv_wd_uie_dropdown_by_key.
lo_value = lo_interfacecontroller->get_model( ).
lo_value->if_salv_wd_table_settings~set_read_only( abap_false ).
lr_column1 = lo_value->if_salv_wd_column_settings~get_column( id = 'weightage' ).
create object lr_dropdown exporting selected_key_fieldname = 'weightage'.
lr_column1->set_cell_editor( lr_dropdown ).
data: lr_node type ref to if_wd_context_node,
lr_nodeinfo type ref to if_wd_context_node_info.
lr_node = wd_context->get_child_node( 'assesstment' ).
lr_nodeinfo = lr_node->get_node_info( ).
lo_nd_assesstment = wd_context->get_child_node( name = wd_this->wdctx_assesstment ).
lo_el_assesstment = lo_nd_assesstment->get_element( ).
call method lo_nd_assesstment->get_static_attributes_table importing table = ls_assesstment1.
ls_valueset-value = 'first'.
ls_valueset-text = 'first'.
append ls_valueset to lt_valueset.
ls_valueset-value = 'second'.
ls_valueset-text = 'second'.
append ls_valueset to lt_valueset.
lr_nodeinfo->set_attribute_value_set(
exporting name = 'weightage' value_set = lt_valueset ).
Hi Vadiv,
Goto ST22 and check at which point you are getting error.
and do this...
lr_column1 = lo_value->if_salv_wd_column_settings~get_column( id = 'weightage' ). // give 'WEIGHTAGE' as caps.
lr_node = wd_context->get_child_node( 'assesstment' ). // 'ASSESSTMENT'..
where ever you are using at single codes make it CAPS and try.
Cheers,
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
St22-> click on TODAY button.. go to your error by double clicking.. in left side you have ABAP DEvelopment View - in that
you have source code extract.. double click on that.. you wil go to source code.. just scroll down there at line number some where you get >>>> instead of line no... there your code have some problem..
Have tried by changing code value to CAPS... then what is the result.
Cheers,
Kris.
Hi vadiv ,
Might be some Instance varibale is initial.Can you check it in T-Code ST22 in which line u r getting dump.
Regards,
Vijay
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.