cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding ALV Column

former_member185241
Active Participant
0 Kudos

Hi All,

I have used SALV_WD_TABLE in my component,

Now in one view i m displaying data into ALV

i want to hide some field of this ALV

How to do this ?

Thanks and regards

Abhishek

Accepted Solutions (1)

Accepted Solutions (1)

former_member185241
Active Participant
0 Kudos

Hi

I have used following code

method WDDOINIT .

 

  DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .

lo_INTERFACECONTROLLER =   wd_comp_controller->wd_cpifc_emp_alv( ).

  DATA lv_value TYPE ref to cl_salv_wd_config_table.

  lv_value = lo_interfacecontroller->get_model(

  ).

lv_value->if_salv_wd_column_settings~delete_column( 'PASSWORD' ).

*  DATA : lref_config  TYPE REF TO  cl_salv_wd_config_table.

*  CREATE OBJECT lref_config.

*  CALL METHOD lref_config->if_salv_Wd_column_Settings~delete_column('Client').

endmethod.

But it is showing that wd_cpifc_emp_alv is nor defied or protected

Here i have used ALV component in my component.

Instead of wd_comp_controller i have also used wd_this but it is showing sam error .

"emp_alv" is my ALV Component Name.

Where is problem ?

Please Correct me

Thanks and regads

Abhishek

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

In properties of the view, where you are writting the coding, you need to declare the ALV as used controllers/components. You can do it by pressing create button. Then the error won't come.

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Please refer step 4 in the below link for refering the same.

http://scn.sap.com/docs/DOC-2368

chengalarayulu
Active Contributor
0 Kudos

Abhi,

Refer below: (Just copy paste the below code)

    DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.

  lo_cmp_usage =   wd_this->wd_cpuse_emp_alv( ).

  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_emp_alv( ).

  DATA lv_value TYPE REF TO cl_salv_wd_config_table.
  lv_value = lo_interfacecontroller->get_model(
  ).

Data:

  lo_column_settings TYPE REF TO if_salv_wd_column_settings,

  lo_column TYPE REF TO cl_salv_wd_column.

lo_column_settings ?= lv_value.

    lo_column = lo_column_settings->get_column( 'PASSWORD' ).
  lo_column->set_visible( if_wdl_core=>visibility_none ).

Hope will resollve.

former_member185241
Active Participant
0 Kudos

Hi cheng

It is showing error

Method "WD_CPUSE_EMP_ALV" is unknown or PROTECTED or PRIVATE.  

I have given name of SALV_WD_TABLE comonent as emp_alv,

and i am writing this code in the WDINIT of the view where i am displaying the ALV

Thanks and Regads

Abhi 

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Just declare in the properties of the view the ALV component  as I mentioned earlier. Error won't come.

chengalarayulu
Active Contributor
0 Kudos

Abhi,

1. Go to "Properties" tab of View,

2. Define controller usages and activate.

3. Now test.

Answers (2)

Answers (2)

former_member185241
Active Participant
0 Kudos

Thanks Cheng and Jayanthi

It is working correctly....

Yuhuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu  🙂 🙂

Thanks Alot 🙂

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

If you want to remove the field completely even from layout, you need to use

if_salv_wd_column_settings~delete_column. If you want it to be hidden only in display, then set_visible should be used.

Refer this thread.

http://scn.sap.com/thread/1681440

former_member185241
Active Participant
0 Kudos

Hey Jayanti,

Have you something related to your post, Please i need it

Thanks and Regads

Abhishek