Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV Display

Former Member
0 Likes
980

Hi,

How to add Hide Functionality to hide some Coloumns in the ALV Report Display.

Kindly anyone revert me back.

Thanks & Regards,

Pavan Katkuri.

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
961

Hi pavan,

the easiest way is to configure an ALV layout and remove the desired columns from field list. Then save it as default layout. You can do so in development system and then transport it.

Sorry, no programming.

If you want to do it in ABAP, ser´t attrbute TECH = 'X' in field catalog entries for the fields to hide.

Regards,

Clemens

Hi,

How to add Hide Functionality to hide some Coloumns in the ALV Report Display.

Kindly anyone revert me back.

Thanks & Regards,

Pavan Katkuri.

7 REPLIES 7
Read only

Former Member
0 Likes
961
Read only

Former Member
0 Likes
961

hi Pavan,

just mark..

which column u want to hide.

locFieldCatalog-no_out = 'X'.

or Check the following thread:

Read only

Former Member
0 Likes
961

Hi

Use

<b>NO_OUT = 'X' </b> for the fieldcatalog to hide the field

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
961

Hi Pavan

1.Create an internal table with the same structure that u had passed for ALV.Add one more column to that table with type wdui_visibility.

2.Create one more node with the structure of the internal table created above.

3.Move the coresssponding data from your old internal table to the new internal table.

4.For the new column of type wdui_visibility fill values by comparing the field with value X or blank.ie. IF value = X wdui_visibility_column-value = '02' .

IF value = blank wdui_visibility_column-value = '01' .

5.Save the changes in the new internal table.

6.Bind the new internal table to the new node.

7.Use the new node to display data in ALV.

8.Create an attribute "alv_table" of type "CL_SALV_WD_CONFIG_TABLE" in the view.

9.In the wd_init method add the following codes.

* create an instance of ALV component
  DATA:
    lr_salv_wd_table_usage TYPE REF TO if_wd_component_usage.
* get ALV component
  DATA:
    lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
* set cell editor for input fields (~make colum Wt editable)
  DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
        lr_column type ref to CL_SALV_WD_COLUMN,
        lr_column_hdr type ref to CL_SALV_WD_COLUMN_HEADER,
        lr_button_1 TYPE REF TO cl_salv_wd_uie_button.
 
  lr_salv_wd_table_usage = wd_this->wd_cpuse_<Alv component usage name>( ).
  IF lr_salv_wd_table_usage->has_active_component( ) IS INITIAL.
    lr_salv_wd_table_usage->create_component( ).
  ENDIF.
 
  lr_salv_wd_table = wd_this->wd_cpifc_<Alv component usage name>( ).
  wd_this->alv_table = lr_salv_wd_table->get_model( ).
 
 lr_column_settings ?= wd_this->alv_table.
lr_column = lr_column_settings->get_column( '<column name which you want to show 
                  as button>' ).
CREATE OBJECT lr_button_1.
  lr_button_1->set_text( '<some releavnt text>' ).
  lr_button_1->SET_VISIBLE_FIELDNAME('<new column name of type 
                     wdui_visibility>').
  lr_column->set_cell_editor( lr_button_1). 

IT_TOOLBAR_EXCLUDING

This table contains function codes of the toolbar that you want to hide for the lifetime of the ALV Grid Control. The function codes are constant attributes and are prefixed with MC_FC_.

NO_OUT = 'X'

<b>If you set this field, you hide the relevant column in the list. Nevertheless, the column is available in the field selection and can be interactively selected by the user as a display field. The ALV displays the contents of hidden fields on the detail screen for a row in the grid control.</b>

http://help.sap.com/saphelp_nw04/helpdata/en/e3/e3eb40c4f8712ae10000000a155106/content.htm

Hope this helps.

Reward all helpfull answers

Regards

Pavan

Read only

Clemenss
Active Contributor
0 Likes
962

Hi pavan,

the easiest way is to configure an ALV layout and remove the desired columns from field list. Then save it as default layout. You can do so in development system and then transport it.

Sorry, no programming.

If you want to do it in ABAP, ser´t attrbute TECH = 'X' in field catalog entries for the fields to hide.

Regards,

Clemens

Read only

Former Member
0 Likes
961

hi,

use

while declaing fieldcatalog.

d_fieldcat_wa-fieldname = 'MATNR'.

d_fieldcat_wa-seltext_l = 'material number'.

<b>d_fieldcat_wa-no_out = 'X'.</b>

d_fieldcat_wa-col_pos = 1.

append d_fieldcat_wa to d_fieldcat .

clear d_fieldcat_wa.

Read only

Former Member
0 Likes
961

Hey pavan

Why r u posting these repeated threads???

If u want ask the same question in only thread but dont use these many threads for one question

plz close this thread also

regards

Pavan