xtt->MERGE( IV_BLOCK_NAME = ‘R’ IS_BLOCK =
{"CITYFROM"=>"FRANKFURT", "LANDXFROM"=>"Germany", "CITYTO"=>"BERLIN", "LANDXTO"=>"Germany", "CARRNAME"=>"Lufthansa", "CONNID"=>"2402", "FLDATE"=>"2023-11-03", "DEPTIME"=>"10:30:00", "ARRTIME"=>"11:35:00", "PRICE"=>242.0, "CURRENCY"=>"EUR", "SEATSMAX"=>475, "SEATSOCC"=>451, "_GROUP1"=>"FRANKFURT-Germany-BERLIN-Germany", "T_COLOR"=>[]}{"CITYFROM"=>"FRANKFURT", "LANDXFROM"=>"Germany", "CITYTO"=>"BERLIN", "LANDXTO"=>"Germany", "CARRNAME"=>"Lufthansa", "CONNID"=>"2402", "FLDATE"=>"2024-01-22", "DEPTIME"=>"10:30:00", "ARRTIME"=>"11:35:00", "PRICE"=>242.0, "CURRENCY"=>"EUR", "SEATSMAX"=>475, "SEATSOCC"=>452, "_GROUP1"=>"FRANKFURT-Germany-BERLIN-Germany", "T_COLOR"=>[]}{"CITYFROM"=>"FRANKFURT", "LANDXFROM"=>"Germany", "CITYTO"=>"BERLIN", "LANDXTO"=>"Germany", "CARRNAME"=>"Lufthansa", "CONNID"=>"2402", "FLDATE"=>"2024-04-11", "DEPTIME"=>"10:30:00", "ARRTIME"=>"11:35:00", "PRICE"=>242.0, "CURRENCY"=>"EUR", "SEATSMAX"=>475, "SEATSOCC"=>461, "_GROUP1"=>"FRANKFURT-Germany-BERLIN-Germany", "T_COLOR"=>[{"FNAME"=>"PRICE", "COLOR"=>{"COL"=>5, "INT"=>"0 ", "INV"=>0}, "NOKEYCOL"=>""}]}{"CITYFROM"=>"FRANKFURT", "LANDXFROM"=>"Germany", "CITYTO"=>"BERLIN", "LANDXTO"=>"Germany", "CARRNAME"=>"Lufthansa", "CONNID"=>"2402", "FLDATE"=>"2024-04-28", "DEPTIME"=>"10:30:00", "ARRTIME"=>"11:35:00", "PRICE"=>242.0, "CURRENCY"=>"EUR", "SEATSMAX"=>475, "SEATSOCC"=>461, "_GROUP1"=>"FRANKFURT-Germany-BERLIN-Germany", "T_COLOR"=>[]}{"CITYFROM"=>"FRANKFURT", "LANDXFROM"=>"Germany", "CITYTO"=>"BERLIN", "LANDXTO"=>"Germany", "CARRNAME"=>"Lufthansa", "CONNID"=>"2402", "FLDATE"=>"2024-05-28", "DEPTIME"=>"10:30:00", "ARRTIME"=>"11:35:00", "PRICE"=>242.0, "CURRENCY"=>"EUR", "SEATSMAX"=>475, "SEATSOCC"=>460, "_GROUP1"=>"FRANKFURT-Germany-BERLIN-Germany", "T_COLOR"=>[{"FNAME"=>"SEATSMAX", "COLOR"=>{"COL"=>6, "INT"=>"0 ", "INV"=>0}, "NOKEYCOL"=>""}]}{"CITYFROM"=>"FRANKFURT", "LANDXFROM"=>"Germany", "CITYTO"=>"BERLIN", "LANDXTO"=>"Germany", "CARRNAME"=>"Lufthansa", "CONNID"=>"2402", "FLDATE"=>"2024-06-30", "DEPTIME"=>"10:30:00", "ARRTIME"=>"11:35:00", "PRICE"=>242.0, "CURRENCY"=>"EUR", "SEATSMAX"=>475, "SEATSOCC"=>459, "_GROUP1"=>"FRANKFURT-Germany-BERLIN-Germany", "T_COLOR"=>[{"FNAME"=>"PRICE", "COLOR"=>{"COL"=>5, "INT"=>"0 ", "INV"=>0}, "NOKEYCOL"=>""}]}{"CITYFROM"=>"FRANKFURT", "LANDXFROM"=>"Germany", "CITYTO"=>"BERLIN", "LANDXTO"=>"Germany", "CARRNAME"=>"Lufthansa", "CONNID"=>"2402", "FLDATE"=>"2024-09-18", "DEPTIME"=>"10:30:00", "ARRTIME"=>"11:35:00", "PRICE"=>242.0, "CURRENCY"=>"EUR", "SEATSMAX"=>475, "SEATSOCC"=>189, "_GROUP1"=>"FRANKFURT-Germany-BERLIN-Germany", "T_COLOR"=>[{"FNAME"=>"SEATSMAX", "COLOR"=>{"COL"=>3, "INT"=>"0 ", "INV"=>0}, "NOKEYCOL"=>""}]}{"CITYFROM"=>"FRANKFURT", "LANDXFROM"=>"Germany", "CITYTO"=>"BERLIN", "LANDXTO"=>"Germany", "CARRNAME"=>"Lufthansa", "CONNID"=>"2402", "FLDATE"=>"2024-12-07", "DEPTIME"=>"10:30:00", "ARRTIME"=>"11:35:00", "PRICE"=>242.0, "CURRENCY"=>"EUR", "SEATSMAX"=>475, "SEATSOCC"=>32, "_GROUP1"=>"FRANKFURT-Germany-BERLIN-Germany", "T_COLOR"=>[]}{"CITYFROM"=>"FRANKFURT", "LANDXFROM"=>"Germany", "CITYTO"=>"TOKYO", "LANDXTO"=>"Japan", "CARRNAME"=>"Japan Airlines", "CONNID"=>"0408", "FLDATE"=>"2023-11-03", "DEPTIME"=>"20:25:00", "ARRTIME"=>"15:40:00", "PRICE"=>1061.36, "CURRENCY"=>"JPY", "SEATSMAX"=>385, "SEATSOCC"=>367, "_GROUP1"=>"FRANKFURT-Germany-TOKYO-Japan", "T_COLOR"=>[{"FNAME"=>"PRICE", "COLOR"=>{"COL"=>5, "INT"=>"0 ", "INV"=>0}, "NOKEYCOL"=>""}]}{"CITYFROM"=>"FRANKFURT", "LANDXFROM"=>"Germany", "CITYTO"=>"TOKYO", "LANDXTO"=>"Japan", "CARRNAME"=>"Japan Airlines", "CONNID"=>"0408", "FLDATE"=>"2024-01-22", "DEPTIME"=>"20:25:00", "ARRTIME"=>"15:40:00", "PRICE"=>1061.36, "CURRENCY"=>"JPY", "SEATSMAX"=>385, "SEATSOCC"=>373, "_GROUP1"=>"FRANKFURT-Germany-TOKYO-Japan", "T_COLOR"=>[{"FNAME"=>"SEATSMAX", "COLOR"=>{"COL"=>6, "INT"=>"0 ", "INV"=>0}, "NOKEYCOL"=>""}]}{"CITYFROM"=>"FRANKFURT", "LANDXFROM"=>"Germany", "CITYTO"=>"TOKYO", "LANDXTO"=>"Japan", "CARRNAME"=>"Japan Airlines", "CONNID"=>"0408", "FLDATE"=>"2024-04-11", "DEPTIME"=>"20:25:00", "ARRTIME"=>"15:40:00", "PRICE"=>1061.36, "CURRENCY"=>"JPY", "SEATSMAX"=>385, "SEATSOCC"=>373, "_GROUP1"=>"FRANKFURT-Germany-TOKYO-Japan", "T_COLOR"=>[]}{"CITYFROM"=>"FRANKFURT", "LANDXFROM"=>"Germany", "CITYTO"=>"TOKYO", "LANDXTO"=>"Japan", "CARRNAME"=>"Japan Airlines", "CONNID"=>"0408", "FLDATE"=>"2024-06-30", "DEPTIME"=>"20:25:00", "ARRTIME"=>"15:40:00", "PRICE"=>1061.36, "CURRENCY"=>"JPY", "SEATSMAX"=>385, "SEATSOCC"=>364, "_GROUP1"=>"FRANKFURT-Germany-TOKYO-Japan", "T_COLOR"=>[{"FNAME"=>"PRICE", "COLOR"=>{"COL"=>5, "INT"=>"0 ", "INV"=>0}, "NOKEYCOL"=>""}]}{"CITYFROM"=>"FRANKFURT", "LANDXFROM"=>"Germany", "CITYTO"=>"TOKYO", "LANDXTO"=>"Japan", "CARRNAME"=>"Japan Airlines", "CONNID"=>"0408", "FLDATE"=>"2024-09-18", "DEPTIME"=>"20:25:00", "ARRTIME"=>"15:40:00", "PRICE"=>1061.36, "CURRENCY"=>"JPY", "SEATSMAX"=>385, "SEATSOCC"=>51, "_GROUP1"=>"FRANKFURT-Germany-TOKYO-Japan", "T_COLOR"=>[]}{"CITYFROM"=>"FRANKFURT", "LANDXFROM"=>"Germany", "CITYTO"=>"TOKYO", "LANDXTO"=>"Japan", "CARRNAME"=>"Japan Airlines", "CONNID"=>"0408", "FLDATE"=>"2024-12-07", "DEPTIME"=>"20:25:00", "ARRTIME"=>"15:40:00", "PRICE"=>1061.36, "CURRENCY"=>"JPY", "SEATSMAX"=>385, "SEATSOCC"=>15, "_GROUP1"=>"FRANKFURT-Germany-TOKYO-Japan", "T_COLOR"=>[{"FNAME"=>"SEATSMAX", "COLOR"=>{"COL"=>3, "INT"=>"0 ", "INV"=>0}, "NOKEYCOL"=>""}]}{"CITYFROM"=>"FRANKFURT", "LANDXFROM"=>"Germany", "CITYTO"=>"NEW YORK", "LANDXTO"=>"USA", "CARRNAME"=>"Lufthansa", "CONNID"=>"0400", "FLDATE"=>"2023-11-03", "DEPTIME"=>"10:10:00", "ARRTIME"=>"11:34:00", "PRICE"=>666.0, "CURRENCY"=>"EUR", "SEATSMAX"=>330, "SEATSOCC"=>321, "_GROUP1"=>"FRANKFURT-Germany-NEW YORK-USA", "T_COLOR"=>[{"FNAME"=>"PRICE", "COLOR"=>{"COL"=>5, "INT"=>"0 ", "INV"=>0}, "NOKEYCOL"=>""}, {"FNAME"=>"SEATSMAX", "COLOR"=>{"COL"=>6, "INT"=>"0 ", "INV"=>0}, "NOKEYCOL"=>""}]}
).
Classes for storing templates
Previously, to create a report, you had to select one of the available classes for template storing
Namely:
- ZCL_XTT_FILE_SMW0 For templates tr. SMW0 (most common)
- ZCL_XTT_FILE_OAOR tr. OAOR is convenient because there is a built-in BDS versioning for templates
- ZCL_XTT_FILE_RAW Mainly used for templates based on String (less commonly xString) and ZCL_XTT_HTML class. Which in turn is used most often for sending letters
Tabular reports
If you often create reports based on CL_SALV_TABLE or CL_GUI_ALV_GRID using subtotals and data grouping, and at the same time you do not want to create an Excel template that just repeats ALV output, this class will help you with this.
This class ZCL_XTT_FILE_GRID creates an empty template for ZCL_XTT_EXCEL_XLSX and has a number of advantages over standard export to Excel
Different colors for subtotals (line 20) and modern Calibri font
If subtotals are grouped
In the final report, the data will also be grouped
ALV coloring
Also in ALV you can use 3 colors col_positive (green), col_negative(red) and col_total (yellow)
Technically this feature is implemented by conditional formatting
PS:
If your report is based on the CL_SALV_TABLE class and you need the CL_GUI_ALV_GRID class to pass to the ZCL_XTT_FILE_GRID constructor.
You can use ZCL_EUI_CONV=>GET_GRID_FROM_SALV() method to convert object references