cancel
Showing results for 
Search instead for 
Did you mean: 

make title header with image in wd-alv

Former Member
0 Kudos

hello,

the code

DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.

    l_ref_cmp_usage =   wd_this->wd_cpuse_usage_alv( ).
    IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
      l_ref_cmp_usage->create_component( ).
    ENDIF.

* Holen des ALV Configuration Model

 DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .

* referenz auf alv component interface
 l_ref_interfacecontroller =   wd_this->wd_cpifc_usage_alv( ).
   DATA:
     l_value TYPE REF TO cl_salv_wd_config_table.

* get ConfigurationModel from ALV Component
   l_value = l_ref_interfacecontroller->get_model(
   ).
DATA: myHEADER type ref to CL_SALV_WD_HEADER.

CALL METHOD l_value->if_salv_wd_table_settings~delete_header( ).

CALL METHOD l_value->if_salv_wd_table_settings~CREATE_HEADER
  receiving
    value  = myHEADER
    .

CALL METHOD myHEADER->set_image_source( 
      value  =  '/sap/public/xy/logo.png' ).

myHEADER->set_text( 'test' ).

doesn´t show the image and my set text in the title when I test my application.

whats wrong?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I found my fault. I started the set_data-method (binding context node to alv) at last and so the settings and changes of my alv-configuration-model become deleted.

Former Member
0 Kudos

Hello,

The same code works for me as is. Can you just debug and see whether the control comes to the statements provided by you?

Regards,

Neha

Former Member
0 Kudos

thanks for your answers.

DATA: myHEADER type ref to CL_SALV_WD_HEADER.

CALL METHOD l_value->if_salv_wd_table_settings~get_header
       receiving
        value = myHEADER .

CALL METHOD myHEADER->set_image_source( 
      value  =  '/sap/public/xy/logo.png' ).

myHEADER->set_text( 'test' ).

I debugged it. the text is written in myHEADER and the graphic is set but it´s not shown in internet explorer.

should I enable my changed header or something? what´s my fault?

Former Member
0 Kudos

Hello,

Just try this. Sometimes its a problem for me too. Just create a new Z-application and see if it works in that. It might not, but it is worth a try (sometimes this actualy works for me 😛 )

Regards,

Neha

Former Member
0 Kudos

Neha that doesn´t reach my aim.

hmm I try additionally

CALL METHOD l_value->if_salv_wd_table_settings~set_visible_row_count
  EXPORTING
    value  = 4.

but it´s ignored too. All my settings are ignored.

I placed my code in the wddoinit of my componentcontroller and not in a view method. could this be a fault?

Former Member
0 Kudos

Hi,

try pasting it in your wdmodifyview method of the correct view

or at least but it in the wddoinit of your view

grtz,

Koen

Former Member
0 Kudos

>>try pasting it in your wdmodifyview method of the correct view

>>or at least but it in the wddoinit of your view

I made it but nothing changes...the output is like pasting the code in a method of my componentcontroller

Former Member
0 Kudos

has no one an idea?

Message was edited by:

Thorsten Winter

Former Member
0 Kudos

Hi,

could you try to use the function get_header instead of delete_header

and use that instance to set text and image?

grtz,

Koen