Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create Dynamic Table Control

Former Member
0 Kudos

Hi

How to create Dynamic Table control , The field names and values to be displayed in table control are to be fetched from Add-on Tables.

Regards

Prasath

5 REPLIES 5

Former Member
0 Kudos

If you mean the column headers are to be dynamic, then just make the Table Colum header a global variable which you set in your code.

There's an example of SAP doing this in the CATS function group, screen 2100. There are 10 customer-definable column "CATS_ADDFI-FIELD1_W" through to "CATS_ADDFI-FIELD10_W" with column headers "CATS_ADDFI_TEXT1" etc derived from the CATS config in table TCAFI... subroutine get_ddic_information shows how they set their titles.

Jonathan

0 Kudos

Hi Jonathan,

Actually the columns to be displayed are not constant . It will be increased based on the database values, Anyhow it will not exceed 100.

Please confirm my understanding.

1. In this case I have to create 100 custom columns and make it visible / invisible based on my requirement and I can set the title at runtime.

2. How can i assosicate / reassociate the datadictionary reference for the columns that i use. Because I need to show the search help values for the

dynamic columns.

Your opinion on this will be helpful.

Regards

Prasath

0 Kudos

The CATS example hides unwanted columns too, so that's not an issue - and you should be able to use the "process on help-request" and "process on value-request" to be able to get the right help text and searchhelp (screen 2100 in CATS does this too). The hardest part would be if you need to mix up field formats e.g. CHAR & NUMC are easy enough, but you'll probably need to code your own field format checks for numbers, dates etc. Sounds like an interesting task - good luck!

Jonathan

uwe_schieferstein
Active Contributor
0 Kudos

Hello Prasath

I think this is not possible yet I am not absolutely sure because I have not used table controls for over 5 years.

If I require the functionality "dynamic table controls" (similar like you) I always use an <b>editable ALV lists</b> (OO-based of course). Using this approach you have all the flexibility you need.

Regards

Uwe

Former Member
0 Kudos

Hi Uwe,Jonathan

Thank you very much.

At last I have decided to use Tree + ALV combination to avoid the dynamic coding burdens.

Regards

Prasath