cancel
Showing results for 
Search instead for 
Did you mean: 

removing "Export to excel" option from ALV

Former Member
0 Kudos

Hi Experts

Is it possible to remove "Export to Excel" option from an ALV in Web Dynpro.

Thanks in advance

Gaurav Kaneria

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Gaurav,

use the following code..

data: lr_std            TYPE REF TO if_salv_wd_std_functions.
 
 l_VALUE type ref to Cl_Salv_Wd_Config_Table. 
  l_VALUE = l_ref_INTERFACECONTROLLER->Get_Model(   ).
lr_std ?= l_value.
lr_std->SET_EXPORT_ALLOWED( abap_false ).
 lr_std->SET_PDF_ALLOWED( abap_false ).

Cheers,

Kris.

former_member184578
Active Contributor
0 Kudos

Hi.,

l_ref_INTERFACECONTROLLER is the pointer to ALV interface Colntroller

try this.,

data: l_ref_INTERFACECONTROLLER TYPE REF TO iwci_salv_wd_table,

l_ref_INTERFACECONTROLLER = wd_this->wd_cpifc_alv( ).

from this same as suggested by kris.,

> l_VALUE type ref to Cl_Salv_Wd_Config_Table.

> l_VALUE = l_ref_INTERFACECONTROLLER->Get_Model( ).

> lr_std ?= l_value.

> lr_std->SET_EXPORT_ALLOWED( abap_false ).

> lr_std->SET_PDF_ALLOWED( abap_false )

hope this helps u.,

Thanks & Regards,

Kiran

Answers (2)

Answers (2)

Former Member
0 Kudos

Dear all

more errors,

1. wd_this->wd_cpifc_alv_comp is unknow or private or protected

2. lo_value = lo_interfacecontroller->get_model( ). this assignment is not possible

Thanks

former_member199125
Active Contributor
0 Kudos

First, in your view, you wiil find "PROPERTIES " TAB, in that click on create usage controller, in that select interface controller of your alv. then write the below code.

in wddoinit method write below code

DATA LO_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.

LO_CMP_USAGE = WD_THIS->WD_CPUSE_ALV1( ).

IF LO_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.

LO_CMP_USAGE->CREATE_COMPONENT( ).

ENDIF.

DATA LO_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .

LO_INTERFACECONTROLLER = WD_THIS->WD_CPIFC_ALV1( ).

DATA LO_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.

LO_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(

).

DATA: LR_STD TYPE REF TO IF_SALV_WD_STD_FUNCTIONS.

LR_STD ?= LO_VALUE.

LR_STD->SET_EXPORT_ALLOWED( ABAP_FALSE ).

    • For removing view in Standard ALV

LR_STD->SET_VIEW_LIST_ALLOWED( ABAP_FALSE ).

    • For removing Setting in Standard ALV

LR_STD->SET_DIALOG_SETTINGS_ALLOWED( ABAP_FALSE ).

    • For removing Print Version in Standard ALV

LR_STD->SET_PDF_ALLOWED( ABAP_FALSE ).

Regards

srinivas

Former Member
0 Kudos

Hi..

change this statement ... lo_interfacecontroller = wd_this->wd_cpifc_alv( ). and try

former_member199125
Active Contributor
0 Kudos

in my coding , instead of "alv1" write your alv component name...

Still if you face problem, let me know

Regards

Srinvias

Former Member
0 Kudos

I pasted the same code in the DO_INIT method of the corresponding view. Got an error saying "The field "L_REF_INTERFACECONTROLLER" is unknown, but there is a field with the similar name "WDYN_INTERFACE_CONTROLLER_NAME" . . . .

when i try with the other name. It says that it is not a reference variable.Revert soon.

Former Member
0 Kudos

Hi

Try this...

data lo_interfacecontroller type ref to iwci_salv_wd_table .
lo_interfacecontroller = wd_this->wd_cpifc_alv_comp( ).

data lo_value type ref to cl_salv_wd_config_table.
lo_value = lo_interfacecontroller->get_model( ).

CALL METHOD lo_value->if_salv_wd_std_functions~SET_EXPORT_ALLOWED( value = abap_false ).
CALL METHOD lo_value->if_salv_wd_std_functions~set_pdf_allowed( value = abap_false ).

cheers,

Kris.

Former Member
0 Kudos

when you instantiate teh ALV then this Interface controller reference is there..It will be of type IWCI_SALV_TABLE...

Please use that vairable which is poting to that interface/clas..