on 09-17-2008 5:55 AM
Hi All,
I have to create an alv with user defined buttons in wd abap on its toolbar.Could any one tell me in detail about it or provide me with any tutorial based on it.
Thanking you all in advance.
DATA: LR_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.
DATA: LR_INTF_ALV TYPE REF TO IWCI_SALV_WD_TABLE.
LR_CMP_USAGE = WD_THIS->WD_CPUSE_ALV( ).
IF LR_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) EQ ABAP_FALSE.
LR_CMP_USAGE->CREATE_COMPONENT( ).
ENDIF.
LR_INTF_ALV = WD_THIS->WD_CPIFC_ALV( ).
WD_THIS->M_MODEL = LR_INTF_ALV->GET_MODEL( ).
DATA: LR_FUNCTION TYPE REF TO CL_SALV_WD_FUNCTION.
LR_FUNCTION =
WD_THIS->M_MODEL->IF_SALV_WD_FUNCTION_SETTINGS~CREATE_FUNCTION(
ID = 'ISSUE' ).
DATA: LR_BUTTON TYPE REF TO CL_SALV_WD_FE_BUTTON.
CREATE OBJECT LR_BUTTON.
LR_BUTTON->SET_TEXT( 'Issue/Receive' ).
LR_FUNCTION->SET_EDITOR( LR_BUTTON ).
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please check this code.
*ALV Component usage
data: l_ref_cmp_usage type ref to if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
l_ref_cmp_usage->create_component( ).
endif.
*Call Get_model() of Interface Controller to set changes to the output
*table
data: l_ref_interfacecontroller type ref to iwci_salv_wd_table .
l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
data:
l_value type ref to cl_salv_wd_config_table.
l_value = l_ref_interfacecontroller->get_model(
).
*Add buttons to Toolbar
data:lr_function type ref to cl_salv_wd_function,
lr_toggle_button type ref to cl_salv_wd_fe_button,
lref_toggle_button type ref to cl_salv_wd_fe_a_button.
lr_function = l_value>if_salv_wd_function_settings~create_function( id
= 'SAVE' ).
create object lr_toggle_button.
lref_toggle_button ?= lr_toggle_button.
lr_toggle_button->set_text( 'Save' ).
lr_function->set_editor( value = lr_toggle_button ).
thanks
suman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.