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

Dynamic headers in table control

Former Member
0 Likes
1,179

Hi,

How to create dynamic headers in table control headers?

I have to replace the header labels with internally computed headers.

I have created input fields for headers..

Regards,

Krutika

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
487

Hi Krutika,

Try this out,

Populate an internal tabel with all the dates and day in it and also populate the column position in it.

say you have populated all this in an internal table it_date----fields in the internal table

1. date

2. day

3. spot1 -


column name of the table control(spot1 represents the column position)

then do this ,

LOOP AT it_date INTO wa_date.

  • LOOP AT SCREEN .

*WHERE screen-name = wa_date-spot.

CASE wa_date-spot.

WHEN 'SPOTS1'.

spots1 = wa_date-dd.

WHEN 'SPOTS2'.

spots2 = wa_date-dd.

WHEN 'SPOTS3'.

spots3 = wa_date-dd.

WHEN 'SPOTS4'.

spots4 = wa_date-dd.

WHEN 'SPOTS5'.

spots5 = wa_date-dd.

WHEN 'SPOTS6'.

spots6 = wa_date-dd.

WHEN 'SPOTS7'.

spots7 = wa_date-dd.

WHEN 'SPOTS8'.

spots8 = wa_date-dd.

WHEN 'SPOTS9'.

spots9 = wa_date-dd.

WHEN 'SPOTS10'.

spots10 = wa_date-dd.

WHEN 'SPOTS11'.

spots11 = wa_date-dd.

WHEN 'SPOTS12'.

spots12 = wa_date-dd.

WHEN 'SPOTS13'.

spots13 = wa_date-dd.

WHEN 'SPOTS14'.

spots14 = wa_date-dd.

WHEN 'SPOTS15'.

spots15 = wa_date-dd.

WHEN 'SPOTS16'.

spots16 = wa_date-dd.

WHEN 'SPOTS17'.

spots17 = wa_date-dd.

WHEN 'SPOTS18'.

spots18 = wa_date-dd.

WHEN 'SPOTS19'.

spots19 = wa_date-dd.

WHEN 'SPOTS20'.

spots20 = wa_date-dd.

WHEN 'SPOTS21'.

spots21 = wa_date-dd.

WHEN 'SPOTS22'.

spots22 = wa_date-dd.

WHEN 'SPOTS23'.

spots23 = wa_date-dd.

WHEN 'SPOTS24'.

spots24 = wa_date-dd.

WHEN 'SPOTS25'.

spots25 = wa_date-dd.

WHEN 'SPOTS26'.

spots26 = wa_date-dd.

WHEN 'SPOTS27'.

spots27 = wa_date-dd.

WHEN 'SPOTS28'.

spots28 = wa_date-dd.

WHEN 'SPOTS29'.

spots29 = wa_date-dd.

WHEN 'SPOTS30'.

spots30 = wa_date-dd.

WHEN 'SPOTS31'.

spots31 = wa_date-dd.

ENDCASE.

Hope this helps you,

Regards,

Abhijit G. Borkar

1 REPLY 1
Read only

Former Member
0 Likes
488

Hi Krutika,

Try this out,

Populate an internal tabel with all the dates and day in it and also populate the column position in it.

say you have populated all this in an internal table it_date----fields in the internal table

1. date

2. day

3. spot1 -


column name of the table control(spot1 represents the column position)

then do this ,

LOOP AT it_date INTO wa_date.

  • LOOP AT SCREEN .

*WHERE screen-name = wa_date-spot.

CASE wa_date-spot.

WHEN 'SPOTS1'.

spots1 = wa_date-dd.

WHEN 'SPOTS2'.

spots2 = wa_date-dd.

WHEN 'SPOTS3'.

spots3 = wa_date-dd.

WHEN 'SPOTS4'.

spots4 = wa_date-dd.

WHEN 'SPOTS5'.

spots5 = wa_date-dd.

WHEN 'SPOTS6'.

spots6 = wa_date-dd.

WHEN 'SPOTS7'.

spots7 = wa_date-dd.

WHEN 'SPOTS8'.

spots8 = wa_date-dd.

WHEN 'SPOTS9'.

spots9 = wa_date-dd.

WHEN 'SPOTS10'.

spots10 = wa_date-dd.

WHEN 'SPOTS11'.

spots11 = wa_date-dd.

WHEN 'SPOTS12'.

spots12 = wa_date-dd.

WHEN 'SPOTS13'.

spots13 = wa_date-dd.

WHEN 'SPOTS14'.

spots14 = wa_date-dd.

WHEN 'SPOTS15'.

spots15 = wa_date-dd.

WHEN 'SPOTS16'.

spots16 = wa_date-dd.

WHEN 'SPOTS17'.

spots17 = wa_date-dd.

WHEN 'SPOTS18'.

spots18 = wa_date-dd.

WHEN 'SPOTS19'.

spots19 = wa_date-dd.

WHEN 'SPOTS20'.

spots20 = wa_date-dd.

WHEN 'SPOTS21'.

spots21 = wa_date-dd.

WHEN 'SPOTS22'.

spots22 = wa_date-dd.

WHEN 'SPOTS23'.

spots23 = wa_date-dd.

WHEN 'SPOTS24'.

spots24 = wa_date-dd.

WHEN 'SPOTS25'.

spots25 = wa_date-dd.

WHEN 'SPOTS26'.

spots26 = wa_date-dd.

WHEN 'SPOTS27'.

spots27 = wa_date-dd.

WHEN 'SPOTS28'.

spots28 = wa_date-dd.

WHEN 'SPOTS29'.

spots29 = wa_date-dd.

WHEN 'SPOTS30'.

spots30 = wa_date-dd.

WHEN 'SPOTS31'.

spots31 = wa_date-dd.

ENDCASE.

Hope this helps you,

Regards,

Abhijit G. Borkar