cancel
Showing results for 
Search instead for 
Did you mean: 

Rearraning columns of TABLE UI element-->Enhancing standard WD

former_member184111
Active Contributor
0 Kudos

Hi Forum,

We have a requierment where we need to rearrange the columns in a particular order of a table of standard WD application /SAPSRM/WDC_UI_SC_DOTC_BD view V_SC_DOTC_BASIC.

I enhanced the view but UP and DOWN options are grayed out for table columns, there is no property to specify the position.

I have seen few threads on this issue but none provides a complete solution.

How can we achieve this?

Thanks,

Anubhav

Accepted Solutions (0)

Answers (1)

Answers (1)

RicardoRomero_1
Active Contributor
0 Kudos

Hi,

I think is not possible to modify it in the Layout.

I've added some CUSTOM columns in standard WD and you can use UP and DOWN for them ir order to put them beetwen two standards columns, but as you say for standard columns these options are grayed.

May be is possible to it by code using some class like CL_WD_TABLE or IF_WD_CONTEXT_NODE_INFO or CL_WD_DYNAMIC_TOOL...

EDIT:

See the answer of Manogna in this thread:

This is for set enabled or not a column, but may be you can use it in order to change the position using the object lo_column (class CL_SALV_WD_COLUMN) and method SET_POSITION

Edited by: Ricardo Romero Mata on Sep 15, 2011 2:54 PM

former_member184111
Active Contributor
0 Kudos

Hi Ricardo,

I also added Z columns and hide the standard once thus showing Z columns in required position but the problem comes when a table column is using cell varinat as cell varinats may be used at runtime depending on the variant ID, some where in standard code.

No standard calsses CL_WD_TABLE, CL_WD_TABLE_COLUMNS, IF_WD_CONTEXT_NODE, IF_WD_CONTEXT_NODE_INFO has any method to set position of a table column.

Since the columns are displayed in the order they are defined in the static dictionary structure used by the context node, one workaround could be modify this dictionary structure at runtime but that also dosent looks possible as there is no method in IF_WD_CONTEXT_NODE or _INFO to do this....just a thought

Thanks,

Anubhav

Former Member
0 Kudos

Hi ,

i think you can use this class cl_salv_wd_column.

DATA:ls_col TYPE REF TO cl_salv_wd_column,

lr_col_header TYPE REF TO cl_salv_wd_column_header.

DATA: lt_columns TYPE salv_wd_t_column_ref.

lt_columns = lr_column_settings->get_columns( ).

  • loop over table - in each loop another column can be modified

DATA: ls_column TYPE salv_wd_s_column_ref.

LOOP AT lt_columns INTO ls_column. " get header of column

ls_col = ls_column-r_column.

CASE ls_column-id.

WHEN 'PIN'.

ls_col->set_position( 1 ).

lr_col_header = ls_column-r_column->create_header( ).

lr_col_header->set_ddic_binding_field( if_salv_wd_c_column_settings=>ddic_bind_none ).

lr_col_header->set_text( EXPORTING value = lv_otr_fname).

endcase.

Endloop.

Thanks,

Lavanya.

Edited by: lavanyaMadhu on Sep 15, 2011 3:08 PM

former_member184111
Active Contributor
0 Kudos

Hi Lavanya,

Thanks but the we are talking about TABLE not ALV so this class is not helpful..

Thanks,

Anubhav

former_member199125
Active Contributor
0 Kudos

Hi Anubhav,

try this SET_FIXED_POSITION in CL_wd_TABLE_COLUMN class? i hope this wil work.

if above method is not useful, then my suggestion is to go for new table (i mean z table) and hide the standard in enhancement.

Regards

Srinivas

Edited by: sanasrinivas on Sep 16, 2011 8:25 AM

former_member184111
Active Contributor
0 Kudos

Hi Srinivasa,

This method would not hekp because you can specify only Not Fixed/ Left/ Right as values using this method and not any index.

Thanks,

Anubhav

matteo_montalto
Contributor
0 Kudos

Hi Anubhav,

I'm facing the same difficulties in reorganizing columns of a CL_WD_TABLE... Did you solve the task? May I ask you in case how did you do that?

Thanks,
M.