on 03-17-2014 1:43 PM
HI All,
How to controle the WD table column position (not ALV) in webdynpro as per custom requirnment.
Column1, Column2, Column3, Column4…………
I looked into CL_WD_TABLE to see any possibility.
Can anyone suggest me the right one?
Thanks
Gopal
Hi Gopal,
we don't have provision to set position of column we do it in ALV by using set_position
As Kiran suggested, you need to delete the existing columns and add the columns as per your requirement by using the parameter INDEX in method ADD_COLUMN / ADD_GROUPED_COLUMN
To get all columns use GET_COLUMNS / GET_GROUPED_COLUMNS
To delete columns use REMOVE_COLUMN(S) / REMOVE_GROUPED_COLUMN(S)
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
There is no method(s) to set the column position in table. However, you have to dynamically remove/add using remove_column( ) and add_column( ) by passing index to it in wddomodifyview( ) method dynamically.
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can we rearrange the existing columns of nodes by passing the index and column name.
Unfortunately, No! you have to remove the column and add it.
As I have already have a component with table need to rearrange the columns.
Is it a standard component or custom component?
If it is a custom component, you can rearrange by right click on column and move up/down.
If it is a standard component, consider deleting the table( Remove Element) in enhancement mode and then create a new Table UI with specified order. Or, create a post exit in wddomodifyview and then get the table reference and use remove_column( ) add_column( ) methods
code snippet:
DATA: lr_table TYPE REF TO cl_wd_table,
lr_abs_col TYPE REF TO cl_wd_abstr_table_column,
lr_col TYPE REF TO cl_wd_table_column.
IF first_time EQ abap_true.
* get table reference
lr_table ?= view->get_element( id = 'TABLE ). " ID of Table UI
CALL METHOD lr_table->remove_grouped_column
EXPORTING
id = 'COL1' " column
index = 1 " index
RECEIVING
the_grouped_column = lr_abs_col.
lr_col ?= lr_abs_col.
CALL METHOD lr_table->add_column
EXPORTING
index = 20 " new index
the_column = lr_col.
ENDIF.
hope this helps u,
Regards,
Kiran
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.