2007 Jun 08 11:32 AM
Hi,
How to add Hide Functionality to hide some Coloumns in the ALV Report Display.
Kindly anyone revert me back.
Thanks & Regards,
Pavan Katkuri.
2007 Jun 08 11:48 AM
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.
2007 Jun 08 11:35 AM
Hi Pavan,
Check this link,
https://forumsn.sdn.sap.com/click.jspa?searchID=3063229&messageID=2374803
Thanks.
2007 Jun 08 11:37 AM
2007 Jun 08 11:38 AM
Hi
Use
<b>NO_OUT = 'X' </b> for the fieldcatalog to hide the field
Reward points for useful Answers
Regards
Anji
2007 Jun 08 11:45 AM
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_EXCLUDINGThis 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
2007 Jun 08 11:48 AM
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
2007 Jun 08 11:58 AM
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.
2007 Jun 08 12:16 PM
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