cancel
Showing results for 
Search instead for 
Did you mean: 

ALV without context data

Former Member
0 Kudos

Hi,

how can I handle an ALV when no context data exists?

Should it be disabled or is there an attribute like 'ON_NO_DATA' or something like that?

During program flow I can happen that the binded context node could be empty.

Any solution for that?

Regards, Steffen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

check this code...

when your context node is empty, use this code to display some text.

l_value->if_salv_wd_table_settings~set_empty_table_text( value = 'TEXT' ).

Thanks

Suman

Answers (1)

Answers (1)

steffen_weber
Employee
Employee
0 Kudos

Hi,

thanks a lot, your answer helped me to solve my query.

Here the complete code I used in order to display a text notification directly in the ALV table when the binded context node is empty.

DATA:
    lr_cmp_usage TYPE REF TO if_wd_component_usage,
    lr_com_controller_if TYPE REF TO iwci_salv_wd_table,
    lr_alv_config TYPE REF TO cl_salv_wd_config_table,
    lr_table_setting TYPE REF TO if_salv_wd_table_settings.

* get alv config object and set text
  lr_cmp_usage = wd_this->wd_cpuse_alv( ).
  lr_com_controller_if = wd_this->wd_cpifc_alv( ).
  lr_alv_config = lr_com_controller_if->get_model( ).
  lr_table_setting ?= lr_alv_config.

  lr_table_setting->set_empty_table_text( value = lv_your_text ).

Best regards, Steffen