cancel
Showing results for 
Search instead for 
Did you mean: 

Drop down list

Former Member
0 Kudos

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 ).

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Thanks for your reply will try doing your valuable suggestions.

Former Member
0 Kudos

Hi,

i went to ST22 but i am not able to find in which line the error has occured.And i tried to cahnge the name in capital but still it is showing the same error.

Former Member
0 Kudos

Hi,

Go to souce code.. you will find some arrows ... >>> there you have problem.

cheers,

Kris.

Former Member
0 Kudos

hi sorry kissnas i dont find any source code options here in st22

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi kissnas thanks for your help my problem got resolved.

Former Member
0 Kudos

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