cancel
Showing results for 
Search instead for 
Did you mean: 

In wendynpro, i need to delete unwanted columns in ALV..

Former Member
0 Kudos

Hi experts,

In Webdynpro, I have selected some fields in context node through dictionary structure and to display those fields in ALV . Im getting the values for corresponding fields which i have selected but im also getting other fields of the database dictionary structure in ALV.. Can anyone help me to delete other fileds in it..

Thanks in advance..

Edited by: sivaprasath sekar on May 28, 2009 11:22 AM

Accepted Solutions (1)

Accepted Solutions (1)

former_member40425
Contributor
0 Kudos

Hi,

After creating the context node , Just go to the properties of context node and remove the name of DDIC table (Keep dictionary table as blank) .

I hope it helps.

Regards,

Rohit

Edited by: Rohit Makkar on May 28, 2009 3:03 PM

Answers (3)

Answers (3)

uday_gubbala2
Active Contributor
0 Kudos

Hi Siva,

You need to take care of 1 thing whether you are working with a normal TABLE/ALV in WDA. While creating a node you specify the,"Dictionary structure" & then you select the attributes by selecting the, "Add Attribute From Structure" button. So once you finish with selecting your desired fields and return back to the main SE80 window you can see the table name which you had entered earlier in the "Dictionary structure" field. You need to clear this out or else the system would end up displaying all the fields from the database table in the table/ALV. Hope that this is clear for you.

Regards,

Uday

Former Member
0 Kudos

Hi,

Use following code to delete the column from ALV.

Here we are using config. model of ALV to delete the column.

DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .

lo_interfacecontroller = wd_this->wd_cpifc_alv( ).

DATA lv_value TYPE REF TO cl_salv_wd_config_table.

lv_value = lo_interfacecontroller->get_model(

).

CALL METHOD lv_value->if_salv_wd_column_settings~delete_column

EXPORTING

id = 'CARRID'

.

Instead of carrid you can pass your cotext_attribute which needs to be deleted.

Thanks,

Rahul

Edited by: Rahul Yadav on May 28, 2009 11:30 AM

former_member230839
Participant
0 Kudos

Hi Sivaprasanth,

You can just use the foloowing code to hide the unwanted columns

DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,

lr_column TYPE REF TO cl_salv_wd_column,

lr_column_header TYPE REF TO cl_salv_wd_column_header.

lr_column_settings ?= wd_this->CDS_ALV_TABLE. " ALV table instance

CLEAR: lr_column.

lr_column = lr_column_settings->get_column( 'CLIENT' ).

IF NOT lr_column IS INITIAL.

lr_column->set_visible( if_wdl_core=>visibility_none ). " make as invisible.

lr_column_header = lr_column->create_header( ).

lr_column_header->set_text( 'Client' ).

ENDIF.