VF05 report screent to be copied into formated excel sheet

I would like to copy the VF05 Report screen into formatted excel sheet.
on the output screen of VF05 report, I tried settings-> Display variants:  here i have selected the layout, but the data could not copied into this layout
Please help me how this can be done.
VERY URGENT

hello, friend.
as i understand, you want to export the data from VF05 to an excel file.  if this is correct, do the following...
first exectue VF05.  input the necessary data (payer, material, date ranges, billing type, etc.)
on the next screen, on the menu go to LIST > SAVE > FILE.  chosse "Spreadsheet" and ENTER.  specify where you want to save the file, the title and the file type (EXCEL file).  click "Generate".
now, on your PC, click on the file that you saved.  you will now get your report in Excel format.
hope this helped you.
regards.
jty

Similar Messages

  • How to save each section report into different excel sheet?

    Hi all
    How to save each section report into different excel sheet?
    I have a report in which there are 4 sections north south west east now i need to save north in excel sheet 1 , south in sheet2, west in sheet3, and east in sheet4. under each section there is list report.
    Please let me know is it possible are not if possible let me no the procedure to be followed.
    Thank you

    If you're running XI 3.1 you might be able to solve this as follows.
    1. Create four users: east, west, north, south
    2. Create a profile that filters on the variable you used for the section/break
    3. Publish the report
    3.1 Set users created above to be the enterprise recipients
    3.2 Add personalization (the profile created above)
    3.3 Check the Deliver objects to each user in Destinations
    (3.4 You could use %SI_OWNER% to get a nice suffix to the report name)
    This should cause four reports to be created, each with its own "personalized" contents.

  • Sending a formatted Excel sheet as an attachment in a mail.

    Hi ,
    I have been using following code to to send formatted excel sheet as attachment in email.
    in the below code I want to change the format of cell from Bold to Underline.
    I have replaced Bold with Underline for below code but it is not working can anyone suggest on this.
    Department
      r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).
      r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Header' ).
      r_data = l_document->create_simple_element( name = 'Data'  value = 'MATNR'  parent = r_cell ).
      r_data->set_attribute_ns( name = 'Type'  prefix = 'ss' value = 'String' ).
      r_format->set_attribute_ns( name = 'Bold'  prefix = 'ss'  value = '1' ).
    Creating a ixml Factory
      l_ixml = cl_ixml=>create( ).
    Creating the DOM Object Model
      l_document = l_ixml->create_document( ).
    Create Root Node 'Workbook'
      l_element_root  = l_document->create_simple_element( name = 'Workbook'  parent = l_document ).  l_element_root->set_attribute( name = 'xmlns'  value = 'urn:schemas-microsoft-com:office:spreadsheet' ).   ns_attribute = l_document->create_namespace_decl( name = 'ss'  prefix = 'xmlns'  uri = 'urn:schemas-microsoft-com:office:spreadsheet' ).  l_element_root->set_attribute_node( ns_attribute ).   ns_attribute = l_document->create_namespace_decl( name = 'x'  prefix = 'xmlns'  uri = 'urn:schemas-microsoft-com:office:excel' ).  l_element_root->set_attribute_node( ns_attribute ).
    Create node for document properties.
      r_element_properties = l_document->create_simple_element( name = 'TEST_REPORT'  parent = l_element_root ).  l_value = sy-uname.  l_document->create_simple_element( name = 'Author'  value = l_value  parent = r_element_properties  ).
    Styles
      r_styles = l_document->create_simple_element( name = 'Styles'  parent = l_element_root  ).
    Style for Header
      r_style  = l_document->create_simple_element( name = 'Style'   parent = r_styles  ).  r_style->set_attribute_ns( name = 'ID'  prefix = 'ss'  value = 'Header' ).   r_format  = l_document->create_simple_element( name = 'Font'  parent = r_style  ).
    Worksheet
      r_worksheet = l_document->create_simple_element( name = 'Worksheet'  parent = l_element_root ).  r_worksheet->set_attribute_ns( name = 'Name'  prefix = 'ss'  value = 'PO Details' ).
    Table
      r_table = l_document->create_simple_element( name = 'Table'  parent = r_worksheet ).  r_table->set_attribute_ns( name = 'FullColumns'  prefix = 'x'  value = '1' ).  r_table->set_attribute_ns( name = 'FullRows'     prefix = 'x'  value = '1' ).
    Column Formatting
      r_column = l_document->create_simple_element( name = 'Column'  parent = r_table ).  r_column->set_attribute_ns( name = 'Width'  prefix = 'ss'  value = '70' ).   r_column = l_document->create_simple_element( name = 'Column'  parent = r_table ).  r_column->set_attribute_ns( name = 'Width'  prefix = 'ss'  value = '70' ).   r_column = l_document->create_simple_element( name = 'Column'  parent = r_table ).  r_column->set_attribute_ns( name = 'Width'  prefix = 'ss'  value = '70' ).   r_column = l_document->create_simple_element( name = 'Column'  parent = r_table ).  r_column->set_attribute_ns( name = 'Width'  prefix = 'ss'  value = '70' ).   r_column = l_document->create_simple_element( name = 'Column'  parent = r_table ).  r_column->set_attribute_ns( name = 'Width'  prefix = 'ss'  value = '70' ).
    Blank Row
      r_row = l_document->create_simple_element( name = 'Row'  parent = r_table ).
    Column Headers Row
      r_row = l_document->create_simple_element( name = 'Row'  parent = r_table ).  r_row->set_attribute_ns( name = 'AutoFitHeight'  prefix = 'ss'  value = '1' ).
    Sr. No.
      r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).  r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Header' ).  r_data = l_document->create_simple_element( name = 'Data'  value = 'EBELN'  parent = r_cell ).  r_data->set_attribute_ns( name = 'Type'  prefix = 'ss' value = 'String' ).
    User Name
      r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).  r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Header' ).  r_data = l_document->create_simple_element( name = 'Data'  value = 'EBELP'  parent = r_cell ).  r_data->set_attribute_ns( name = 'Type'  prefix = 'ss' value = 'String' ).
    Full Name
      r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).  r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Header' ).  r_data = l_document->create_simple_element( name = 'Data'  value = 'AEDAT'  parent = r_cell ).  r_data->set_attribute_ns( name = 'Type'  prefix = 'ss' value = 'String' ).
    Department
      r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).  r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Header' ).  r_data = l_document->create_simple_element( name = 'Data'  value = 'MATNR'  parent = r_cell ).  r_data->set_attribute_ns( name = 'Type'  prefix = 'ss' value = 'String' ).  r_format->set_attribute_ns( name = 'Bold'  prefix = 'ss'  value = '1' ).   r_format  = l_document->create_simple_element( name = 'Interior' parent = r_style  ).  r_format->set_attribute_ns( name = 'Color'   prefix = 'ss'  value = '#C0C0C0' ).  r_format->set_attribute_ns( name = 'Pattern' prefix = 'ss'  value = 'Solid' ).   r_format  = l_document->create_simple_element( name = 'Alignment'  parent = r_style  ).  r_format->set_attribute_ns( name = 'Vertical'  prefix = 'ss'  value = 'Center' ).  r_format->set_attribute_ns( name = 'WrapText'  prefix = 'ss'  value = '1' ).
    Data Table
      LOOP AT it_ekpo INTO wa_ekpo.     r_row = l_document->create_simple_element( name = 'Row'  parent = r_table ).
    Sr. No.
       r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).
       r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Data' ).
       l_value = sy-tabix.
       CONDENSE l_value NO-GAPS.
       r_data = l_document->create_simple_element( name = 'Data'  value = l_value   parent = r_cell ).           " Data
       r_data->set_attribute_ns( name = 'Type'  prefix = 'ss'  value = 'Number' ).                               " Cell format
    EBELN
        r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).    r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Data' ).    l_value = wa_ekpo-ebeln.    r_data = l_document->create_simple_element( name = 'Data'  value = l_value   parent = r_cell ).           " Data    r_data->set_attribute_ns( name = 'Type'  prefix = 'ss'  value = 'String' ).                               " Cell format
    EBELP
        r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).    r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Data' ).    l_value = wa_ekpo-ebelp.    r_data = l_document->create_simple_element( name = 'Data'  value = l_value   parent = r_cell ).           " Data    r_data->set_attribute_ns( name = 'Type'  prefix = 'ss'  value = 'String' ).                               " Cell format
    AEDAT
        r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).    r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Data' ).    l_value = wa_ekpo-aedat.    r_data = l_document->create_simple_element( name = 'Data'  value = l_value   parent = r_cell ).           " Data    r_data->set_attribute_ns( name = 'Type'  prefix = 'ss'  value = 'String' ).                               " Cell format
    MATNR
        r_cell = l_document->create_simple_element( name = 'Cell'  parent = r_row ).    r_cell->set_attribute_ns( name = 'StyleID'  prefix = 'ss'  value = 'Data' ).    l_value = wa_ekpo-matnr.    r_data = l_document->create_simple_element( name = 'Data'  value = l_value   parent = r_cell ).          " Data    r_data->set_attribute_ns( name = 'Type'  prefix = 'ss'  value = 'String' ).                              " Cell format   ENDLOOP.
    Creating a Stream Factory
      l_streamfactory = l_ixml->create_stream_factory( ).
    Connect Internal XML Table to Stream Factory
      l_ostream = l_streamfactory->create_ostream_itable( table = l_xml_table ).
    Rendering the Document
      l_renderer = l_ixml->create_renderer( ostream  = l_ostream  document = l_document ).  l_rc = l_renderer->render( ).
    Saving the XML Document
      l_xml_size = l_ostream->get_num_written_raw( ).
    Before sending the mail,
    LOOP AT l_xml_table INTO wa_xml.
        CLEAR objbin.
        objbin-line = wa_xml-data.
        APPEND objbin to BINARY_CONTENT.
      ENDLOOP.
    Here, objbin is of type SOLIX and BINARY_CONTENT is of type SOLIX_TAB.
    Now, call the method,
    CALL METHOD DOCUMENT->ADD_ATTACHMENT
            EXPORTING  I_ATTACHMENT_TYPE = 'XLS'
                       I_ATTACHMENT_SUBJECT = 'My attachment'
                       I_ATT_CONTENT_HEX    = BINARY_CONTENT   .

    Try this..
      r_format->set_attribute_ns( name = 'Underline'  prefix = 'ss'  value = 'Single' ).

  • How to spool data into multiple Excel sheet if result is more then 65k rows

    Hi all,
    Wann spool data into multiple excel sheet bocz my resultant no of rows are more then 65k.
    Thanks to all in advance.....

    many choices
    1) migrate to a newer version of Excel
    2) split the files after spooling
    for instance with split
    split -l65000 file.txtor with perl, java, vb or what-so-ever
    3) do more than one report by using rownum
    spool f1
    select empno,ename  from (select rownum r,empno,ename from emp order by empno) where r<6 ;
    spool off
    spool f2
    select empno,ename  from (select * from (select rownum r,empno,ename from emp order by empno) where r<11) where r>5 ;
    spool off
    spool f3
    select empno,ename  from (select rownum r,empno,ename from emp order by empno) where r>10 ;
    spool off

  • How to download the ALV output with colors into the excel sheet

    Hi,
      I'm having an ALV Grid report output where each and every row has some colors in it. When i download it to an excel sheet whatever the colors that comes on the output of the report the same should come in the excel sheet. When i download the output to an excel sheet using List --> Export -->Local file . If i open the excel files no colors are coming in the excel sheet.
    can anyone tell how to get the colors in the excel sheet also. thanks...
    Regards,
    Rose.

    Hi Camila,
    Use the OLE concept.
    Check the below threads:
    Colors in Excel Sheet
    colors in alv
    Regards,
    Soumya.

  • Format Excel sheet - Oracle COM Automation

    Dear gentlemen,
    I would like to get your help to generate a formatted excel sheet using Oracle COM Automation, I may don’t know the correct properties to use, or don’t know how to use it.
    For example:
    To set a cell value I use this line:
    hresult:=Ordcom.SetProperty(RangeHandle, 'Value', data, 'BSTR');
    and when I tried to fill the same cell with a yello color I used this line:
    hresult:=Ordcom.SetProperty(RangeHandle, 'Interior.Color', 65535, 'BSTR');
    but that has no effect at all, so please advise what is wrong, this may apply also for the most properties such as “Font.Bold”.
    I appreciate so much any help from you.
    Best regards,
    Nabil

    Here is another version of my package ORDExcelSB. It includes almost all the formatting needs in Excel.
    Package Specification:_
    CREATE OR REPLACE PACKAGE ORDExcelSB AS
      /* Saubhik: These constants are added */
        BorderEdgeLeft CONSTANT BINARY_INTEGER:= 7;
        BorderEdgeTop CONSTANT BINARY_INTEGER:=8;
        BorderEdgeBottom CONSTANT BINARY_INTEGER:=9;
        BorderEdgeRight CONSTANT BINARY_INTEGER:=10;
        BorderInsideVertical CONSTANT BINARY_INTEGER:=11;
        BorderInsideHorizontal CONSTANT BINARY_INTEGER:=12;
      /* Declare externally callable subprograms. */
      /* Start: These functions are newly aded by Saubhik Banerjee */
      FUNCTION CreateExcelApplication(servername VARCHAR2) RETURN binary_integer;
      FUNCTION OpenExcelFile(filename VARCHAR2, sheetname VARCHAR2)
        RETURN binary_integer;
      FUNCTION SetCellColor(range varchar2, style INTEGER)
        return binary_integer;
      FUNCTION SetCellBorder(range varchar2, BordersIndex BINARY_INTEGER, BorderStyle BINARY_INTEGER)
        return binary_integer;   
      FUNCTION FormatFontStyle(range varchar2, fontstyle varchar2)
        return binary_integer;   
      FUNCTION FormatFontColor(range varchar2, fontcolor INTEGER)
        return binary_integer;   
      FUNCTION FormatFontName(range varchar2, fontname varchar2)
        return binary_integer;  
      FUNCTION FormatFontSize(range varchar2, fontsize INTEGER)
        return binary_integer ;  
      /* End: These functions are newly aded by Saubhik Banerjee */
      FUNCTION CreateExcelWorkSheet(servername varchar2) return binary_integer;
      FUNCTION InsertData(range varchar2, data binary_integer, type varchar2)
        return binary_integer;
      FUNCTION InsertDataReal(range varchar2,
                              data  double precision,
                              type  varchar2) return binary_integer;
      FUNCTION GetDataNum(range varchar2) return binary_integer;
      FUNCTION GetDataStr(range varchar2) return varchar2;
      FUNCTION GetDataReal(range varchar2) return double precision;
      FUNCTION GetDataDate(range varchar2) return date;
      FUNCTION InsertData(range varchar2, data varchar2, type varchar2)
        return binary_integer;
      FUNCTION InsertData(range varchar2, data Date, type varchar2)
        return binary_integer;
      FUNCTION InsertChart(xpos   binary_integer,
                           ypos   binary_integer,
                           width  binary_integer,
                           height binary_integer,
                           range  varchar2,
                           type   varchar2) return binary_integer;
      FUNCTION SaveExcelFile(filename varchar2) return binary_integer;
      FUNCTION ExitExcel return binary_integer;
    END ORDExcelSB;
    Package Body:_
    CREATE OR REPLACE PACKAGE BODY ORDExcelSB AS
      DummyToken        binary_integer;
      applicationToken  binary_integer := -1;
      WorkBooksToken    binary_integer := -1;
      WorkBookToken     binary_integer := -1;
      WorkSheetToken    binary_integer := -1;
      WorkSheetToken1   binary_integer := -1;
      RangeToken        binary_integer := -1;
      ChartObjectToken  binary_integer := -1;
      ChartObject1      binary_integer := -1;
      Chart1Token       binary_integer := -1;
      i                 binary_integer;
      retNum            binary_integer;
      retReal           double precision;
      retStr            varchar2(255);
      retDate           DATE;
      error_src         varchar2(255);
      error_description varchar2(255);
      error_helpfile    varchar2(255);
      error_helpID      binary_integer;
      FUNCTION CreateExcelApplication(servername VARCHAR2) RETURN binary_integer IS
      BEGIN
        dbms_output.put_line('Creating Excel application...');
        i := OrdCOM.CreateObject('Excel.Application',
                                 0,
                                 servername,
                                 applicationToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Invoking Workbooks...');
        i := ORDCOM.GetProperty(applicationToken,
                                'WorkBooks',
                                0,
                                WorkBooksToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        RETURN i;
      END CreateExcelApplication;
      FUNCTION OpenExcelFile(filename VARCHAR2, sheetname VARCHAR2)
        RETURN binary_integer IS
      BEGIN
        dbms_output.put_line('Opening Excel file ' || filename || ' ...');
        ORDCOM.InitArg();
        ORDCOM.SetArg(filename, 'BSTR');
        i := ORDCOM.Invoke(WorkBooksToken, 'Open', 1, DummyToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Opening WorkBook');
        i := ORDCOM.GetProperty(applicationToken,
                                'ActiveWorkbook',
                                0,
                                WorkBookToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Invoking WorkSheets..');
        i := ORDCOM.GetProperty(applicationToken,
                                'WorkSheets',
                                0,
                                WorkSheetToken1);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Invoking WorkSheet');
        ORDCOM.InitArg();
        ORDCOM.SetArg(sheetname, 'BSTR');
        i := ORDCOM.GetProperty(WorkBookToken, 'Sheets', 1, WorkSheetToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Opened ');
        RETURN i;
      END OpenExcelFile;
      * Invoke the Excel Automation Server and create a Workbook object as
      * well as a worksheet object
      FUNCTION CreateExcelWorkSheet(servername varchar2) return binary_integer IS
      BEGIN
        dbms_output.put_line('Creating Excel application...');
        i := ORDCOM.CreateObject('Excel.Application',
                                 0,
                                 servername,
                                 applicationToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Invoking Workbooks...');
        /*i:=ORDCOM.Invoke(applicationToken, 'WorkBooks',0, WorkBooksToken);*/
        i := ORDCOM.GetProperty(applicationToken,
                                'WorkBooks',
                                0,
                                WorkBooksToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Invoking Add to WorkBooks...');
        ORDCOM.InitArg();
        ORDCOM.SetArg(-4167, 'I4');
        i := ORDCOM.Invoke(WorkBooksToken, 'Add', 1, WorkBookToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Invoking WorkSheets..');
        ORDCOM.InitArg();
        ORDCOM.SetArg('Sheet 1', 'BSTR');
        /*  i:=ORDCOM.Invoke(applicationToken, 'WorkSheets', 1, WorkSheetToken);*/
        i := ORDCOM.GetProperty(applicationToken,
                                'WorkSheets',
                                0,
                                WorkSheetToken1);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.Invoke(WorkSheetToken1, 'Add', 0, WorkSheetToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        return i;
      END CreateExcelWorkSheet;
      * Invoke the Range method to obtain a range token. Then set the property value
      * at the specified range to the data required
      FUNCTION InsertData(range varchar2, data binary_integer, type varchar2)
        RETURN binary_integer IS
      BEGIN
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.SetProperty(RangeToken, 'Value', data, type);
        IF (i = 0) THEN
          i := ORDCOM.SetProperty(RangeToken, 'ColumnWidth', 15, 'I2');
        END IF;
        i := ORDCOM.DestroyObject(RangeToken);
        RETURN i;
      END InsertData;
    /* Saubhik: This function is added to set the cell Border */
      FUNCTION SetCellBorder(range varchar2, BordersIndex BINARY_INTEGER, BorderStyle BINARY_INTEGER)
        return binary_integer IS
        --fontToken binary_integer;
        BorderToken BINARY_INTEGER;
       BEGIN
           ORDCOM.InitArg();
          ORDCOM.SetArg(range, 'BSTR');
          i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
          ORDCOM.InitArg();
          ORDCOM.SetArg(BordersIndex, 'I2');
          i := ORDCOM.GetProperty(RangeToken, 'Borders', 1, BorderToken);
          i := ORDCOM.SetProperty(BorderToken, 'weight', BorderStyle, 'I2');
          i := ORDCOM.DestroyObject(BorderToken);
          i := ORDCOM.DestroyObject(RangeToken);
          return i;
        END SetCellBorder; 
    /* Saubhik: This function is added to set the cell background color */
      FUNCTION SetCellColor(range varchar2, style INTEGER)
        return binary_integer IS
        --fontToken binary_integer;
        DummyToken BINARY_INTEGER;
        SelectionToken BINARY_INTEGER;
        InteriorToken BINARY_INTEGER;
        --applicationToken
          BEGIN
          ORDCOM.InitArg();
          ORDCOM.SetArg(range, 'BSTR');
          i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
          i := ORDCOM.Invoke(RangeToken,'SELECT',0,DummyToken);
          i := ORDCOM.GetProperty(applicationToken,'Selection',0,SelectionToken);
          i := ORDCOM.GetProperty(SelectionToken, 'Interior', 0, InteriorToken);
          i := ORDCOM.SetProperty(InteriorToken, 'ColorIndex', style, 'I2');
          i := ORDCOM.DestroyObject(RangeToken);
          return i;
        END SetCellColor;
    /* Saubhik: This function is added to change the font style like Bold, Italic etc. */
      FUNCTION FormatFontStyle(range varchar2, fontstyle varchar2)
        return binary_integer IS
        fontToken binary_integer;
          BEGIN
          ORDCOM.InitArg();
          ORDCOM.SetArg(range, 'BSTR');
          i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
          i := ORDCOM.GetProperty(RangeToken, 'Font', 0, FontToken);
          IF fontstyle = 'Bold' OR fontstyle = 'Italic' OR
             fontstyle = 'Underline' THEN
              i := ORDCOM.SetProperty(FontToken, fontstyle, True, 'BOOL');
          END IF;
          i := ORDCOM.DestroyObject(FontToken);
          i := ORDCOM.DestroyObject(RangeToken);
          return i;
        END FormatFontStyle;
    /* Saubhik: This function is added to change the font style like Arial, Bookman, Century etc. */
      FUNCTION FormatFontName(range varchar2, fontname varchar2)
        return binary_integer IS
        fontToken binary_integer;
          BEGIN
          ORDCOM.InitArg();
          ORDCOM.SetArg(range, 'BSTR');
          i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
          i := ORDCOM.GetProperty(RangeToken, 'Font', 0, FontToken);
          i := ORDCOM.SetProperty(FontToken, 'Name', fontname, 'BSTR');
          i := ORDCOM.DestroyObject(FontToken);
          i := ORDCOM.DestroyObject(RangeToken);
          return i;
        END FormatFontName;   
      /* Saubhik: This function is added to change the font style like Arial, Bookman, Century etc. */
      FUNCTION FormatFontSize(range varchar2, fontsize INTEGER)
        return binary_integer IS
        fontToken binary_integer;
          BEGIN
          ORDCOM.InitArg();
          ORDCOM.SetArg(range, 'BSTR');
          i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
          i := ORDCOM.GetProperty(RangeToken, 'Font', 0, FontToken);
          i := ORDCOM.SetProperty(FontToken, 'Size', fontsize, 'I2');
          i := ORDCOM.DestroyObject(FontToken);
          i := ORDCOM.DestroyObject(RangeToken);
          return i;
        END FormatFontSize;   
    /* Saubhik: This function is added to change the font color like Black, Blue etc. */
      FUNCTION FormatFontColor(range varchar2, fontcolor INTEGER)
        return binary_integer IS
        fontToken binary_integer;
          BEGIN
          ORDCOM.InitArg();
          ORDCOM.SetArg(range, 'BSTR');
          i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
          i := ORDCOM.GetProperty(RangeToken, 'Font', 0, FontToken);
              i := ORDCOM.SetProperty(FontToken, 'ColorIndex', fontcolor, 'I2');
          i := ORDCOM.DestroyObject(FontToken);
          i := ORDCOM.DestroyObject(RangeToken);
          return i;
        END FormatFontColor;
      * Invoke the Range method to obtain a range token. Then set the property value
      * at the specified range to the data required
      FUNCTION GetDataNum(range varchar2) RETURN binary_integer IS
      BEGIN
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.GetProperty(RangeToken, 'Value', 0, retNum);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.DestroyObject(RangeToken);
        RETURN retNum;
      END GetDataNum;
      FUNCTION GetDataReal(range varchar2) RETURN double precision IS
      BEGIN
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.GetProperty(RangeToken, 'Value', 0, retReal);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.DestroyObject(RangeToken);
        RETURN retReal;
      END GetDataReal;
      FUNCTION GetDataStr(range varchar2) RETURN varchar2 IS
      BEGIN
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.GetProperty(RangeToken, 'Value', 0, retStr);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.DestroyObject(RangeToken);
        RETURN retStr;
      END GetDataStr;
      FUNCTION GetDataDate(range varchar2) RETURN Date IS
      BEGIN
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.GetProperty(RangeToken, 'Value', 0, retDate);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.DestroyObject(RangeToken);
        RETURN retDate;
      END GetDataDate;
      FUNCTION InsertData(range varchar2, data DATE, type varchar2)
        RETURN binary_integer IS
      BEGIN
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        i := ORDCOM.SetProperty(RangeToken, 'Value', data, type);
        i := ORDCOM.DestroyObject(RangeToken);
        RETURN i;
      END InsertData;
      FUNCTION InsertDataReal(range varchar2,
                              data  double precision,
                              type  varchar2) RETURN binary_integer IS
      BEGIN
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        i := ORDCOM.SetProperty(RangeToken, 'Value', data, type);
        i := ORDCOM.DestroyObject(RangeToken);
        RETURN i;
      END InsertDataReal;
      FUNCTION InsertData(range varchar2, data varchar2, type varchar2)
        RETURN binary_integer IS
      BEGIN
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        i := ORDCOM.SetProperty(RangeToken, 'Value', data, type);
        i := ORDCOM.DestroyObject(RangeToken);
        RETURN i;
      END InsertData;
      * Insert a chart at the x and y position of the spreadsheet with the desired
      * height and width. Then also uses the ChartWizard to draw the graph with data
      * in a specified range area with a specified charting type.
      FUNCTION InsertChart(xpos   binary_integer,
                           ypos   binary_integer,
                           width  binary_integer,
                           height binary_integer,
                           range  varchar2,
                           type   varchar2) RETURN binary_integer IS
        charttype binary_integer := -4099;
      BEGIN
        ORDCOM.InitArg();
        i := ORDCOM.GetProperty(WorkSheetToken,
                                'ChartObjects',
                                0,
                                ChartObjectToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        ORDCOM.InitArg();
        ORDCOM.SetArg(xpos, 'I2');
        ORDCOM.SetArg(ypos, 'I2');
        ORDCOM.SetArg(width, 'I2');
        ORDCOM.SetArg(height, 'I2');
        i := ORDCOM.Invoke(ChartObjectToken, 'Add', 4, ChartObject1);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.GetProperty(ChartObject1, 'Chart', 0, Chart1Token);
        ORDCOM.InitArg();
        ORDCOM.SetArg(range, 'BSTR');
        i := ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
        ORDCOM.InitArg();
        ORDCOM.SetArg(RangeToken, 'DISPATCH');
        IF type = 'xlPie' THEN
          charttype := -4102;
        ELSIF type = 'xl3DBar' THEN
          charttype := -4099;
        ELSIF type = 'xlBar' THEN
          charttype := 2;
        ELSIF type = 'xl3dLine' THEN
          charttype := -4101;
        END IF;
        ORDCOM.SetArg(charttype, 'I4');
        i := ORDCOM.Invoke(Chart1Token, 'ChartWizard', 2, DummyToken);
        i := ORDCOM.DestroyObject(RangeToken);
        i := ORDCOM.DestroyObject(ChartObjectToken);
        i := ORDCOM.DestroyObject(ChartObject1);
        i := ORDCOM.DestroyObject(Chart1Token);
        RETURN i;
      END InsertChart;
      * Save the Excel File. WARNING: Do not specify a filename that already exist
      * since there is no graphical context, Oracle would not be able to pop
      * out a warning message for existing file. This causes Excel to hang
      FUNCTION SaveExcelFile(filename varchar2) return binary_integer IS
      BEGIN
        dbms_output.put_line('Saving Excel file...');
        ORDCOM.InitArg();
        ORDCOM.SetArg(filename, 'BSTR');
        i := ORDCOM.Invoke(WorkBookToken, 'SaveAs', 1, DummyToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        RETURN i;
      END SaveExcelFile;
      * Close the Excel spreadsheet and exit from it
      FUNCTION ExitExcel return binary_integer is
      BEGIN
        dbms_output.put_line('Closing workbook and quitting...');
        ORDCOM.InitArg();
        ORDCOM.InitArg();
        ORDCOM.SetArg(FALSE, 'BOOL');
        dbms_output.put_line('Closing workbook...');
        i := ORDCOM.Invoke(WorkBookToken, 'Close', 0, DummyToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.DestroyObject(WorkBookToken);
        ORDCOM.InitArg();
        dbms_output.put_line('Closing workbooks...');
        i := ORDCOM.Invoke(WorkBooksToken, 'Close', 0, DummyToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.DestroyObject(WorkBooksToken);
        i := ORDCOM.Invoke(applicationToken, 'Quit', 0, DummyToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        i := ORDCOM.DestroyObject(WorkSheetToken);
        i := ORDCOM.DestroyObject(WorkSheetToken1);
        i := ORDCOM.DestroyObject(applicationToken);
        i := ORDCOM.DestroyObject(ChartObjectToken);
        i := ORDCOM.DestroyObject(Chart1Token);
        i := ORDCOM.DestroyObject(ChartObject1);
        i := ORDCOM.DestroyObject(dummyToken);
        RETURN i;
      END ExitExcel;
    END ORDExcelSB;

  • How to save BI report into normal excel sheet in Bex Analyzer

    Hi Experts,
    version of  Bex Analyzer:
    Bi addon 7.x
    support package 7,patch 1
    version 7004.4.0.5
    excel-2003
    when i am trying to save the report into excel in Bex Analyzer as below:
    file-save as->Microsoft excel work.
    when I open excel I am getting pop up windowu201Dthis file contains macros  with an expired or revoked signature.Since your running under  high security level,these macros will be disabled.u201D
    when I click ok I am getting one more pop upwindow as u201Cmacros  are diabled because the security level is set to high and a digitally signed trusted certificate is not attached to macros.to run the macros,change the security level to a lower setting(not recommended),or request the macros signed by the author  using a certificate  issued by a certificate authority.
    what are these macros? why i am getting this pop up windows
    When i opened  the excel report is not looks like general excel report.how can I generate general excel report .I should not want to get excel report as in bex analyzer.I donu2019t want to have author ,status of data,chart,filter,information in excel report.
    what settings I have to made to save the report in general excel format.
    As i am new to Bi please correct me if i am wrong.
    Anything is appreciable.
    regards,
    naresh.

    Macros in general are nothing but piece of code in excel.
    To allow unsigned macros to run, the Trust all installed add-ins and templates check box must be selected on the Trusted Publishers tab of the Security dialog box. This option is selected by default. If it is not selected (recommended), Excel allows you to run only macros that have trusted digital signatures.
    1. On the Tools menu, point to Macro, and then click Security.
    2. On the Trusted Publishers tab, select the Trust all installed add-ins and templates check box.

  • RUNING report 6.0.8.26.0 on excel sheet

    hi
    i need to run report over excel sheet instead of oracle template ,
    the output of the report must be at the excel format ,
    i tried much but can not
    thanks much
    Ahmed

    Hi,
    Could u pls. send me the demo also.
    Meanwhile, I have a menu-driven client/server application running on Oracle 8i, Forms 5 and Report 3. The problem i have now is that the reports are erratic. While forms open everytime you run them on all the clients, reports are not like that always. Sometimes they run and sometimes they do not run. Also, it is as though the clients take their turn to behave in this erratic manner and once it happens all reports will cease to run on the affected client.
    At times, in order not to wait indefinitely for the reports to come up again on their own accord, recompilling and regenerating the reports make them available again.
    How do I overcome this problem? Do I have to always recompile and regenerate whenever this problem comes up?
    my email: [email protected] OR [email protected]

  • Data into 2 excel sheets - not much luck

    I am trying to send data from 2 queries to 2 excel sheets. I looked at DDE and OLE packages but not with much luck. Both the queries are defined in the data model. Is there any way this can be done in csv or xls format? Any ideas are really appreciated.
    Srikanth

    Hello,
    The way I have it set up is that I have report A that puts the output in PDF format. On report A, I have an after report trigger to run report B. It is as follows:
    function AfterReport return boolean is
    BEGIN
    srw.run_report('report=<file_location/reportb.rdf'||
    ' destype=file'||
    ' desname=<export_csv_file_to/filename.csv'||
    ' desformat=delimited'||
    ' delimiter='','''||
    ' background=Yes'||
    ' batch=Yes'||
    ' server=<server_name>');
    RETURN (TRUE);
    EXCEPTION
    WHEN srw.run_report_failure then
    srw.message(100, 'ERROR WHILE RUNNING REPORT');
    raise srw.program_abort;
    END;
    You could also just run the report B by setting the above parameter too. After the file runs, then find the .csv file and you are all set. Hope this helps.
    Martin

  • BI Publisher Report not Generating any Output in the Excel SHeet

    We have a CUstom BI PUblisher Report .When we run it ,it completes normally but there is no data in the Excel Sheet generated .It shows NO DATA FOUND .But when i run the Query seperately i do get some data . Don't know why it is not viewable in the Excel sheet ,it was working fine few days back .
    Please advice .
    Thanks

    do you use some profile in your script?
    We recently upgraded the database from 10g to11g .
    after that report has no data ?
    is it ebs or obiee?

  • Generate Forms Output into multiple Excel Sheets

    Hi,
    I have a Forms 5.0 application which I am currently web-enabling. The application output is in Microsoft Excel. The output can span multiple sheets depending upon the parameters selected by the user. I am using text_io package to generate a html file with links and anchors for different sheets. Is it possible to generate multiple sheets directly in Excel using a text file.

    Thank you for your answer!
    But I think this is not the solution for my problem.
    I try to explain my problem again. I have a web template with filter, analyse table and infofield. The infofield contains the selected filter values. There is also a button for export into excel. In WAD 7.0 you have only to set several parameters for the export command  and the export to excel works. However all web items will be transfered into the first excel sheet among one another.
    Is it possible to export one web item into the first excel-sheet and the second web item into the second excel-sheet of the same excel workbook?
    Best Regards,
    Julia

  • WAD 7.0 - Export into multiple excel sheets

    Hello all,
    I try to export an infofield (with filter values) and analyse table from WAD to excel. But after export both web items, infofield and analyse table, are in the same excel sheet. How can I export the infofield and analyse table in the different excel sheets?
    I suppose, that the export will be executed on java-stack with java functionality. In WAD I can only define the parameters for the command "EXPORT". Is it possible to enhance this java coding?
    May be, the export to multiple sheets is possible with Web Items  "Javascript" or "Custom Extension" with ABAP-Class?
    Best Regards
    Julia

    Thank you for your answer!
    But I think this is not the solution for my problem.
    I try to explain my problem again. I have a web template with filter, analyse table and infofield. The infofield contains the selected filter values. There is also a button for export into excel. In WAD 7.0 you have only to set several parameters for the export command  and the export to excel works. However all web items will be transfered into the first excel sheet among one another.
    Is it possible to export one web item into the first excel-sheet and the second web item into the second excel-sheet of the same excel workbook?
    Best Regards,
    Julia

  • Insert a PDF ro Word doc into an Excel sheet

    I have to track parts.  I created a spreadsheet to do this.  We are trying to as paparless as possible is my office.  I need to insert a PDF copy or the actual Word doc into the spreadsheet so my techs can access it and indicate that the
    parts have arrived.  This spreadsheet is on a SharePoint site and so are the PDF or Word copies of the documents that the techs need.  Inserting a hyperlink will pull the PDF doc up in another web tab which is what I don't want. 
    I need to be able to pull the docs up and modify them and save them back to the SharePoint file. Help!  THANKS!!!! 

    Have you considered using a SharePoint list instead of an excel spreadsheet? You can then attach one or many documents to each row in the list.

  • Saving the table content into one excel sheet

    Hello,
    I have got following problem:
    I'm measuring data with a DAQ card. I'm interested in the min and max value of the measured data. Therefore I'm using the Amplitude and Level measurent function. Its no problem to display the results in the graphical interface. What causes me trouble is to save the content of the displayed table into some kind of file. Anybody know a solution?
    Thanks!

    The problem is that I use the descriped min/max function. If I write it to a text file I get a lot of additional information every second.
    Following example shows what is written to the measurement file:
    Channels 6      
    Samples 1 1 1 1 1 1 
    Date 2010/03/05 2010/03/05 2010/03/05 2010/03/05 2010/03/05 2010/03/05 
    Time 14:26:48.9938435554504394532 14:26:48.9938435554504394532 14:26:48.9938435554504394532 14:26:48.9938435554504394532 14:26:48.9938435554504394532 14:26:48.9938435554504394532 
    Y_Unit_Label Volts Volts Ampere Ampere Ampere Volts 
    X_Dimension Time Time Time Time Time Time 
    X0 0.0000000000000000E+0 0.0000000000000000E+0 0.0000000000000000E+0 0.0000000000000000E+0 0.0000000000000000E+0 0.0000000000000000E+0 
    Delta_X 0.001000 0.001000 0.001000 0.001000 0.001000 0.001000 
    ***End_of_Header***       
    X_Value U_1 (Positive Peak) U_2 (Positive Peak) I_3(Positive Peak) I_1 (Positive Peak) I_2 (Positive Peak) U_3(Positive Peak) Comment
    0.000000 3.461911 3.189588 0.115779 2.103480 0.739258 1.206654
    This kind of information is not displayed if I visualize it in a table. The table only shows me the time and the corresponding min/max values. These values are updated every second.
    I tried to write it to a spreadsheet,  this approach was also not successful since a new spreadsheet was opened/generated every second respectively every time a new min/max value was aquired.
    I would like to safe the data fro, the table to a file without the additionál information showed above in the example.
    Thanks!

  • I want to download the fields of my table into an excel sheet ?

    hi all,
    i would like to download the ztable that i have created along with the fields in the ztable.
    how do i download it.
    can anyone throw light on this
    regds
    haritha

    Hii..
    PLS CHECK THE SIMPLE CODE BELOW...
    data: begin OF itab occurs 0,
    matnr like mara-matnr,
    end of itab.
    data : begin of it_fieldnames occurs 0,
    name(100),
    end of it_fieldnames.
    it_fieldnames-name = 'MATNR'.
    APPEND IT_FIELDNAMES.
    select matnr from mara into table itab UP TO 10 ROWS.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE =
    FILENAME = 'C:\Documents and Settings\sampath\Desktop\flatfile.txt'
    FILETYPE = 'ASC'
    APPEND = ' '
    WRITE_FIELD_SEPARATOR = ' '
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = ' '
    WRITE_LF = 'X'
    COL_SELECT = ' '
    COL_SELECT_MASK = ' '
    DAT_MODE = ' '
    CONFIRM_OVERWRITE = ' '
    NO_AUTH_CHECK = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    WRITE_BOM = ' '
    TRUNC_TRAILING_BLANKS_EOL = 'X'
    WK1_N_FORMAT = ' '
    WK1_N_SIZE = ' '
    WK1_T_FORMAT = ' '
    WK1_T_SIZE = ' '
    IMPORTING
    FILELENGTH =
    <b>TABLES
    DATA_TAB = itab
    FIELDNAMES = IT_FIELDNAMES</b>
    EXCEPTIONS
    FILE_WRITE_ERROR = 1
    NO_BATCH = 2
    GUI_REFUSE_FILETRANSFER = 3
    INVALID_TYPE = 4
    NO_AUTHORITY = 5
    UNKNOWN_ERROR = 6
    HEADER_NOT_ALLOWED = 7
    SEPARATOR_NOT_ALLOWED = 8
    FILESIZE_NOT_ALLOWED = 9
    HEADER_TOO_LONG = 10
    DP_ERROR_CREATE = 11
    DP_ERROR_SEND = 12
    DP_ERROR_WRITE = 13
    UNKNOWN_DP_ERROR = 14
    ACCESS_DENIED = 15
    DP_OUT_OF_MEMORY = 16
    DISK_FULL = 17
    DP_TIMEOUT = 18
    FILE_NOT_FOUND = 19
    DATAPROVIDER_EXCEPTION = 20
    CONTROL_FLUSH_ERROR = 21
    OTHERS = 22
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Reward if Helpful

Maybe you are looking for