on 11-27-2006 4:47 PM
Hello to all:
How I can to change the texts of the buttons what appear by defect in the ALV element of Web dynpro Abap, like 'Delete line' or 'Exporting to excel'. etc.???
Thanks in advance.
Hi Ana,
Here is coding please implement in your coding it will change the text of standard ALV Button.
**-- First check ALV component usage
DATA: lr_salv_wd_table_usage TYPE REF TO if_wd_component_usage.
lr_salv_wd_table_usage = wd_this->wd_cpuse_alv_viewer( ).
IF lr_salv_wd_table_usage->has_active_component( ) IS INITIAL.
lr_salv_wd_table_usage->create_component( ).
ENDIF.
**-- Get data cinfiguration data for ALV Table
data: lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
lr_salv_wd_table = wd_this->wd_cpifc_alv_viewer( ).
**-- (1) get ConfigurationModel from ALV Component
data : lr_functions type ref to if_salv_wd_function_settings,
lr_functions= lr_salv_wd_table->get_model( ).
**-- Standard Function ID you will get from lr_functions
lr_function = lr_functions->get_function_std(Function ID of Standard Button ).
lr_function->text = 'Put the text you want'.
This code has been tested and working really fine. Please let me know if you have any questions on that.
Give me your feed back on that,
Chandresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the new solution.
DATA: lo_function_dpwty TYPE REF TO cl_prs_std_alv_funct,
lr_functions TYPE REF TO if_salv_wd_function_settings,
lr_function_std TYPE REF TO cl_salv_wd_a_function_std.
CREATE OBJECT lo_function_dpwty
EXPORTING
id = 'X'.
lr_functions = l_ref_interfacecontroller->get_model( ).
" append row rename
lr_function_std = lr_functions->get_function_std( if_salv_wd_c_std_functions=>edit_append_row ).
lv_button_text = 'Add Item'.
lo_function_dpwty->change_text( EXPORTING text = lv_button_text
CHANGING std_function = lr_function_std ).
"Delete row item rename
lr_function_std = lr_functions->get_function_std( if_salv_wd_c_std_functions=>edit_delete_row ).
lv_button_text = 'Delete Item'.
lo_function_dpwty->change_text( EXPORTING text = lv_button_text
CHANGING std_function = lr_function_std ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi everybody,,,,,,i use the code ,,but when i check ,,there is an error , it says the lr_function is unknown ,,my question is , what class i have to use to make lr_function ref to?...thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In Order to change the Text of Button, you need to use the class CL_SALV_WD_UIE_BUTTON with proper method of reading text and than change the text of this Button. with the help this class you can change design of the button.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.