xtt->MERGE( IV_BLOCK_NAME = ‘C’ IS_BLOCK =
{"A"=>[{"MON"=>"01", "MON_NAME"=>"January", "COL_NAME"=>"{R-T-SUM1;func=SUM}"}, {"MON"=>"02", "MON_NAME"=>"February", "COL_NAME"=>"{R-T-SUM2;func=SUM}"}, {"MON"=>"03", "MON_NAME"=>"March", "COL_NAME"=>"{R-T-SUM3;func=SUM}"}, {"MON"=>"04", "MON_NAME"=>"April", "COL_NAME"=>"{R-T-SUM4;func=SUM}"}, {"MON"=>"05", "MON_NAME"=>"May", "COL_NAME"=>"{R-T-SUM5;func=SUM}"}, {"MON"=>"06", "MON_NAME"=>"June", "COL_NAME"=>"{R-T-SUM6;func=SUM}"}, {"MON"=>"07", "MON_NAME"=>"July", "COL_NAME"=>"{R-T-SUM7;func=SUM}"}, {"MON"=>"08", "MON_NAME"=>"August", "COL_NAME"=>"{R-T-SUM8;func=SUM}"}, {"MON"=>"09", "MON_NAME"=>"September", "COL_NAME"=>"{R-T-SUM9;func=SUM}"}, {"MON"=>"10", "MON_NAME"=>"October", "COL_NAME"=>"{R-T-SUM10;func=SUM}"}, {"MON"=>"11", "MON_NAME"=>"November", "COL_NAME"=>"{R-T-SUM11;func=SUM}"}, {"MON"=>"12", "MON_NAME"=>"December", "COL_NAME"=>"{R-T-SUM12;func=SUM}"}, {"MON"=>"01", "MON_NAME"=>"January", "COL_NAME"=>"{R-T-SUM13;func=SUM}"}, {"MON"=>"02", "MON_NAME"=>"February", "COL_NAME"=>"{R-T-SUM14;func=SUM}"}, {"MON"=>"03", "MON_NAME"=>"March", "COL_NAME"=>"{R-T-SUM15;func=SUM}"}, {"MON"=>"04", "MON_NAME"=>"April", "COL_NAME"=>"{R-T-SUM16;func=SUM}"}, {"MON"=>"05", "MON_NAME"=>"May", "COL_NAME"=>"{R-T-SUM17;func=SUM}"}, {"MON"=>"06", "MON_NAME"=>"June", "COL_NAME"=>"{R-T-SUM18;func=SUM}"}, {"MON"=>"07", "MON_NAME"=>"July", "COL_NAME"=>"{R-T-SUM19;func=SUM}"}, {"MON"=>"08", "MON_NAME"=>"August", "COL_NAME"=>"{R-T-SUM20;func=SUM}"}, {"MON"=>"09", "MON_NAME"=>"September", "COL_NAME"=>"{R-T-SUM21;func=SUM}"}, {"MON"=>"10", "MON_NAME"=>"October", "COL_NAME"=>"{R-T-SUM22;func=SUM}"}, {"MON"=>"11", "MON_NAME"=>"November", "COL_NAME"=>"{R-T-SUM23;func=SUM}"}, {"MON"=>"12", "MON_NAME"=>"December", "COL_NAME"=>"{R-T-SUM24;func=SUM}"}, {"MON"=>"01", "MON_NAME"=>"January", "COL_NAME"=>"{R-T-SUM25;func=SUM}"}, {"MON"=>"02", "MON_NAME"=>"February", "COL_NAME"=>"{R-T-SUM26;func=SUM}"}, {"MON"=>"03", "MON_NAME"=>"March", "COL_NAME"=>"{R-T-SUM27;func=SUM}"}, {"MON"=>"04", "MON_NAME"=>"April", "COL_NAME"=>"{R-T-SUM28;func=SUM}"}, {"MON"=>"05", "MON_NAME"=>"May", "COL_NAME"=>"{R-T-SUM29;func=SUM}"}, {"MON"=>"06", "MON_NAME"=>"June", "COL_NAME"=>"{R-T-SUM30;func=SUM}"}, {"MON"=>"07", "MON_NAME"=>"July", "COL_NAME"=>"{R-T-SUM31;func=SUM}"}, {"MON"=>"08", "MON_NAME"=>"August", "COL_NAME"=>"{R-T-SUM32;func=SUM}"}, {"MON"=>"09", "MON_NAME"=>"September", "COL_NAME"=>"{R-T-SUM33;func=SUM}"}, {"MON"=>"10", "MON_NAME"=>"October", "COL_NAME"=>"{R-T-SUM34;func=SUM}"}, {"MON"=>"11", "MON_NAME"=>"November", "COL_NAME"=>"{R-T-SUM35;func=SUM}"}, {"MON"=>"12", "MON_NAME"=>"December", "COL_NAME"=>"{R-T-SUM36;func=SUM}"}]}
).
xtt->MERGE( IV_BLOCK_NAME = ‘R’ IS_BLOCK =
{"T"=>[{"GROUP"=>"GRP A", "CAPTION"=>"<Caption 1 />", "DATE"=>"2020-10-21", "SUM1"=>5971.44, "SUM2"=>5021.46, "SUM3"=>2276.75, "SUM4"=>7717.2, "SUM5"=>3031.38, "SUM6"=>445.22, "SUM7"=>9476.79, "SUM8"=>3683.27, "SUM9"=>4604.0, "SUM10"=>5525.85, "SUM11"=>2159.71, "SUM12"=>2260.94, "SUM13"=>2490.3, "SUM14"=>6388.81, "SUM15"=>5476.81, "SUM16"=>406.18, "SUM17"=>689.66, "SUM18"=>518.6, "SUM19"=>5451.87, "SUM20"=>4061.85, "SUM21"=>4573.55, "SUM22"=>5436.0, "SUM23"=>1196.35, "SUM24"=>522.46, "SUM25"=>7686.95, "SUM26"=>2727.98, "SUM27"=>978.18, "SUM28"=>295.55, "SUM29"=>71.12, "SUM30"=>8878.56, "SUM31"=>2455.26, "SUM32"=>1543.67, "SUM33"=>6686.29, "SUM34"=>2989.49, "SUM35"=>3153.9, "SUM36"=>9291.25}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 2 />", "DATE"=>"2020-10-19", "SUM1"=>5319.8, "SUM2"=>3945.94, "SUM3"=>6810.78, "SUM4"=>3751.68, "SUM5"=>1976.49, "SUM6"=>9851.72, "SUM7"=>7149.19, "SUM8"=>4226.41, "SUM9"=>8194.6, "SUM10"=>4285.88, "SUM11"=>4168.96, "SUM12"=>6181.78, "SUM13"=>6419.92, "SUM14"=>1093.71, "SUM15"=>4047.18, "SUM16"=>971.33, "SUM17"=>5008.78, "SUM18"=>7833.37, "SUM19"=>9582.6, "SUM20"=>1568.08, "SUM21"=>840.79, "SUM22"=>8105.44, "SUM23"=>5503.59, "SUM24"=>6401.6, "SUM25"=>1805.33, "SUM26"=>1863.13, "SUM27"=>1958.04, "SUM28"=>3420.09, "SUM29"=>1751.07, "SUM30"=>8027.96, "SUM31"=>1006.38, "SUM32"=>6191.29, "SUM33"=>5946.87, "SUM34"=>5215.51, "SUM35"=>3048.93, "SUM36"=>1900.44}, {"GROUP"=>"GRP B", "CAPTION"=>"<Caption 3 />", "DATE"=>"2020-10-20", "SUM1"=>4360.52, "SUM2"=>2019.88, "SUM3"=>3968.83, "SUM4"=>7908.45, "SUM5"=>1519.96, "SUM6"=>256.61, "SUM7"=>3345.29, "SUM8"=>1590.73, "SUM9"=>6616.28, "SUM10"=>6230.11, "SUM11"=>2450.52, "SUM12"=>1445.41, "SUM13"=>9218.16, "SUM14"=>3546.34, "SUM15"=>5457.95, "SUM16"=>4288.14, "SUM17"=>1413.83, "SUM18"=>2935.33, "SUM19"=>1561.86, "SUM20"=>8070.23, "SUM21"=>5606.64, "SUM22"=>6501.99, "SUM23"=>8239.11, "SUM24"=>6687.27, "SUM25"=>1050.68, "SUM26"=>6730.82, "SUM27"=>733.04, "SUM28"=>502.59, "SUM29"=>2943.88, "SUM30"=>212.8, "SUM31"=>5736.85, "SUM32"=>4149.62, "SUM33"=>8539.78, "SUM34"=>354.08, "SUM35"=>2998.55, "SUM36"=>69.43}, {"GROUP"=>"GRP A", "CAPTION"=>"<Caption 4 />", "DATE"=>"2020-10-21", "SUM1"=>196.5, "SUM2"=>6381.04, "SUM3"=>6323.48, "SUM4"=>5844.18, "SUM5"=>9354.17, "SUM6"=>6228.92, "SUM7"=>308.41, "SUM8"=>1424.67, "SUM9"=>6309.25, "SUM10"=>9286.03, "SUM11"=>2774.49, "SUM12"=>8028.99, "SUM13"=>7638.56, "SUM14"=>510.96, "SUM15"=>1625.8, "SUM16"=>7902.67, "SUM17"=>1882.74, "SUM18"=>1516.84, "SUM19"=>9091.83, "SUM20"=>4523.3, "SUM21"=>7121.26, "SUM22"=>4156.28, "SUM23"=>5404.98, "SUM24"=>2469.62, "SUM25"=>5598.92, "SUM26"=>3059.11, "SUM27"=>5544.26, "SUM28"=>2571.89, "SUM29"=>4444.04, "SUM30"=>7278.26, "SUM31"=>8482.85, "SUM32"=>8359.24, "SUM33"=>911.9, "SUM34"=>6825.27, "SUM35"=>1701.94, "SUM36"=>1094.11}, {"GROUP"=>"GRP A", "CAPTION"=>"<Caption 5 />", "DATE"=>"2020-10-21", "SUM1"=>1679.86, "SUM2"=>6866.06, "SUM3"=>8514.74, "SUM4"=>6922.2, "SUM5"=>8636.84, "SUM6"=>3287.89, "SUM7"=>3382.06, "SUM8"=>6498.82, "SUM9"=>940.2, "SUM10"=>1683.9, "SUM11"=>216.42, "SUM12"=>5069.12, "SUM13"=>5147.76, "SUM14"=>6180.36, "SUM15"=>6680.86, "SUM16"=>599.85, "SUM17"=>3237.63, "SUM18"=>3551.16, "SUM19"=>7991.29, "SUM20"=>6542.59, "SUM21"=>9442.39, "SUM22"=>7531.51, "SUM23"=>8704.99, "SUM24"=>1779.31, "SUM25"=>96.99, "SUM26"=>5389.07, "SUM27"=>6050.15, "SUM28"=>5204.36, "SUM29"=>6133.92, "SUM30"=>2782.83, "SUM31"=>2627.58, "SUM32"=>247.82, "SUM33"=>7572.17, "SUM34"=>1915.44, "SUM35"=>6187.87, "SUM36"=>61.48}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 6 />", "DATE"=>"2020-10-19", "SUM1"=>1833.46, "SUM2"=>6201.19, "SUM3"=>7535.0, "SUM4"=>9440.18, "SUM5"=>3721.83, "SUM6"=>7879.74, "SUM7"=>7664.25, "SUM8"=>8711.87, "SUM9"=>9443.18, "SUM10"=>9783.95, "SUM11"=>8695.05, "SUM12"=>880.71, "SUM13"=>6902.2, "SUM14"=>5165.82, "SUM15"=>770.72, "SUM16"=>3816.54, "SUM17"=>9263.51, "SUM18"=>3490.91, "SUM19"=>9015.94, "SUM20"=>3709.54, "SUM21"=>8866.75, "SUM22"=>2585.43, "SUM23"=>7864.39, "SUM24"=>6622.07, "SUM25"=>5635.89, "SUM26"=>737.18, "SUM27"=>3238.85, "SUM28"=>3002.91, "SUM29"=>517.62, "SUM30"=>2536.31, "SUM31"=>4170.82, "SUM32"=>4171.44, "SUM33"=>4598.0, "SUM34"=>735.95, "SUM35"=>4699.4, "SUM36"=>2024.76}, {"GROUP"=>"GRP B", "CAPTION"=>"<Caption 7 />", "DATE"=>"2020-10-20", "SUM1"=>1021.71, "SUM2"=>6652.11, "SUM3"=>5560.23, "SUM4"=>5886.63, "SUM5"=>6083.8, "SUM6"=>3624.64, "SUM7"=>6556.42, "SUM8"=>6078.95, "SUM9"=>6489.03, "SUM10"=>597.75, "SUM11"=>468.55, "SUM12"=>9831.38, "SUM13"=>4465.54, "SUM14"=>7627.47, "SUM15"=>899.33, "SUM16"=>5586.29, "SUM17"=>8929.96, "SUM18"=>3073.61, "SUM19"=>9806.99, "SUM20"=>8076.02, "SUM21"=>848.15, "SUM22"=>6855.56, "SUM23"=>3848.13, "SUM24"=>5718.01, "SUM25"=>2328.27, "SUM26"=>7504.74, "SUM27"=>4652.99, "SUM28"=>6710.99, "SUM29"=>3951.29, "SUM30"=>3369.97, "SUM31"=>9874.34, "SUM32"=>9035.85, "SUM33"=>8874.69, "SUM34"=>7455.23, "SUM35"=>4687.44, "SUM36"=>3023.71}, {"GROUP"=>"GRP A", "CAPTION"=>"<Caption 8 />", "DATE"=>"2020-10-21", "SUM1"=>1376.25, "SUM2"=>2373.48, "SUM3"=>9806.78, "SUM4"=>3125.07, "SUM5"=>2653.11, "SUM6"=>3579.86, "SUM7"=>5660.49, "SUM8"=>445.44, "SUM9"=>725.85, "SUM10"=>3597.2, "SUM11"=>3225.86, "SUM12"=>4017.85, "SUM13"=>5596.45, "SUM14"=>9651.27, "SUM15"=>1328.17, "SUM16"=>5192.55, "SUM17"=>565.16, "SUM18"=>1391.12, "SUM19"=>4848.89, "SUM20"=>2640.09, "SUM21"=>7418.4, "SUM22"=>7570.9, "SUM23"=>869.7, "SUM24"=>5356.0, "SUM25"=>4862.28, "SUM26"=>9156.16, "SUM27"=>801.32, "SUM28"=>7973.88, "SUM29"=>7335.05, "SUM30"=>5878.05, "SUM31"=>7870.87, "SUM32"=>1810.5, "SUM33"=>2629.67, "SUM34"=>3473.31, "SUM35"=>9753.25, "SUM36"=>261.27}, {"GROUP"=>"GRP D", "CAPTION"=>"<Caption 9 />", "DATE"=>"2020-10-18", "SUM1"=>2833.96, "SUM2"=>4177.31, "SUM3"=>5936.86, "SUM4"=>2862.34, "SUM5"=>2843.13, "SUM6"=>7151.03, "SUM7"=>9836.03, "SUM8"=>5649.76, "SUM9"=>2608.8, "SUM10"=>9006.49, "SUM11"=>2091.4, "SUM12"=>9976.9, "SUM13"=>582.61, "SUM14"=>6702.17, "SUM15"=>691.92, "SUM16"=>3338.13, "SUM17"=>7482.08, "SUM18"=>1500.64, "SUM19"=>9672.0, "SUM20"=>9476.29, "SUM21"=>1726.68, "SUM22"=>4342.65, "SUM23"=>3776.15, "SUM24"=>567.95, "SUM25"=>5121.43, "SUM26"=>2913.0, "SUM27"=>4589.16, "SUM28"=>4992.84, "SUM29"=>7440.49, "SUM30"=>776.87, "SUM31"=>1871.5, "SUM32"=>1189.23, "SUM33"=>322.13, "SUM34"=>2188.15, "SUM35"=>676.48, "SUM36"=>4389.22}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 10 />", "DATE"=>"2020-10-19", "SUM1"=>3568.55, "SUM2"=>3302.33, "SUM3"=>3599.73, "SUM4"=>162.26, "SUM5"=>1842.25, "SUM6"=>6305.3, "SUM7"=>630.11, "SUM8"=>3946.07, "SUM9"=>9936.19, "SUM10"=>3539.22, "SUM11"=>7284.73, "SUM12"=>1226.97, "SUM13"=>7506.07, "SUM14"=>9359.41, "SUM15"=>7447.13, "SUM16"=>2805.1, "SUM17"=>5362.95, "SUM18"=>881.98, "SUM19"=>4548.72, "SUM20"=>7757.75, "SUM21"=>6756.06, "SUM22"=>1743.74, "SUM23"=>7281.55, "SUM24"=>9562.23, "SUM25"=>3623.06, "SUM26"=>2088.27, "SUM27"=>1869.43, "SUM28"=>1395.71, "SUM29"=>4740.31, "SUM30"=>1720.67, "SUM31"=>1186.25, "SUM32"=>5435.35, "SUM33"=>9072.75, "SUM34"=>2831.31, "SUM35"=>7803.8, "SUM36"=>1157.39}, {"GROUP"=>"GRP D", "CAPTION"=>"<Caption 11 />", "DATE"=>"2020-10-18", "SUM1"=>4054.89, "SUM2"=>4900.07, "SUM3"=>9773.4, "SUM4"=>462.17, "SUM5"=>1190.37, "SUM6"=>7994.69, "SUM7"=>4648.0, "SUM8"=>2488.53, "SUM9"=>1756.37, "SUM10"=>5937.77, "SUM11"=>5260.2, "SUM12"=>1716.97, "SUM13"=>5501.97, "SUM14"=>9386.11, "SUM15"=>9954.98, "SUM16"=>8214.51, "SUM17"=>3147.76, "SUM18"=>2569.63, "SUM19"=>5864.76, "SUM20"=>8267.85, "SUM21"=>53.51, "SUM22"=>2866.49, "SUM23"=>5224.53, "SUM24"=>6260.55, "SUM25"=>2354.91, "SUM26"=>3581.15, "SUM27"=>9169.99, "SUM28"=>6054.52, "SUM29"=>6369.44, "SUM30"=>7574.85, "SUM31"=>8647.9, "SUM32"=>1554.11, "SUM33"=>7022.72, "SUM34"=>4951.27, "SUM35"=>7240.15, "SUM36"=>4176.69}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 12 />", "DATE"=>"2020-10-19", "SUM1"=>5682.72, "SUM2"=>1232.91, "SUM3"=>3603.21, "SUM4"=>5295.43, "SUM5"=>1375.79, "SUM6"=>5841.94, "SUM7"=>1662.02, "SUM8"=>2918.1, "SUM9"=>7737.42, "SUM10"=>8276.64, "SUM11"=>5736.4, "SUM12"=>401.33, "SUM13"=>4512.51, "SUM14"=>415.39, "SUM15"=>6083.35, "SUM16"=>2595.59, "SUM17"=>4770.26, "SUM18"=>4867.49, "SUM19"=>3182.67, "SUM20"=>2933.74, "SUM21"=>2837.76, "SUM22"=>9761.54, "SUM23"=>1073.21, "SUM24"=>1575.35, "SUM25"=>6662.51, "SUM26"=>2927.37, "SUM27"=>907.38, "SUM28"=>5191.03, "SUM29"=>8271.52, "SUM30"=>8194.59, "SUM31"=>9466.31, "SUM32"=>8021.8, "SUM33"=>6342.07, "SUM34"=>4334.31, "SUM35"=>448.43, "SUM36"=>16.24}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 13 />", "DATE"=>"2020-10-19", "SUM1"=>7199.41, "SUM2"=>3725.63, "SUM3"=>2017.2, "SUM4"=>5895.04, "SUM5"=>281.27, "SUM6"=>7793.08, "SUM7"=>750.4, "SUM8"=>8396.51, "SUM9"=>4086.5, "SUM10"=>6612.37, "SUM11"=>4810.36, "SUM12"=>2684.18, "SUM13"=>6422.72, "SUM14"=>4585.47, "SUM15"=>2752.43, "SUM16"=>9842.42, "SUM17"=>2548.13, "SUM18"=>5806.32, "SUM19"=>540.05, "SUM20"=>8843.19, "SUM21"=>3936.17, "SUM22"=>9340.81, "SUM23"=>8475.94, "SUM24"=>8276.6, "SUM25"=>8604.49, "SUM26"=>7342.28, "SUM27"=>4220.87, "SUM28"=>3402.24, "SUM29"=>312.43, "SUM30"=>1171.83, "SUM31"=>806.29, "SUM32"=>9468.54, "SUM33"=>6957.11, "SUM34"=>7117.79, "SUM35"=>5176.61, "SUM36"=>4393.0}, {"GROUP"=>"GRP D", "CAPTION"=>"<Caption 14 />", "DATE"=>"2020-10-18", "SUM1"=>4338.14, "SUM2"=>6547.7, "SUM3"=>8413.18, "SUM4"=>4797.8, "SUM5"=>2317.66, "SUM6"=>8437.43, "SUM7"=>5996.69, "SUM8"=>5510.08, "SUM9"=>7032.77, "SUM10"=>1426.95, "SUM11"=>1875.96, "SUM12"=>2580.68, "SUM13"=>7209.25, "SUM14"=>4296.46, "SUM15"=>4997.19, "SUM16"=>7401.18, "SUM17"=>8729.14, "SUM18"=>7335.83, "SUM19"=>5531.14, "SUM20"=>4865.73, "SUM21"=>7971.58, "SUM22"=>4538.52, "SUM23"=>7031.38, "SUM24"=>8165.94, "SUM25"=>5014.85, "SUM26"=>5562.83, "SUM27"=>7040.22, "SUM28"=>1383.12, "SUM29"=>1240.99, "SUM30"=>8466.23, "SUM31"=>4119.69, "SUM32"=>3821.49, "SUM33"=>6342.87, "SUM34"=>7115.31, "SUM35"=>1190.06, "SUM36"=>3539.52}, {"GROUP"=>"GRP D", "CAPTION"=>"<Caption 15 />", "DATE"=>"2020-10-18", "SUM1"=>2368.86, "SUM2"=>60.52, "SUM3"=>3428.81, "SUM4"=>1465.86, "SUM5"=>7838.65, "SUM6"=>4864.46, "SUM7"=>999.68, "SUM8"=>3918.93, "SUM9"=>93.52, "SUM10"=>4285.2, "SUM11"=>3438.55, "SUM12"=>6544.37, "SUM13"=>2733.5, "SUM14"=>474.62, "SUM15"=>5134.76, "SUM16"=>6783.55, "SUM17"=>1334.28, "SUM18"=>5908.11, "SUM19"=>987.94, "SUM20"=>7368.63, "SUM21"=>6027.33, "SUM22"=>4833.66, "SUM23"=>3593.51, "SUM24"=>7277.87, "SUM25"=>2937.21, "SUM26"=>3415.65, "SUM27"=>5136.33, "SUM28"=>5769.08, "SUM29"=>7453.89, "SUM30"=>8371.68, "SUM31"=>2052.39, "SUM32"=>8116.7, "SUM33"=>9072.83, "SUM34"=>4490.4, "SUM35"=>6743.33, "SUM36"=>2108.02}]}
).
All you have to do is to merge your columns first
And then just insert main table with the second merge
template
Declaration
" Document structure
BEGIN OF ts_merge0,
a TYPE REF TO data, " Tree 1 In template {C-A}
END OF ts_merge0,
BEGIN OF ts_merge1,
t TYPE REF TO data, " Tree 2 In template {R-T}
END OF ts_merge1.
Insert columns as table or tree and then insert main data
" Columns
ro_xtt->merge( is_block = ls_merge0 iv_block_name = 'C' ).
" Rows
ro_xtt->merge( ls_merge1 ).
Explanation
The template could be limited to 1 column with conditional formatting
The example was created to demonstrate the addition of ‘show_if’