cancel
Showing results for 
Search instead for 
Did you mean: 

Rearranging column in table

Former Member
0 Kudos

Hello,

We have a requirement to rearrange table column in a particular order in WDA. Column order is known at runtime only.

So we need to rearrange columns at runtime or dynamically.

Example.

Table contains following columns -

PO     Material      Plant     Creation Date     Creation time

001     MAT1         1800     21/05/2014          01:25:23

how can we change column order or sequence to following -

Material     PO     Creation Date     Plant     Creation time

MAT1        001     21/05/2014          1800     01:25:23

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi nikhil,

Dynamic node creation is good method to resolve this issue... As Rama has already written.

You add dynamic node in modify view method.

One more way to display data...

you can show data in web dynpro ALV using Dynamic ALV creation. You can use field-symbol for that.

Regards,

JP

Former Member
0 Kudos

Hi Rama,

Hi Jayvin,

Many thanks for your inputs.

There are 2 things -

1. Output we have to display in tree table i.e. hierarchical display.

2. Table columns are constants so making it dynamic table would be unnecessary.

Is it possible to create  hierarchical display with more than 1 level of hierarchy ?

Thank you for your reply.

Regards,

Nikhil Tiwari

ramakrishnappa
Active Contributor
0 Kudos

Hi Nikhil,

Yes, its possible to create multi level hierarchy in tree table.

Please check the below link

Integration of Tree Structure in a Table using Webdynpro Abap - Community Profiles - SCN Wiki

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Hi Rama,

Static tree table creation won't solve my issue.

As told by you in our first reply I need to create dynamic node.

Will it be possible to create dynamic tree table ?

Thank you for your reply.

Regards,

Nikhil Tiwari

ramakrishnappa
Active Contributor
0 Kudos

Hi Nikhil,

You can create dynamic node and also tree table dynamically but its tricky.

As suggested in the below link, you can have your node created and there the data dynamically decides the level of your tree table. i.e for node leaf = abap_false, you can create nested levels too.

Integration of Tree Structure in a Table using Webdynpro Abap - Community Profiles - SCN Wiki

Hope this helps you.

Regards,

Rama

Answers (1)

Answers (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Nikhil,

We do not have provision to re-arrange the columns of static table. But, there are 2 possibilities available to achieve your requirement

Option1:

  • Delete all columns and re-create the columns and add to the existing table definition using the index.
    • use the methods REMOVE_ALL_COLUMNS/REMOVE_ALL_GROUPED_COLUMNS to delete columns of class CL_WD_TABLE
    • use the method ADD_COLUMN to add new column into the existing table at given index

Option2:

  • Create dynamic node with the attributes in required order
  • use the method CREATE_TABLE_FROM_NODE of class CL_WD_DYNAMIC_TOOL to create dynamic table

          please refer the below link ;

          Creating UI Elements Dynamically in Abap Webdynpro Application

Hope this helps you.

Regards,

Rama