cancel
Showing results for 
Search instead for 
Did you mean: 

No Active component...alv header in webdynpro

Former Member
0 Kudos

Hello all...

I am trying to put a alv header...but it is giving me following error:

Component Usage ALV_FLIGHTS Does Not Have an Active Component

any ideas...what could be the cause...

Thanks...

I am using the following code in my wddoinit method for output view:

data: l_ref_interfacecontroller type ref to iwci_salv_wd_table ,

l_value TYPE REF TO cl_salv_wd_config_table,

lr_header TYPE REF TO cl_salv_wd_header,

lr_table_settings type ref to if_salv_wd_table_settings,

l_header type string.

l_ref_interfacecontroller = WD_THIS->WD_CPIFC_alv_flights( ).

l_value = l_ref_interfacecontroller->get_model( ).

lr_table_settings ?= l_value.

lr_header = lr_table_settings->get_header( ).

concatenate sy-sysid ' Flight overview' into l_header.

lr_header->set_text( lr_header ).

lr_header->set_tooltip( 'Tooltip Flight Overview' ).

lr_header->set_image_source( 'ICON_FLIGHT' ).

lr_header->set_image_first( abap_false ).

View Entire Topic
Former Member
0 Kudos

Hello,

Try this:


data: 

 lr_alv_usage TYPE REF TO if_wd_component_usage,

l_ref_interfacecontroller type ref to iwci_salv_wd_table ,
l_value TYPE REF TO cl_salv_wd_config_table,
lr_header TYPE REF TO cl_salv_wd_header,
lr_table_settings type ref to if_salv_wd_table_settings,
l_header type string.



* Instantiate ALV Component
  lr_alv_usage = wd_this->wd_cpuse_alv_flights( ).
  IF lr_alv_usage->has_active_component( ) IS INITIAL.
    lr_alv_usage->create_component( ).
  ENDIF.



* get reference to model
  lr_ref_interfacecontroller = wd_this->wd_cpifc_alv_flights( ).
  lr_config        = lr_if_controller->get_model( ).

lr_table_settings ?= l_value.
lr_header = lr_table_settings->get_header( ).


concatenate sy-sysid ' Flight overview' into l_header.
lr_header->set_text( lr_header ).
lr_header->set_tooltip( 'Tooltip Flight Overview' ).
lr_header->set_image_source( 'ICON_FLIGHT' ).
lr_header->set_image_first( abap_false ).

Regards.