cancel
Showing results for 
Search instead for 
Did you mean: 

Error message when running editable alv

Former Member
0 Kudos

Hi all,

I hava a problem with an editable ALV. I created it with the following method wddoinit:

METHOD wddoinit .

  • initialize ALV Component

DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.

l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).

IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.

l_ref_cmp_usage->create_component( ).

ENDIF.

  • Get model data

DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .

l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).

DATA:

l_value TYPE REF TO cl_salv_wd_config_table.

l_value = l_ref_interfacecontroller->get_model( ).

  • set read only mode to false (and display edit toolbar)

DATA: lr_table_settings TYPE REF TO

if_salv_wd_table_settings.

lr_table_settings ?= l_value.

lr_table_settings->set_read_only( abap_false ).

  • set cell editor for input fields (~make colum editable)

DATA: lr_column TYPE REF TO cl_salv_wd_column.

DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,

lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.

lr_column_settings ?= l_value.

lr_column = lr_column_settings->get_column( 'SAMPLE' ).

CREATE OBJECT lr_input_field

EXPORTING

value_fieldname = 'SAMPLE'.

lr_column->set_cell_editor( lr_input_field ).

ENDMETHOD.

But when I run the Web Dynpro Application I get an error message with the note:

"Access over "Null" Object Reference not possible" ( I translated it from german to english )

The error occures in the line:

lr_column->set_cell_editor( lr_input_field ).

But what is wrong?

Thanks for your help!!

Regards

Ingmar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Sorry. I'm stupid. I didn't the "Sample" for column and field!!!

But:

How can I reach that not only one cell is editable, but the whole table? And how can I save the data that I put in, when I add a new line?

Thanks!!

Answers (0)