Application Development and Automation 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: 
Read only

Doubt in table control

Former Member
0 Likes
424

I have a table control on a custom screen containing several rows of data depending on the user input on the selection screen . This table control has 5 columns .

The first column name is KEY . it contains value of a number of fields concatenated together forming a key .

For eg : the fields are matnr mblnr xblnr , so the value in this column would be something like : value of all 3 fields together without any space . My problem is that i do not know the number of these fields till run time , so i do not know whether the key field will contain data from 5 fields or 4 fields ..

My question is this : I want to make the column heading dynamic for this field ..for eg if there is data for 2 fields like matnr and xblnr ,then the heading shud be material number - xblnr or if there are 4 fields ..then the heading shud be the description of those 4 fields ..

Is this possible . Can i make the column header of a table control dynamic .

Kindly help me out as it is urgent ..

I will duly reward all ..

Thanks in advance

Ankit

1 ACCEPTED SOLUTION
Read only

former_member186741
Active Contributor
0 Likes
404

try and use a variable in the heading......click the 'create element' button and try and paste it into the column heading itself. It might work.

Update: I have tried it an it worked. I deleted the existing text variable in a column and pasted in an input/output field in its place. I had to set the length to make sure it filled out the column. Then in the abap I declared a variable with the same name and moved some text to it before the pbo. The text then came out in the column heading I had changed.

3 REPLIES 3
Read only

former_member186741
Active Contributor
0 Likes
405

try and use a variable in the heading......click the 'create element' button and try and paste it into the column heading itself. It might work.

Update: I have tried it an it worked. I deleted the existing text variable in a column and pasted in an input/output field in its place. I had to set the length to make sure it filled out the column. Then in the abap I declared a variable with the same name and moved some text to it before the pbo. The text then came out in the column heading I had changed.

Read only

rahulkavuri
Active Contributor
0 Likes
404

Hi in the PBO module of the screen load the dynamic headings into the Table Control Headings

Declare variables which hold the the dynamic name

This should work, by default they are set to AUTOTEXT***

Read only

Former Member
0 Likes
404

Hi Ankit,

I dont think its possible in Table Control to change the column headings dynamically.

But this is possible in ALV. You just need to put a If condition in the field catalog.

Will suggest you to go for ALV.

Best regards,

Prashant

Pls. mark points for helpful answers