Skip to Content
0
Former Member
Feb 14, 2007 at 11:58 AM

error is wd_cpuse_alv is unknown or its private or protected. .

436 Views

Hello All,

I ahve dynpro SALV_WD_TABLE which display few buttons in toolbar.

I want to add one more new button to that toolbar.

I have got sample code which says it will create a function assign it toolbar.

In that code there is reference to interface contrroller and code has to be placed in wddoinit.

I have placed below code in wddoinit of a view it but gives me error

wd_cpuse_alv is unknown or its private or protected. .

Pl can you suggest on this.

DATA lr_buttonui type REF TO CL_SALV_WD_FE_BUTTON.

DATA button1 TYPE REF TO CL_SALV_WD_FUNCTION.

data: l_ref_interfacecontroller type ref to iwci_salv_wd_table .

data: l_value type ref to cl_salv_wd_config_table.

data: lr_table_settings type ref to if_salv_wd_table_settings.

data: lr_header type ref to CL_SALV_WD_HEADER.

data: l_ref_cmp_usage type ref to if_wd_component_usage.

l_ref_cmp_usage ?= wd_this->wd_cpuse_alv( ).

*l_ref_cmp_usage ?= wd_comp_controller->GET_CONTROL_VIEW_USAGE( ).

if l_ref_cmp_usage->has_active_component( ) is initial.

l_ref_cmp_usage->create_component( ).

endif.

**

l_ref_interfacecontroller ?= wd_this->wd_cpifc_alv( ).

l_value = l_ref_interfacecontroller->get_model( ).

lr_table_settings ?= l_value.

lr_header = lr_table_settings->get_header( ).

lr_header->set_text( 'FLIGHT LIST SEARCH' ).

CREATE OBJECT lr_buttonui.

lr_buttonui->SET_TEXT( 'Search Flights' ).

button1 = l_VALUE->IF_SALV_WD_FUNCTION_SETTINGS~create_function( id = 'LBUTTON' ).

button1->SET_EDITOR( lr_buttonui ).

thanks,

Sharada