on 02-19-2007 4:13 PM
hi everybody,,,i use this code ,,but when i check ,,there is an error , it says the <b> lr_function</b> is unknown ,,my question is , what class i have to use to make lr_function ref to?...thanks
**-- 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
<b>lr_function</b> = lr_functions->get_function_std(Function ID of Standard Button ).
<b>lr_function->text = 'Put the text you want'.</b>
lr_function should refer to the class cl_salv_wd_function.
-nithya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Lazlo,
TEXT attribute in CL_SALV_WD_FUNCTION_STD is NOT read only and is public. That mean u can directly change it using <b>lr_function->text</b>.
If u wanna use the SET_TEXT method heres how -
Yes thats a protected method, means only Subclass can access it.
Heres a round about way....
CL_SALV_WD_A_FUNCTION_STD is the Superclass for CL_SALV_WD_FUNCTION_STD .
Create a Subclass ZCL_SALV_WD_A_FUNCTION_STD that inherits from CL_SALV_WD_A_FUNCTION_STD. In this class define a method CHANGE_TEXT that has a CHANGING parameter TYPE REF TO CL_SALV_WD_A_FUNCTION_STD
So:
data <b>m_a_func_std</b> type ref to CL_SALV_WD_A_FUNCTION_STD.
m_a_func_std ?= m_alv_model->IF_SALV_WD_FUNCTION_SETTINGS~ GET_FUNCTION_STD ( 'button function' )
data <b>m_sub_a_func_std</b> type ref to ZCL_SALV_WD_A_FUNCTION_STD .
m_sub_a_func_std->CHANGE_TEXT( m_a_func_std ).
CHANGE_TEXT method...
m_a_std_func->SET_TEXT ( 'your text' ).
Thanks
Anand
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.