Applies to:
Summary
This article is to download Webdynpro ABAP table (header & line item) data in cell formatted excel sheet with colors, borders, filters. It was not possible to download data in Cell formatted Excel sheet using Webdynpro ABAP. To make this objective possible, we can use XML mapping. For the XML mapping, create a dummy Excel Sheet with expected Cell formatting and save it as XML file. Use this XML tags in the method logic of Webdynpro ABAP coding.
Author(s): KIRUTHIKA P
Company: L & T Infotech
Created on: 20 February 2012
Author Bio
Kiruthika P is working as a SAP Technical ABAP consultant for one year in L & T Infotech. I am very much interested in learning new technologies in SAP. Currently I am working in Web Dynpro ABAP and ISU .
This article is to download Webdynpro ABAP table (header & line item) data in cell formatted excel sheet with colors, borders, filters. It was not possible to download data in Cell formatted Excel sheet using Webdynpro ABAP. To make this objective possible, we can use XML mapping. For the XML mapping, create a dummy Excel Sheet with expected Cell formatting and save it as XML file. Use this XML tags in the method logic of Webdynpro ABAP coding.
To download Webdynpro ABAP table (header & line item) data in cell formatted excel sheet with colors, borders, filters.
1. Create one Webdynpro Component
Go to SE80 -> Create Webdynpro component.
Give name of Webdynpro component and click Display Icon.
Then it will show one pop up message to create the component.
Click Yes.
2.Create the component with view and window.
Give the description for Webdynpro component.
3. Save the component in local object or package.
4. Create a node (Node_Sflight) in Context of Component Controller.
5.Create a attribute in the node for table popin of type string.
6.Create a sub node (Node_sbook) under Node_Sflight.
7.Now context of Component Controller looks like as below.
8. Map the Context of Component Controller to view.
9. In layout of main View,Create one button “Get Flight” to get the flight details.
Under the On_action properties of this element create one event “Flight_Details”.
10.Create one table to display the header data flight details.
11.The table is binded to ‘Node_Sflight’.
12.Insert one new table column for popin from the table.
13.In that column, Insert cell variant.
14.Go to the properties of “Table_popin_toggle_cell” in table column and provide ‘TOGGLE_CELL’ in
‘Variant key’ property.
15.Go to the properties of Table Column and provide ‘TOGGLE_CELL’ in ‘Selected Cell Variant’ property
as in figure.
16.Go to the properties of ‘Table’ and bind Selected Popin property with table_popin attribute of node_Sflight.
17.Create a popin window by Insert Table popin.
18.In that popin, create a transparent container.
19.Create a table in the container to show the line data details of a particular flight.
20.The table in the popin is binded to subnode ‘Node_Sbook’.
21.Create another button “Export To Excel” which is used to export data from table to Excel Sheet.
Under the On_action properties of this element create one event “Export_Excel”.
22.Go to methods tab. Then write logic for all the methods.
23.In the method list, Go to Get_Flights and click the code wizard.
24. By the code wizard, read the main node and sub node.
25.In Export_To _Excel method ,write logic to export data with formats such as borders,Colors, etc.
26.In Webdynpro ABAP, no direct code for cell formatted excels. So create one dummy excel sheet with expected cell formatted features (colors, borders, filter, headers, etc).
27.Save the Excel file as XML data.
28. XML data mapped Excel file is in this format.
29.Open this file with notepad and map this XML data to coding.
30.The resulting XML tags are appended to code of Export_to_Excel.
31.After creating all methods, save and activate it.
32.Create a Webdynpro application for the Webdynpro component.
33.Then Save and Activate the entire component.
34.Go to web Dynpro application and then test the application.
To get list of flights details by the method.
METHOD onactionto_get_flights .
* Declarations
DATA lo_nd_node_sflight TYPE REF TO if_wd_context_node.
DATA lo_el_node_sflight TYPE REF TO if_wd_context_element.
DATA ls_node_sflight TYPE wd_this->element_node_sflight.
DATA lt_sflight TYPE wd_this->elements_node_sflight.
* navigate from <CONTEXT> to <NODE_SFLIGHT> via lead selection
lo_nd_node_sflight = wd_context->get_child_node( name = wd_this->wdctx_node_sflight ).
* To get static attributes table
lo_nd_node_sflight->get_static_attributes_table(IMPORTING
table = lt_sflight ).
*To fill internal table
SELECT * FROM sflight
INTO CORRESPONDING FIELDS OF TABLE lt_sflight.
* get element via lead selection
lo_el_node_sflight = lo_nd_node_sflight->get_element( ).
* @TODO handle not set lead selection
IF lo_el_node_sflight IS INITIAL.
ENDIF.* To bind the internal table to main node
lo_nd_node_sflight->bind_table( lt_sflight ).**********---------------------------------------------******************
* Declarations of sub node
DATA lo_nd_node_sbook TYPE REF TO if_wd_context_node.
DATA lo_el_node_sbook TYPE REF TO if_wd_context_element.
DATA ls_node_sbook TYPE wd_this->element_node_sbook.
DATA lt_sbook TYPE wd_this->elements_node_sbook .
* navigate from <CONTEXT> to <NODE_SBOOK> via lead selection
lo_nd_node_sbook = wd_context->path_get_node( path = `NODE_SFLIGHT.NODE_SBOOK` ).
* @TODO handle not set lead selection
IF lo_el_node_sbook IS INITIAL.
ENDIF.
* To fill the popin internal table based on values in first internal table
SELECT * FROM sbook
INTO CORRESPONDING FIELDS OF TABLE lt_sbook
FOR ALL ENTRIES IN lt_sflight
WHERE carrid = lt_sflight-carrid AND
connid = lt_sflight-connid AND
fldate = lt_sflight-fldate.
* To bind internal table to the node
IF lo_nd_node_sbook IS NOT INITIAL.
lo_nd_node_sbook->bind_table( lt_sbook ).
ENDIF
Step 2. Method_Linedata
Next to get the lineitem data for particular header row.
METHOD onactionlinedata .* Declarations
DATA lo_nd_node_sflight TYPE REF TO if_wd_context_node.
DATA lo_el_node_sflight TYPE REF TO if_wd_context_element.
DATA ls_node_sflight TYPE wd_this->element_node_sflight.
DATA lt_sflight TYPE wd_this->elements_node_sflight.
* navigate from <CONTEXT> to <SFLIGHT> via lead selection
lo_nd_node_sflight = wd_context->get_child_node( name = wd_this->wdctx_node_sflight).
* get element via lead selection
lo_el_node_sflight = lo_nd_node_sflight->get_element( ).
* Declarations
DATA lt_sbook TYPE wd_this->elements_node_sbook.
DATA lo_nd_node_sbook TYPE REF TO if_wd_context_node.
DATA lo_el_node_sbook TYPE REF TO if_wd_context_element.
DATA ls_sbook TYPE wd_this->element_node_sbook.
* navigate from <CONTEXT> to <SBOOK> via lead selection
lo_nd_node_sbook = wd_context->path_get_node (path = `NODE_SFLIGHT.NODE_SBOOK` ).
* @TODO handle non existant child
IF lo_nd_node_sbook IS NOT INITIAL.
lo_el_node_sbook = lo_nd_node_sbook->get_element( ).
ENDIF.
* Filling the linedata internal table
SELECT * FROM sbook
INTO CORRESPONDING FIELDS OF TABLE lt_sbook
FOR ALL ENTRIES IN lt_sflight
WHERE carrid = lt_sflight-carrid AND
connid = lt_sflight-connid AND
fldate = lt_sflight-fldate.
* To bind internal table to line data node
IF lo_nd_node_sbook IS NOT INITIAL.
lo_nd_node_sbook->bind_table( lt_sbook ).
ENDIF.ENDMETHOD.
Step 3. Method_Export_To_Excel
And now the final piece of the article is to take action in response to the click of button “EXPORT_TO_EXCEL”
METHOD onactionexport_to_excel .* declarations
DATA lo_nd_sflight TYPE REF TO if_wd_context_node.
DATA lo_el_sflight TYPE REF TO if_wd_context_element.
DATA ls_sflight TYPE wd_this->element_sflight.
DATA lt_sflight TYPE wd_this->elements_sflight.
DATA text TYPE string.
DATA xtext TYPE xstring.
DATA lv_sno(3) TYPE n.
DATA lv_space TYPE c VALUE ' '.
* navigate from <CONTEXT> to <SFLIGHT> via lead selection
lo_nd_sflight = wd_context->get_child_node( name = wd_this->wdctx_sflight ).
* get element via lead selection
lo_el_sflight = lo_nd_sflight->get_element( ).
DATA : lv_parent_index TYPE i.
CALL METHOD lo_el_sflight->get_index
RECEIVING
my_index = lv_parent_index.
* get all declared attributes
lo_nd_sflight->get_static_attributes_table(
IMPORTING
table = lt_sflight ).
* declarations
DATA lo_nd_sbook TYPE REF TO if_wd_context_node.
DATA lo_el_sbook TYPE REF TO if_wd_context_element.
DATA ls_sbook TYPE wd_this->element_sbook.
DATA lt_sbook TYPE wd_this->elements_sbook.
*Assign initial value
lv_sno = 1.
lo_nd_sbook = wd_context->path_get_node( path = `SFLIGHT.SBOOK` ).**************************************************************************** declarations for xml data
DATA p_t_xml_data TYPE TABLE OF tline.
FIELD-SYMBOLS <fs_xml> TYPE tline.
* append xml data to this code
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<?xml version="1.0"?>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text .
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<?mso-application progid="Excel.Sheet"?>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text .
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text .
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : 'xmlns:o="urn:schemas-microsoft-com:office:office"' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text .
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : 'xmlns:x="urn:schemas-microsoft-com:office:excel"' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text .
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : 'xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text .
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : 'xmlns:html="http://www.w3.org/TR/REC-html40">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Author>281153</Author>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<LastAuthor>295231</LastAuthor>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Created>2011-12-05T10:59:08Z</Created>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<LastSaved>2011-12-27T06:14:56Z</LastSaved>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Company>lnt</Company>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Version>12.00</Version>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' </DocumentProperties>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<WindowHeight>7560</WindowHeight>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<WindowWidth>7500</WindowWidth>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <WindowTopX>360</WindowTopX>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <WindowTopY>105</WindowTopY>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <ProtectStructure>False</ProtectStructure>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <ProtectWindows>False</ProtectWindows>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' </ExcelWorkbook>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Styles>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Style ss:ID="Default" ss:Name="Normal">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Alignment ss:Vertical="Bottom"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Borders/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Interior/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <NumberFormat/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Protection/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' </Style>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Style ss:ID="s16">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000" ss:Bold="1"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Interior ss:Color="#FAC090" ss:Pattern="Solid"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '</Style>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Style ss:ID="s17">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000" ss:Bold="1"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Interior ss:Color="#E46D0A" ss:Pattern="Solid"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '</Style>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
**
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Style ss:ID="s18">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Borders>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '</Borders>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE :'<Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000" ss:Bold="1"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Interior ss:Color="#E46D0A" ss:Pattern="Solid"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.*
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '</Style>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.*
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Style ss:ID="s19">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Borders>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '</Borders>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000" ss:Bold="1"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Interior ss:Color="#FAC090" ss:Pattern="Solid"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '</Style>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Style ss:ID="s20">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Borders> ' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/> ' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/> ' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '</Borders>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '</Style>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Style ss:ID="s21">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Borders>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '</Borders>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Bold="1"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Interior ss:Color="#FFC000" ss:Pattern="Solid"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '</Style>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Style ss:ID="s22">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Borders>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Border ss:Position="Bottom" ss:Line="Continuous" ss:Weight="2"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' </Borders>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Bold="1"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Interior ss:Color="#FFC000" ss:Pattern="Solid"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' </Style>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Style ss:ID="s23">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Borders>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' </Borders>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Bold="1"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Interior ss:Color="#FFC000" ss:Pattern="Solid"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' </Style>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Style ss:ID="s24">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Borders>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' </Borders>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' </Style>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' </Styles>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Worksheet ss:Name="Sheet1">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Names>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <NamedRange ss:Name="_FilterDatabase" ss:RefersTo="=Sheet1!R1C1:R1C6" ss:Hidden="1"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '</Names>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Table ss:ExpandedColumnCount="6" x:FullColumns="1" x:FullRows="1" ss:DefaultRowHeight="15">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Column ss:AutoFitWidth="0" ss:Width="54"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Column ss:StyleID="s20" ss:AutoFitWidth="0" ss:Width="63.75"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Column ss:AutoFitWidth="0" ss:Width="72"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Column ss:StyleID="s20" ss:AutoFitWidth="0" ss:Width="69.75"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Column ss:AutoFitWidth="0" ss:Width="61.5"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Column ss:StyleID="s20" ss:AutoFitWidth="0" ss:Width="111"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Row ss:Height="15.75">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Cell ss:StyleID="s21"><Data ss:Type="String">Sr No.</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Cell ss:StyleID="s21"><Data ss:Type="String">carr id</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Cell ss:StyleID="s21"><Data ss:Type="String">conn id</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Cell ss:StyleID="s21"><Data ss:Type="String">fldate</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Cell ss:StyleID="s21"><Data ss:Type="String">currency</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Cell ss:StyleID="s21"><Data ss:Type="String">plane type</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '</Row>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
**************************************************************************
LOOP AT lt_sflight INTO ls_sflight.
*Start Of Master Bath Data
******************* Area ****************************************
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Row>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text .
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
CONCATENATE '<Cell ss:StyleID="s17"><Data ss:Type="String">' lv_sno '</Data></Cell>' INTO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text .
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
CONCATENATE '<Cell ss:StyleID="s18"><Data ss:Type="String">' ls_sflight-carrid '</Data></Cell>' INTO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text .
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
CONCATENATE '<Cell ss:StyleID="s17"><Data ss:Type="String">' ls_sflight-connid '</Data></Cell>' INTO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text .
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
CONCATENATE '<Cell ss:StyleID="s18"><Data ss:Type="String">' ls_sflight-fldate '</Data></Cell>' INTO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text .
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
CONCATENATE '<Cell ss:StyleID="s17"><Data ss:Type="String">' ls_sflight-currency '</Data></Cell>' INTO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text .
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
CONCATENATE '<Cell ss:StyleID="s18"><Data ss:Type="String">' ls_sflight-planetype '</Data></Cell>' INTO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text .
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '</Row>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.*********************************************************Filling linedata XML data
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Row>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Cell ss:Index="3" ss:StyleID="s16"><Data ss:Type="String">connid</Data></Cell>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Cell ss:StyleID="s19"><Data ss:Type="String">carrid</Data></Cell>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Cell ss:StyleID="s16"><Data ss:Type="String">bookid</Data></Cell>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Cell ss:StyleID="s19"><Data ss:Type="String">custid</Data></Cell>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '</Row>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.**************************************************************************************
lo_el_sflight = lo_nd_sflight->get_element( index = lv_parent_index ).
lo_nd_sflight->get_static_attributes(
IMPORTING
static_attributes = ls_sflight ).
LOOP AT lt_sbook INTO ls_sbook .
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<Row>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
CONCATENATE '<Cell ss:Index="3"><Data ss:Type="String">' ls_sbook-connid '</Data></Cell>' INTO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text .
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
CONCATENATE '<Cell ><Data ss:Type="String">' ls_sbook-carrid '</Data></Cell>' INTO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text .
.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
CONCATENATE '<Cell ><Data ss:Type="String">' ls_sbook- fldate '</Data></Cell>' INTO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text .
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
CONCATENATE '<Cell ><Data ss:Type="String">' ls_sbook-customid '</Data></Cell>' INTO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text .
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '</Row>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
ENDLOOP.**************************************************************************************
lv_sno = lv_sno + 1.
ENDLOOP.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '</Table>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <PageSetup>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Header x:Margin="0.3"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Footer x:Margin="0.3"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' </PageSetup> ' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Print>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <ValidPrinterInfo/> ' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <HorizontalResolution>600</HorizontalResolution> ' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <VerticalResolution>600</VerticalResolution> ' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' </Print> ' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <Selected/>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <ProtectObjects>False</ProtectObjects>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' <ProtectScenarios>False</ProtectScenarios>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' </WorksheetOptions>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '<AutoFilter x:Range="R1C1:R1C6" xmlns="urn:schemas-microsoft-com:office:excel">' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : '</AutoFilter>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' </Worksheet>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
APPEND INITIAL LINE TO p_t_xml_data
ASSIGNING <fs_xml>.
MOVE : ' </Workbook>' TO <fs_xml>-tdline.
CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.
*************************************************************************************** Func module to dispaly data in EXcel sheet
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = text
IMPORTING
buffer = xtext.
DATA: filename TYPE string ,
str1 TYPE string VALUE 'flight-' ,
flight_number TYPE c LENGTH 10,
lv_estimation TYPE c.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = lv_estimation
IMPORTING
output = flight_number.
CONCATENATE str1 flight_number '.xls' INTO filename .
wdr_task=>client_window->client->attach_file_to_response(***path to the excel file
i_filename = filename** String Variable
i_content = xtext** File Type
i_mime_type = 'EXCEL' ).
ENDMETHOD.
Tool & Technology: Webdynpro ABAP, XML mapping
When user clicks Get Flights button, flight info gets displayed.
When user clicks "Export to Excel" button, data is downloaded to Cell Formatted Excel Sheet ( with colours,borders,filters,etc).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
20 | |
10 | |
9 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
2 |