on 09-15-2011 10:09 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.