cancel
Showing results for 
Search instead for 
Did you mean: 

Get ColumnGroup value of a column in standard table

Former Member
0 Kudos

Hello All,

I am trying to get the "TableColumnGroup" value of a "TableColumn" in a standard table. Does anyone know how to get this? I would greatly appreciate your help if you can help me. Thanks.

Regards,

Gopal.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

See the reply and code snippet of mine in your other forum

[|]

Once you have the column , column classes provides many methods, explore them to see which one you can use. (Just for your self experience and learning ).

If you are not able to get this done. Then explain here what you have done so far and what is not working.

Former Member
0 Kudos

Hello Baskaran,

Thanks a lot for your help. I have already looked at varios column classes, but there isn't any method that can be used to get the ColumnGroup value of a column!

Regards,

Gopal.

Former Member
0 Kudos

Have you tried the GET_GROUPING_VALUE method of the CL_WD_TABLE_COLUMN class.

Former Member
0 Kudos

Hello,

As far as I am aware, GET_GROUPING_VALUE is a method for getting the "groupingValue" property of a Table Column whilst Row Grouping but not to get the TableGroup of a column.

Regards,

Gopal.

Former Member
0 Kudos

So you want to find out which column belong to which grouped column. Then i think you may have to get the Group_columns and columns from table. Loop through the grouped columns and get the columns from grouped columns. Cross check which with the column table you got it from table.

Note: I have used the following code to get all the columns(Grouped cols/Columns) in a table. You can copy this and modify a bit to for your scenario and post back the code which is working for your scenario.

data wd_grouped_col type ref to cl_wd_abstr_table_column.
  data wd_column_group type ref to cl_wd_table_column_group.
  data tmp_grouped_cols type cl_wd_abstr_table_column=>tt_abstr_table_column.
  data wd_grouped_cols type cl_wd_abstr_table_column=>tt_abstr_table_column.
  data wd_a_column type ref to cl_wd_table_column.

  wd_columns = m_wd_table->get_columns( ).
  wd_grouped_cols = m_wd_table->get_grouped_columns( ).

  while wd_grouped_cols is not initial.
    read table wd_grouped_cols into wd_grouped_col index 1.
    delete wd_grouped_cols index 1.
    if wd_grouped_col->_cid = cl_wd_table_column_group=>cid_table_column_group.
      wd_column_group ?= wd_grouped_col.
      tmp_grouped_cols = wd_column_group->get_columns( ).
      insert lines of tmp_grouped_cols into table wd_grouped_cols.
    else.
      wd_a_column ?= wd_grouped_col.
      insert wd_a_column into table wd_columns.
    endif.
  endwhile.

Answers (0)