Skip to Content
avatar image
Former Member

Drop down list

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Apr 15, 2011 at 05:35 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 15, 2011 at 05:41 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded