Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
27,911

Applies to:

      Webdynpro ABAP

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 .

Introduction

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.

Objective

To download Webdynpro ABAP table (header & line item) data in cell formatted excel sheet with colors, borders, filters.

Steps

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.

     

Code Sample:

            Step 1.Method  To_get_Flight_details.

                 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

Output

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).

12 Comments
Former Member
0 Kudos

Very useful... Good Work :smile:

bpawanchand
Active Contributor
0 Kudos

I did in the other way its very easy to write Simple transformation and call it under download action....

And generating XML code for simple transformation is just a two clicks away like yo save a sample test data by creating list and drop downs and save it as .xml file open it in a notepad copy paste the content in the transformation....

Former Member
0 Kudos

Hi   KIRUTHIKA,

i am not able  to save excel file as xml data could you please suggest me how you did this

Former Member
0 Kudos

Thanks for valuable info.

I am followed the abaove code to downalod the data to excel. But, I am facing the issue when I try to upload the same file third party system.

I have edited the file, then selected all the work sheet--> right click on work sheet--> select format cells -->Goto Number tab ( default) --> select "general'--> save the file.

After doing this, I can upload the file. how to avaoid editing the file? Appreaciaed for early response.

former_member206441
Contributor
0 Kudos

Hi Kiruthika,

I am also facing the same problem. I am also not able to save my excel sheet as XML data.

I am getting a message 'Cannot save XML because the workbook doesnot contain any XML mappings' It will be helpful for all the guys refering your great work.  Kindly guide us,,

Thanks & Regards

Arun.K.P

0 Kudos

Hi,

   create a excel file with whatever data u wants and then go to save as-> XML. then it will save the file in .XML format. Then open the  .xmlfile in notepad to retive the xml tags which wil be used further in our coding.

    Hope this will solve ur issue.

Regards,

Kiruthika P

0 Kudos

Hi,

   create a excel file with whatever data u wants and then go to save as-> XML. then it will save the file in .XML format. Then open the  .xmlfile in notepad to retive the xml tags which wil be used further in our coding.

    Hope this will solve ur issue

Regards,

Kiruthika P

former_member206441
Contributor
0 Kudos

Hi Kruthika,

Thank you for the quick response.. I tried to save the excel sheet as perscribed by you. But i am getting the 'Cannot save XML because the workbook doesnot contain any XML mappings' error.. please guide me i am using MS office 2007 version.

Regards

Arun.K.P

0 Kudos

Hi Arun,

    I am also using the MS office 2007 version only, Its working for me .I am not sure what is the issue in that. Can u send the sample excel file , I ll try from my side and I ll let u know.

Regards,

Kiruthika P

former_member206441
Contributor
0 Kudos

Hi Krithika

How can i send it to u?? u r mail id pls.. My id is arun676@gmail.com.

Regards

Arun.K.P

former_member205144
Active Participant
0 Kudos

Hi Kruthika,

  Very nice writing.

I am also using same logic. But, when I open the downloaded file, it is giving a warning message as in the screenshot.

Anybody know, if this warning can be avoided?

kaushiksampathkumar
Discoverer
0 Kudos

Hi Kiruthika,

Very good Article & its very useful.

Right its downloading the XML code in .xls format. Is there a way to download the XML code in .XLSX format?

Could you please suggest me. Thanks in advance.

Regards,

Kaushik

Labels in this area