Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

WDP ALV settings set_edit_mode doesn't work

Hello, I am trying to add some rows to my ALV report, so I am using this code:

method ONACTIONADD_ENTRIES .

DATA: lr_comp_alv           TYPE REF TO if_wd_component_usage,

       lr_comp_if_alv        TYPE REF TO iwci_salv_wd_table,

       lr_config             TYPE REF TO cl_salv_wd_config_table.

lr_comp_alv = wd_this->wd_cpuse_alv( ).

   IF lr_comp_alv->has_active_component( ) IS INITIAL.

     lr_comp_alv->create_component( ).

   ENDIF.

   lr_comp_if_alv = wd_this->wd_cpifc_alv( ).

*... Configure ALV

   lr_config = lr_comp_if_alv->get_model( ).

   lr_config->if_salv_wd_table_settings~set_edit_mode(

       IF_SALV_WD_C_TABLE_SETTINGS=>edit_mode_mass

          ).

endmethod.

This method executes when the user press a Button, but once it is called the new rows doesn't appear.
However, if I press the standard ALV buttons "Append Row" or "Insert Row" the new rows from the mode_mass appear and also the new inserted/appended row.
I don't know what I am missing.

Thank you for your time and help

Former Member
Former Member replied

Hi,

To have new row on action of your button, you need to add a row to your table's context.

i.e. on action of your button,

  • Read the data data of your alv tables' context node

         

          data lt_data type wd_this->elements_<<NAME_OF_NODE>.

          '..... get node reference

          '..... read data from node

          lo_node->get_static_attributes_table(

                         importing

                              table = lt_data  )

          append initial line to lt_data.

          lo_node->bind_table( new_items = lt_data )

Hope this helps you.

Regards,

Rama

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question