cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding caption/label on ALV toolbar

Former Member
0 Kudos

Hi All,

I wanted to provide some text on ALV toolbar. I'm on latest Netweaver version.

I can find the CL_SALV_WD_FE_A_CAPTION abstract class but not CL_SALV_WD_FE_CAPTION(something like thing) where

I can see it for button,Inout field etc.....

Is there any way to provide some label or text on ALV toolbar.... i have searched but could find none.

Regards,

Lekha.

Regards,

Lekha.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Lekha,

Did you find solution to this post  ?.

If so, Could you please post the solution as I am also in need of same functionality.

Thanks

Srikant M

Former Member
0 Kudos

No option found. Wish to see the caption to be added as a part of ALV function.

Former Member
0 Kudos

Hi All,

Still waiting for the replies.

Regards,

Lekha.

Former Member
0 Kudos

Lehka - I'm doing my research on this topic, but I haven't find how to add the CAPTION to the ALV toolbar, as soon as I find out I will post it here. Thank you for all your help in my forums.

Jason P-V

Former Member
0 Kudos

I forgot to mentioned that in the first part of the code, Data for lr_header is:

 DATA lr_header                TYPE REF TO cl_salv_wd_header. 

Jason P-V

Former Member
0 Kudos

Lekha - If you want to write something in the header, let's say a random caption you can do as follow:


  DATA lo_cmp_usage             TYPE REF TO if_wd_component_usage.
  DATA lo_interfacecontroller   TYPE REF TO iwci_salv_wd_table .
  DATA l_value                         TYPE REF TO cl_salv_wd_config_table. 

 lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ENDIF.

  lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).
  l_value = lo_interfacecontroller->get_model(  ). 

lr_header = l_value->if_salv_wd_table_settings~create_header( ).
  lr_header->set_text( 'Table for Lekha' ).

and if you want to add a field in the toolbar....



  DATA lr_custom_functions      TYPE REF TO if_salv_wd_function_settings.
  DATA lr_functions                    TYPE REF TO  if_salv_wd_std_functions.
  DATA lv_text                            TYPE string.
  DATA lr_button                         TYPE REF TO cl_salv_wd_fe_button.
  DATA lr_function                      TYPE REF TO cl_salv_wd_function.

  lr_custom_functions ?= l_value.
  lr_function = lr_custom_functions->create_function_right( 'EDIT' ).
  lr_function->set_position( '1' ).
  CREATE OBJECT lr_button.
  lv_text = '    Edit     '.
  lr_button->set_text( lv_text ).
  lv_text = 'Edit form'.
  lr_button->set_tooltip( lv_text ).
  lr_function->set_editor( lr_button ).

Regards!

Jason P-V

Former Member
0 Kudos

Hi,

Thanks for your inputs. Yes, I know that we can have an ALV header but i wanted to have caption on ALV toolbar. Buttons, Input field etc we can add but there is no option for Caption.

Regards,

Lekha.