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

Change Column title at table control

Former Member
0 Likes
767

Hi Folks,

I'm having a table control that with 10 columns. Basically these 10 columns is reporting monthly qty of a material. Since the processing period is supply by user at selection screen, thus the processing period is <b>dynamic</b>.

For eg: User key in date 01.01.2007 to 01.10.2007, then title for each column of the table control has to display with title "Period 01", "Period 02", "Period 03" until "Period 10".

As i have checked on system table <b>SCREEN</b>, it doesn't has any fields that containing the column's title. Thus i need your advice on how to change the column's title of a table control during runtime.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

dani_mn
Active Contributor
0 Likes
686

HI,

you can achive this by first adding all the columns to the table, and then during run time hide the columns which are not required. Like you want to display the column from 1 to 5 then hide the rest of them by using.

DATA: waa LIKE LINE OF TAB_CONTROL-cols.
CLEAR waa.

      LOOP AT TAB_CONTROL-cols INTO waa.

        IF waa-index = 6 OR 
           waa-index = 7 OR 
           waa-index = 8 OR 
           waa-index = 9 OR 
           waa-index = 10.

          waa-invisible = 'X'.
          MODIFY TAB_CONTROL-cols FROM waa.

        ENDIF.

      ENDLOOP.

Regards

3 REPLIES 3
Read only

dani_mn
Active Contributor
0 Likes
687

HI,

you can achive this by first adding all the columns to the table, and then during run time hide the columns which are not required. Like you want to display the column from 1 to 5 then hide the rest of them by using.

DATA: waa LIKE LINE OF TAB_CONTROL-cols.
CLEAR waa.

      LOOP AT TAB_CONTROL-cols INTO waa.

        IF waa-index = 6 OR 
           waa-index = 7 OR 
           waa-index = 8 OR 
           waa-index = 9 OR 
           waa-index = 10.

          waa-invisible = 'X'.
          MODIFY TAB_CONTROL-cols FROM waa.

        ENDIF.

      ENDLOOP.

Regards

Read only

Former Member
0 Likes
686

Hi HRA,

Thanks for your reply, perhaps i think you misunderstood my question.

Im not intend to hide certain columns, but instead i need to change column's title during runtime.

Pls comment.

Thanks in advance.

Read only

amit_khare
Active Contributor
0 Likes
686

Check this .

Regards,

Amit