cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I think you would have specified the used component in your WDP component level properties. Please check if you ALV component usage is added in the Properties tab of your view also. This error occurs if it is not added.

Check this and let me know if your error is solved.

Regards,

Nithya

Former Member
0 Kudos

hI,

I am facing this issue. I have added the ALV component in the properties tab of the view also. But still i am getting this syntax error. Can anyone please advise?

The ALV table i have just created in not editable. i want to make it editable. So i am trying to add the below code which is failing.

  • create an instance of ALV component

DATA:

lr_salv_wd_table_usage TYPE REF TO if_wd_component_usage.

lr_salv_wd_table_usage = wd_this->wd_cpuse_alv( ).

IF lr_salv_wd_table_usage->has_active_component( ) IS INITIAL.

lr_salv_wd_table_usage->create_component( ).

ENDIF.

  • get ALV component

DATA:

lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.

lr_salv_wd_table = wd_this->wd_cpifc_alv( ).

wd_this->alv_config_table = lr_salv_wd_table->get_model( ).

  • set visible row count

DATA:

lr_table_settings TYPE REF TO if_salv_wd_table_settings.

lr_table_settings ?= wd_this->alv_config_table.

lr_table_settings->set_read_only( abap_false ).

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Did you name your component usage ALV? In wd_this->wd_cpuse_alv( ) the last part of the method name is dynamic based upon the name of the component usage (so you can have more than one ALV usage within one component).

It would be wd_this->wd_cpuse_<name>() where name is the component usage name. Therefore the method wd_this->wd_cpuse_alv( ) is only used when the component usage name is ALV. If you named the usage XYZ, then the method call would be wd_this->wd_cpuse_xyz( ).

Former Member
0 Kudos

Thanks for your advise Jung. The syntax error is gone now. But the ALV table is still in read-only mode. Can you help?

Please abide by the rules of the forum and stick to one question per thread. BTW It's Thomas not Jung.

Edited by: Neil Gardiner on Nov 5, 2010 8:09 AM

thomas_jung
Developer Advocate
Developer Advocate
Former Member
0 Kudos

Sorry abt that Thomas. Thanks. I am not sure how to change the cell editor to textedit instead of text view as this is a view container where i am physically not able to see the table colums in the layout. I will post this as a new question.

Former Member
0 Kudos

Pl can anyone suggest on this.

thanks,

Sharada