cancel
Showing results for 
Search instead for 
Did you mean: 

ALV: Dump adding new dynamic column

RicardoRomero_1
Active Contributor
0 Kudos

HI all,

I'm creating an ALV with dynamic columns. The creation works fine.
Now, I have a button to add new columns, but I'm doing something wrong, i'm getting a dump after set a cell editor.

This is my code;

   *    Add a new attribute to the context node;
     lo_nd_tabla_alv = wd_context->get_child_node( name = 'TABLA_ALV' ).
     lo_nd_tabla_alv_info = lo_nd_tabla_alv->get_node_info( ).
     ls_attribute_info-name = 'TEST'.
     ls_attribute_info-type_name = 'XFELD'.
**     ls_attribute_info-IS_STATIC = 'X'.
     CALL METHOD lo_nd_tabla_alv_info->add_attribute
       EXPORTING
         attribute_info = ls_attribute_info.

*    Add a column to the ALV;
     lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
     lo_model = lo_interfacecontroller->get_model( ).
     CALL METHOD lo_model->if_salv_wd_column_settings~create_column
       EXPORTING
         id       = 'TEST'
**         POSITION = lv_position
       receiving
         value    = lo_column.

*    Until this point works fine, the column is displayed properly if I don't set the cell editor

*    but if I try to set a cell editor is dumping !!!
     CREATE OBJECT lo_checkbox
       EXPORTING
         checked_fieldname = 'TEST'.
      CALL METHOD lo_column->set_cell_editor
        EXPORTING
          value = lo_checkbox.


The dump says:

"Could not find attribute TEST "

I can see the attribute TEST in my node info, so I don't know what I'm doing wrong....

Do you know what can be the problem?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please try out with the full path along with the node name.

  1. CREATE OBJECT lo_checkbox 
  2.        EXPORTING 
  3.          checked_fieldname = 'TABLA_ALV.TEST'. 

Hope this helps.

RicardoRomero_1
Active Contributor
0 Kudos

Hi, thanks for reply.

I've tried this, but is still dumping... now with "UNCAUGHT_EXCEPTION".

I've also tried adding an input field but I also get the same dumps...

Any idea?

Former Member
0 Kudos

Hi,

I tried to replicate your issue.

The first dump that is coming can be resolved.

Use the code like this.

  1.   lo_interfacecontroller = wd_this->wd_cpifc_alv( ). 
  2. lo_interfacecontroller->Set_data(  lo_nd_tabla_alv ).
  3.      lo_model = lo_interfacecontroller->get_model( ).

You are getting the first dump because the node changes after the configuration. We need to bind it again. 

Try if this works for you.

Former Member
0 Kudos

Also, only use 'TEST' as the field name not 'TABLA_ALV.TEST'

RicardoRomero_1
Active Contributor
0 Kudos

Yeah! this is the problem !
Thanks !!!

Answers (0)