cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to hide Standard ALV button

Former Member
0 Kudos

Hey Folks,

I am enhancing a standard Webdynpro ALV table to remove some standard buttons from the ALV toolbar.

I have included the following piece of code in the post-exit method of wddoinit of the view controller


  DATA:
  lo_controller TYPE REF TO iwci_salv_wd_table,
  lo_model TYPE REF TO CL_SALV_WD_CONFIG_TABLE.

  lo_controller = wd_this->wd_cpifc_usage_alv( ).
  lo_model = lo_controller->get_model( ).
  lo_model->if_salv_wd_std_functions~SET_EXPORT_ALLOWED( abap_false ).

However , at line lo_model = lo_controller->get_model( )., I am getting an error stating 'Data no longer available when SALV_WD_TABLE GET_MODEL called '


The error occurred on the application server <<>> and in the work process 0 . 
The termination type was: RABAX_STATE 
The ABAP call stack was: 
Method: IF_SALV_WD_COMP_TABLE_IF~GET_MODEL of program CL_SALV_WD_C_TABLE============CP
Method: GET_MODEL of program /1BCWDY/BDC31YN620G3NH3QXFAG==CP
Method: IWCI_SALV_WD_TABLE~GET_MODEL of program /1BCWDY/BDC31YN620G3NH3QXFAG==CP
Method: _PST_4C3THUISYCQPYPORP8SL6VSFG of program /1BCWDY/BHBW0342WCZVRFN76NO3==CP
Method: IF_WDR_VIEW_DELEGATE~WD_DO_INIT of program /1BCWDY/BHBW0342WCZVRFN76NO3==CP
Method: DO_INIT of program CL_WDR_DELEGATING_VIEW========CP
Method: INIT_CONTROLLER of program CL_WDR_CONTROLLER=============CP
Method: INIT_CONTROLLER of program CL_WDR_VIEW===================CP
Method: INIT of program CL_WDR_CONTROLLER=============CP
Method: GET_VIEW of program CL_WDR_VIEW_MANAGER===========CP

What am I missing here? In the wddoinit of the method the ALV usage is being created . What data is it expecting from the model class?

Any pointers would be really helpful.

Thanks and Best Regards,

Puja

Accepted Solutions (0)

Answers (2)

Answers (2)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

make sure your component usage has active comopnent

DATA: LR_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.

DATA: LR_INTF_CTRL TYPE REF TO IWCI_SALV_WD_TABLE.

DATA: LR_MODEL TYPE REF TO CL_SALV_WD_CONFIG_TABLE.

LR_CMP_USAGE = WD_THIS->WD_CPUSE_ALV( ).

IF LR_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.

LR_CMP_USAGE->CREATE_COMPONENT( ).

ENDIF.

LR_INTF_CTRL = WD_THIS->WD_CPIFC_ALV( ).

LR_MODEL = LR_INTF_CTRL->GET_MODEL( ).

WD_THIS->M_MODEL = LR_MODEL.

Abhi

Former Member
0 Kudos

Hi Abhimanyu,

I verified this too...The Component Usage does have an active component. I get this error despite this.

Thanks and Best Regards,

Puja.

Former Member
0 Kudos

I finally found a way to achieve what I wanted by filtering accessing the standard ALV Functions in a feeder class that I was using. Works well for me though that should not have been the best way to do so

Former Member
0 Kudos

Puja,

check this thread for the code snippet

https://forums.sdn.sap.com/click.jspa?searchID=19892986&messageID=6567613

Thanks

Bala Duvvuri