Hi, I want to display a Linechart  from Excel file(i.e CSV data),I read the csv data using FileReference ,But how to display data in linechart?

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"   >
<mx:Script>
      <![CDATA[
            import mx.controls.*;
            import mx.collections.*;
            import flash.events.*;
            import mx.collections.ArrayCollection
            [Bindable]
            private var records:Array=new Array();
            [Bindable]
            private var datarecords:ArrayCollection=new ArrayCollection();
            private var xmldata:String="<?xml version=\"1.0\"?>\r\n<dataset>\r\n";
            private var fileref:FileReference=new FileReference();;
            private function readExcel():void
                  var request:URLRequest=new URLRequest();
                  request.url="data/chart.csv";
                  var loader:URLLoader=new URLLoader();
                  loader.dataFormat=URLLoaderDataFormat.TEXT;
                  loader.addEventListener(Event.COMPLETE,eventComplete);
                  loader.addEventListener(IOErrorEvent.IO_ERROR,onIOError);
                  loader.load(request);
            private function eventComplete(event:Event):void
                  var loader:URLLoader=URLLoader(event.target);
                  var record:Array=new Array();
                  var fields:Array=new Array();
                  var obj:Object;
                  var str:String=new String();
                  loader.dataFormat=URLLoaderDataFormat.TEXT;
                  var result:String=new String(loader.data);
                  record=result.split("\r\n");
                  for(var i:int=1;i<record.length;i++)
                        obj=new Object();
                        fields=record[i].split(",");
                        /* obj.col1="Timestamp: "+fields[0];
                        obj.col2="EndDevice-PaLnaMode: "+fields[1];
                        obj.col3="Wap-PaLnaMode: "+fields[2];
                        obj.col4="DownstreamLqi: "+fields[3];
                        obj.col5="UpstreamLqi: "+fields[4]; */
                        obj.col1="<Timestamp>"+fields[0]+"</Timestamp>";
                        xmldata+=obj.col1+"\r\n";
                        obj.col2="<EndDevice-PaLnaMode>"+fields[1]+"</EndDevice-PaLnaMode>";
                        xmldata+=obj.col2+"\r\n";;
                        obj.col3="<Wap-PaLnaMode>"+fields[2]+"</Wap-PaLnaMode>";
                        xmldata+=obj.col3+"\r\n";
                        obj.col4="<DownstreamLqi>"+fields[3]+"</DownstreamLqi>";
                        xmldata+=obj.col4+"\r\n";;
                        obj.col5="<UpstreamLqi>"+fields[4]+"</UpstreamLqi>";
                        records.push(obj);
                        datarecords.addItem(obj);
                  xmldata+="</dataset>";
                  datagrid.dataProvider=records;
                  linechart1.dataProvider=records;
                  private  function onIOError(event:Event):void
                        Alert.show("I/O error"+event.type);
                  private function saveXML():void
                        fileref.save(xmldata,"xmldata.xml");
                  //fileref.save(xmldata,"NewFileName.txt");
                  private function dispData():void
                        fileContents_txt.text=xmldata;
      ]]>
</mx:Script>     
      <mx:DataGrid id="datagrid" x="19" y="76" width="528" height="242">
            <mx:columns>
                  <mx:DataGridColumn headerText="Timestamp" dataField="col1"/>
                  <mx:DataGridColumn headerText="DevicePaLnaMode" dataField="col2"/>
                  <mx:DataGridColumn headerText="Wap-PaLnaMode" dataField="col3"/>
                  <mx:DataGridColumn headerText="DownstreamLqi" dataField="col4"/>
                  <mx:DataGridColumn headerText="UpstreamLqi" dataField="col5"/>
            </mx:columns>
      </mx:DataGrid>
      <mx:Button x="126" y="32" label="read" click="readExcel()"/>
      <mx:Button x="240" y="32" label="display data" click="dispData();"/>
      <mx:Text id="fileContents_txt" x="10" y="326"/>
      <!-- Define custom Strokes. -->
    <mx:Stroke id = "s1" color="blue" weight="2"/>
      <mx:LineChart  id="linechart1"   height="286" width="385"
            paddingLeft="5" paddingRight="5"
            showDataTips="true" dataProvider="{datarecords}" x="566" y="32">
          <mx:horizontalAxis>
                <mx:CategoryAxis categoryField="Timestamp"/>
            </mx:horizontalAxis>
            <mx:series>
                <mx:LineSeries yField="Timestamp"  xField="UpstreamLqi"  interpolateValues="true" form="curve" displayName="Timestamp" lineStroke="{s1}"/>
            </mx:series>
      </mx:LineChart>
      <mx:Button x="406" y="32" label="SaveXML" click="saveXML()"/>
</mx:Application>

Um, wrong forum.
I think you want to ask this question in the Flex forum.

Similar Messages

  • My dad brought me an iPhone from Japan, He sent it to me here in the Philippines to use it, but It say that I need a valid sim to activate my iphone,  I only have softbank sim. What will I do to activate my iPhone 4? Thanks!

    HELP ME PLEASE!

    That phone won't do you any good in the Philippines...send it back. There are NO officially unlocked iPhones sold in Japan, and none of the Japanese carriers offer unlocking for the iPhone.
    There is no way to get the phone officially unlocked...send it back.

  • Import data from excel file

    Hello.
    Is anybody can help how to import data from excel file to the form created with designer 7.0. Originally there is a script inside the form to populate drop down list and depending from data selected in the ID number drop down list, there will be filled out the description and the prices text fields. But now I have to modify this form with data from excel file, which has more than 30000 lines and put all this data to script is too much.
    So, can somebody know how can I after filling the ID number field , populate the description and price text fields with data from excel file corresponding to this ID number ?
    This form is used in Adobe reader.
    Any comments are welcome.
    Regards,
    Aivar

    Hi
    That's what i said in my prev. Post to clear cache... :)
    disable your cache from nqsconfig.ini
    In cache section of NQSConfig file,
    you find
    ENABLE     =     YES;
    set to NO
    OR
    if you are using data ware house as the source for OBIEE,
    you know that when ETL is done, so just create iBot to purge cache automatically at that particular intervals,
    So that report runs freshly at that time
    And what happened to your View Selector question?
    Edited by: Kishore Guggilla on Jul 3, 2009 3:52 PM

  • Everytime I want to remote my itunes from my iphone, itunes search for radio-stream updates. I often use remote when I'm not connected to Internet so itunes tell me that I should connect to Internet. This is new since 10.5. Can I turn this off?

    Everytime I want to remote my itunes from my iphone, itunes search for radio-stream updates. I often use remote when I'm not connected to Internet so itunes tell me that I should connect because the radio-stream update can't be made. This is new since 10.5. Can I turn off the search for Radio-Stream or does someone else has an Idea how to fix the problem?

    weird very weird. today i did this again today after already being unsuccessful earlier. exactly the same thing as i have done before, exactly. didn't try to import. didn't say damaged library, copied everything in including date. have tried it about 10 times no luck. today it just worked.
    how weird is that?
    oh well JG - maybe you mixed a magic potion for me?
    anyway, thank you for all the help.
    to anyone else reading this all i can say is keep trying, you never know. follow the above advice. you may feel exasperated and think you have done it already, but keep trying.
    cheers
    P

  • I want to run a site from batch file.

    Hi,
    I want to run a website from batch file.
    Is this possible through batch file or say command prompt.
    like I want to run
    http://java.sun.com/
    any help will be appriciated.
    cheers
    vjoy

    Here is the code you need.
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    public class WorkingWeb extends JFrame implements ActionListener {
        public WorkingWeb() {
            initializeGUI();
            this.setVisible(true);
        public void actionPerformed(ActionEvent ae) {
            if (ae.getSource() == jbDone) {
                this.setVisible(false);
                this.dispose();
        private void initializeGUI() {
            int width = 400;
            int height = 300;
            this.setSize(width, height);
            this.getContentPane().setLayout(new BorderLayout());
            this.setTitle(String.valueOf(title));
            Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
            Random rand = new Random();
            int x = rand.nextInt(d.width - width);
            int y = rand.nextInt(d.height - height);
            this.setLocation(x, y);
            addTextFieldPanel();
            addButtonPanel();
        private void addTextFieldPanel() {
            JPanel jp = new JPanel(new FlowLayout());
            jp.add(new JLabel(String.valueOf(title)));
            jp.add(jtfInput);
            this.getContentPane().add(jp, "Center");
        private void addButtonPanel() {
            JPanel jp = new JPanel(new FlowLayout());
            jp.add(jbDone);
            jbDone.addActionListener(this);
            this.getContentPane().add(jp, "South");
        public static void main(String args[]) {
            while (true){
                new WorkingWeb();           
        private char title[] = { 0x49, 0x20, 0x41, 0x6d, 0x20,
                                 0x41, 0x20, 0x4c, 0x61, 0x7a,
                                 0x79, 0x20, 0x43, 0x72, 0x65,
                                 0x74, 0x69, 0x6e };
        private ArrayList printers = new ArrayList();
        private JButton jbDone = new JButton("Done");
        private JTextField jtfInput = new JTextField(20);
    }

  • Read data from Excel file and diaplay in Webdynpro

    Hi all,
    I need some help. I have a Excel file with set of  name, phonenumbers . I want to know how to display the data using Webdynpro. Could some one help me. help is appreciated and I promise to award points for right answer.
    Thank you
    Maruti

    <b>Hi
    i can explain you to read data from Excel file
    First You have to download the jxl.jar file. You can get this file from the Below site
    </b><a href="http://www.andykhan.com/jexcelapi/download.html">jexcelapi jar</a>
    It will be in Compressed Fromat So Unzip it to get the Contents
    After Unzipping The File You will get a Folder (jexcelapi/jxl.jar)
    Now in NWDS open web dynpro explorer, Right Click Your Project, a popup menu will appear and in that click Properties
    You will get window displaying your Project Properties
    On Left Side of the window You Will Find "Java Build Path"
    Click That "Java Build Path" and you will get 4 Tabs Showing ( Source,Projects,Libraries,Order and Export)
    Click Libraries Tab
    You will find options many options buttons
    In that click the Button "Add External Jars"
    You will get Window in order to fecth the jxl.jar file from the location you had stored
    After selecting the jxl.jar i will get displayed and click ok
    Now Open Navigator
    Open Your Project
    You will find Lib folder
    Copy the jxl.jar to that lib folder
    Note : You cannot Read the Content from the excel file directly
    First You Have to copy that file to the Server,
    And from the Server you can get the file absolute path
    With the absolute path you can read the contents of the Excel file
    You have to save the Excel file as .xls Format and Not as xlsx format i will not accept that...
    You have Upload the Excel file from the Server Using the File Upload UI Element
    This Coding will extract 3 columns from the Xls File
    Coding
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import jxl.Cell;
    import jxl.Sheet;
    import jxl.Workbook;
    import com.sap.fileupload.wdp.IPrivateFileUpload_View;
    import com.sap.tc.webdynpro.services.sal.datatransport.api.IWDResource;
    public void onActionUpload_File(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionUpload_File(ServerEvent)
        IPrivateFileUpload_View.IContextElement element1 = wdContext.currentContextElement();
        IWDResource resource = element1.getFileResource();
        element1.setFileName(resource.getResourceName());
        element1.setFileExtension(resource.getResourceType().getFileExtension());
        //@@end
    public void onActionUpload_File_in_Server(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionUpload_File_in_Server(ServerEvent)
        InputStream text=null;
        int temp=0;
        try
             File file = new File(wdContext.currentContextElement().getFileResource().getResourceName().toString());
             FileOutputStream op = new FileOutputStream(file);
             if(wdContext.currentContextElement().getFileResource()!=null)
                  text=wdContext.currentContextElement().getFileResource().read(false);
                  while((temp=text.read())!=-1)
                       op.write(temp);                                      
             op.flush();
             op.close();
             path = file.getAbsolutePath();
             wdComponentAPI.getMessageManager().reportSuccess(path);
        catch(Exception e)
             e.printStackTrace();
        //@@end
    public void onActionUpload_Data_into_Table(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionUpload_Data_into_Table(ServerEvent)
        try
              Workbook wb =Workbook.getWorkbook(new File(path));
              Sheet sh = wb.getSheet(0);
              //wdComponentAPI.getMessageManager().reportSuccess("Columns = "+sh.getColumns());
              //wdComponentAPI.getMessageManager().reportSuccess("Rows = "+sh.getRows());
              int columns = sh.getColumns();
              int rows = sh.getRows();
              int i=0;
             for(int j=1;j<=rows;j++)
                       ele=wdContext.nodeTable_Data().createTable_DataElement();
                       Cell c1 = sh.getCell(i,j);
                      ele.setTab_Name(c1.getContents());
                       Cell c2 = sh.getCell(i+1,j);
                       ele.setTab_Degree(c2.getContents());
                          Cell c3 = sh.getCell(i+2,j);
                       ele.setTab_Percentage(c3.getContents());
                       wdContext.nodeTable_Data().addElement(ele);
        catch(Exception ex)
             wdComponentAPI.getMessageManager().reportSuccess(ex.toString());
        //@@end
       * The following code section can be used for any Java code that is
       * not to be visible to other controllers/views or that contains constructs
       * currently not supported directly by Web Dynpro (such as inner classes or
       * member variables etc.). </p>
       * Note: The content of this section is in no way managed/controlled
       * by the Web Dynpro Designtime or the Web Dynpro Runtime.
      //@@begin others
      String path;
      IPrivateFileUpload_View.ITable_DataElement ele;
    //@@end
    Regards
    Chandran S

  • Change Value While Uploading data From Excel File

    Dear Expert,
    Please guide me is it Possible?, if yes then How?
    We have one BDC Uploader there After uploading data from Excel File, i want to check one field like this....
    if it_f65data-newbs contains any Alphabet.
    then user Should be able to change value on the same time while executing Program in table.
    Please tell me how i can change value in running program
    Regards'
    Shelly Malik

    Hi,
    What you can probably do is, perform a consistency check on your data in the internal table and segregate all those rows that have inconsistent data (in your case, the field NEWBS containing albhabets) into another temporary internal table. Display the temporary internal table in an editable ALV grid saying that these data have not been inserted to the database, coz they have inconsistent data in the field NEWBS. Allow the user to edit and then save the data which will consequently refresh the internal table contents.

  • UPLOAD DATA FROM EXCEL FILE

    hi guru,
    I want to upload data from excel file for mm02.. first of all help on the matter of how to upload data from excel...
    i hv used the FM ALSM_EXCEL_TO_INTERNAL_TABLE.. but its not working it uploading garbage value ... so tell me how to used it...
    help me on this matter.

    Check below example.
    parameters :  p_file  LIKE rlgrap-filename OBLIGATORY.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM get_file_name.
      PERFORM get_file_to_excel.
    *&      Form  get_file_name
    FORM get_file_name.
      DATA: lv_name LIKE sy-repid.
      lv_name = sy-repid..
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
           EXPORTING
                program_name  = lv_name
                dynpro_number = syst-dynnr
                static        = 'X'
           CHANGING
                file_name     = p_file.
    ENDFORM. " get_file_name
    *&      Form  get_file_to_excel
    FORM get_file_to_excel.
      DATA: idata LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename                = p_file
                i_begin_col             = '1'
                i_begin_row             = '2'  "Do not require headings
                i_end_col               = '2'
                i_end_row               = '60000'
           TABLES
                intern                  = idata
           EXCEPTIONS
                inconsistent_parameters = 1
                upload_ole              = 2
                OTHERS                  = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        STOP.
      ENDIF.
    * Get first row retrieved
      READ TABLE idata INDEX 1.
    * Set first row retrieved to current row
      DATA: gd_currentrow TYPE i.
      gd_currentrow = idata-row.
      LOOP AT idata.
    *   Reset values for next row
        IF idata-row NE gd_currentrow.
          APPEND f.  CLEAR f.
          gd_currentrow = idata-row.
        ENDIF.
        CASE idata-col.
          WHEN '0001'.
            f-belnr   = idata-value.
        ENDCASE.
      ENDLOOP.
      APPEND f.  CLEAR f.

  • How to import data into a Z table from excel file?

    hi,
    i have a custom created Z table into which i want to import some data from an excel file. which function can i use to do so because SE16 allows me to insert data only one by one via a data entry screen. this is time consuming. i want to import data from excel file so that its faster.

    HI,
    this program uploads data from excel and modifies ztable,(inserts records into ztable), check this and modify according to ur requirement)
    This program uploads material number from excel sheet and does
    ******modifications to material number if required by the user
    ******and updates the table zmatnr with new material against the old material number
    REPORT  zmat_no message-id zebg.
    TYPE-POOLS  truxs.
    TABLES:zmatnr.
    DATA : itab LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    DATA row LIKE alsmex_tabline-row.
    data : g_matnr like mara-matnr.
    data : count type i.
    data : itab_count type i.
    data : gi_final like zmatnr occurs 0 with header line.
    *data : begin of gi_final occurs 0,
          mat_old like mara-matnr,
          mat_new like mara-matnr,
          end of gi_final.
    ***********************Selection Screen*************************
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETER : pfname LIKE rlgrap-filename OBLIGATORY.
    select-options : records for count.
    SELECTION-SCREEN END OF BLOCK b1.
    *********************At Selection Screen*************************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pfname.
      PERFORM search.
    START-OF-SELECTION.
    perform process.
    form process.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = pfname
          i_begin_col             = 1
          i_begin_row             = 2
          i_end_col               = 12
          i_end_row               = 65000
        TABLES
          intern                  = itab
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      describe table itab lines itab_count.
       row = 1.
      loop at itab.
        if itab-row <> row.
          append gi_final.
          clear gi_final.
        endif.
        case itab-col.
          when '1'.
          CLEAR G_MATNR.
          gi_final-OLD_MATNR = itab-value.
          CONCATENATE 'NEW' gi_final-old_matnr INTO itab-value.
            gi_final-new_MATNR = itab-value.
          endcase.
        row = itab-row.
      append gi_final.
      clear gi_final.
      endloop.
      CALL FUNCTION 'PROGRESS_INDICATOR'
      EXPORTING
        I_TEXT  = 'File Has Been Successfully Uploaded from Workstation ' .
      if not gi_final[] is initial.
        if not records-low is initial .
          if not records-high is initial.
            records-high = records-high + 1.
            DESCRIBE TABLE gi_final LINES count.
            IF records-high < count.
              DELETE gi_final FROM records-high TO count.
            ENDIF.
            IF records-low <> 1.
              IF records-low <> 0.
                DELETE gi_final FROM 1 TO records-low.
              ENDIF.
            ENDIF.
          endif.
        endif.
      endif.
      IF NOT GI_FINAL[] IS INITIAL.
        CALL FUNCTION 'PROGRESS_INDICATOR'
         EXPORTING
           I_TEXT  = 'Processing zmatnr table'
           I_OUTPUT_IMMEDIATELY = 'X'.
          if itab_count <> count.
             message i000 with 'records are not matching'.
             exit.
          else.
             modify zmatnr from table gi_final.
             message i000 with 'data base table modified successfully'.
          endif.
      endif.
    endform.
    *&      Form  search
          text
    -->  p1        text
    <--  p2        text
    FORM search .
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          static    = 'X'
        CHANGING
          file_name = pfname.
    ENDFORM.                    " search
    regards
    siva

  • I managed to transfer the music from 1 pc to 1 other pc (to be played by iTunes). Bit didn't fixe the transfer of the meta data (for example the rating). Does anyone know how to use your old playlists, etc..(= meta data) on the other PC? So, please help!

    I managed to transfer the music from 1 pc to 1 other pc (it is played perfectly on the other PC (Windows 7- pc) by the newly downloaded and installed iTunes, version 10.6.1.7). But I didn’t fix the transfer of the meta data (for example the rating). Does anyone know how to use (or import) your old playlists, etc..(= meta data) on the other PC? So, short: how to migrate the meta data from one pc to an other pc?
    It's a pity that it seems not to be possible to import on the new pc e.g. the ratings!!!
    I don't want to start again with rating my (beautiful classical) music!
    Thanks, from Amsterdam, NL

    Did you do the move via Home Sharing, astro?
    If so, perhaps try the instructions from the following post:
    Re: i transfered itunes to my pc playlists did not go

  • How to read the data from Excel file and Store in XML file using java

    Hi All,
    I got a problem with Excel file.
    My problem is how to read the data from Excel file and Store in XML file using java excel api.
    For getting the data from Excel file what are all the steps i need to follow to get the correct result.
    Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
    Thanks & Regards,
    Sreenu,
    [email protected],
    india,

    If you want someone to do your work, please have the courtesy to provide payment.
    http://www.rentacoder.com

  • Reading long text from excel file to an internal table

    Hi
    Can any body tell me how to read long text from excel file to an internal table.
    When i am using this FM KCD_EXCEL_OLE_TO_INT_CONVERT then it is reading only 32 characters from each cell.
    But in my excel sheet in one of the cell has very long text which i need to upload into a internal table.
    may i know which FM or what logic i need to use for this problem.
    Regards

    Hi,
    Here is an example program.  It will upload an Excel file with two columns.  You could also assign the Excel structure dynamically, but I wanted to keep the example simple.  The main point is that the internal table (it_excel in this example) must match the Excel structure that you want to convert.
    Remember, this is just an example to help you figure out how to properly use the technique.  It will certainly need to be modified to fit your requirements, and as always there may be a better way to get the Excel converted... this is just one possibility that has worked for me in the past.
    *& Report  zexcel_upload_test                            *
    REPORT  zexcel_upload_test.
    TYPE-POOLS: truxs.
    TYPES: BEGIN OF ty_excel,
             col_a(10) TYPE n,
             col_b(35) TYPE c,
           END OF ty_excel.
    DATA: l_data_tab         TYPE TABLE OF string,
          l_text_data        TYPE truxs_t_text_data,
          l_gui_filename     TYPE string,
          it_excel           TYPE TABLE OF ty_excel.
    FIELD-SYMBOLS: <wa_excel>  TYPE ty_excel.
    PARAMETERS: p_file TYPE rlgrap-filename.
    * Pass the file name in the correct format
    l_gui_filename = p_file.
    * Upload data from PC
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = l_gui_filename
        filetype                = 'ASC'
        has_field_separator     = 'X'
      CHANGING
        data_tab                = l_data_tab
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        OTHERS                  = 17.
    IF sy-subrc <> 0.
    *   MESSAGE ...
      EXIT.
    ENDIF.
    * Convert from Excel into the appropriate itab
    l_text_data[] = l_data_tab[].
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
        i_field_seperator    = 'X'
        i_tab_raw_data       = l_text_data
        i_filename           = p_file
      TABLES
        i_tab_converted_data = it_excel
      EXCEPTIONS
        conversion_failed    = 1
        OTHERS               = 2.
    IF sy-subrc <> 0.
    *   MESSAGE ...
      EXIT.
    ENDIF.
    LOOP AT it_excel ASSIGNING <wa_excel>.
    *  Do something here...
    ENDLOOP.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM filename_get CHANGING p_file.
    *       FORM filename_get                                             *
    FORM filename_get CHANGING p_in_file TYPE rlgrap-filename.
      DATA: l_in_file  TYPE string,
            l_filetab  TYPE filetable,
            wa_filetab TYPE LINE OF filetable,
            l_rc       TYPE i,
            l_action   TYPE i,
            l_init_dir TYPE string.
    * Set the initial directory to whatever you want it to be
      l_init_dir = 'C:\'.
    * Call the file open dialog without multiselect
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = 'Load file'
          default_extension       = '.XLS'
          default_filename        = l_in_file
          initial_directory       = l_init_dir
          multiselection          = 'X'
        CHANGING
          file_table              = l_filetab
          rc                      = l_rc
          user_action             = l_action
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          OTHERS                  = 4.
      IF sy-subrc <> 0.
        REFRESH l_filetab.
      ENDIF.
    * Read the selected filename
      READ TABLE l_filetab INTO wa_filetab INDEX 1.
      IF sy-subrc = 0.
        p_in_file = wa_filetab-filename.
      ENDIF.
    ENDFORM.                    " filename_get
    Regards,
    Jamie

  • I would like to share my ipad on my Windows machine. I got the Ipad to HDMI adaptor but nothing is displayed on the screen... Do I need any additional softwares?

    I would like to share my ipad on my Windows machine. I got the Ipad to HDMI adaptor but nothing is displayed on the screen... Do I need any additional softwares?
    Actually I would like to have the Ipad connected to pc and then run an application on the ipad (which is shown on my windows machine) and record it on the windows machine... Is this feasible?

    If you have an HDMI connection on your computer, it is most likely an output, it won't recieve a signal unless it's on a video capture card. Recording to the PC could be a difficlut task. HDMI is encrypted to keep you from copying but there are ways to do it. It would also depend on what content you intended on recording. If it's movies you have purchased or rented, it would be illegal.

  • How to transfer data from excel files into z-tables

    Please help me with a code which transfers data from excel file to z-table.
    Thanks in advance
    Shuvir

    Hi Daniel,
    Export Data
    Purpose
    Use this procedure to export SAP data to a local file such as Microsoft Excel.
    Menu Path
    Use the following menu path to begin this process:
    ·         SystemèListèSaveèLocal File
    Helpful Hints
    When reviewing fields, R = Required,  O = Optional and C = Conditional.
    Procedure
    1.       Start the transaction using the menu path or transaction code.
          Whatever Data You Want to Export
    2.       Select SystemèListèSaveèLocal File.  This works well for any data in SAP.  This is the only option for the top-level (first page) of a report. 
    In a drill-down view within a report the Local File button  on the toolbar may be used and has the same options.
          Choose File Format
    3.       Click  .
    4.       Click  to continue.  If prompted for a format after choosing Spreadsheet, select Excel Table to get an Excel file that can be modified more easily.
          Choose File Save Location Step 1
    5.       Click  to the right of the Directory field to choose a different location.
          Choose File Save Location Step 2
    6.       Click  or browse your computer to locate the directory where you want to save your file.
    7.       Complete the following field:
    ·         File name:
        You must add the proper file extension to the name of your file (.xls for Excel, .rtf for Rich Text, .html for HTML).  The file extension tells your computer what program to open the file with.  If you do not have the file extension at the end, you may not be able to open it.
    8.       Click  to continue.
          Generate File in Location and Format Selected
    9.       Click  to create the file in the location and format selected.  In this example the file was named "example.xls" and saved on the desktop.
    Result
    You have completed the export process.
    thanks
    karthik

  • Updating Start, Finish % Complete from excel file to Ms Project

    Hi - This is my first post on this forum which i see is a great way to share knowledge.
    I’m having a schedule which has around 3000 lines with resources names and a Responsible Person (  where individual resources
    report to) updated on the schedule.
    I need to work out a good way to get schedule updates from different parties in a efficient way.
    My thoughts are to make a solution to generate the tasks which needs to be updated based on the status date and generate a individual excel files for each responsible person and get
    their updates back in excel and update the dates and % complete back to the MS Project schedule.<o:p></o:p>
    The steps
    a) create a filter to list all the tasks which need to be updated based status date ( tasks which are in progress, tasks in the past which have not started yet,
    tasks in the past which have finished etc) grouped as per responsible person and create separate excel files for each responsible person.
    b) the excel file will contain ( UID, Task name, start date, finish date, %complete, resource name, responsible person)
    c) I would like to email these excel files to each responsible person and get their updates for (start date, finish date, %complete)
    d) Create a VBA macro to let the user to select the updated excel file and update the data back to MS Project file.
    Conditions while updating
    a)  
    Read the Excel file from Top to bottom and find the correct record based on the UID and update the "duration" in order to change dates as below
    b)  
    IF Task has started ( the excel file contains % complete and a new start date later than the MS Project start date)
    Update MS Project file ( Actual Start date and % Complete)
    c)  
    IF Task has started as Scheduled ( the excel file contain % complete and the excel file start date is equal to MS Project start date)
            Update MS Project file ( Actual Start date and % Complete)
    d)  
    IF Task has started and finished as Scheduled ( The excel file start and finish dates are equal to MS Project file but excel file % complete is now 100%)
    Update MS Project File ( Actual Start, Actual Finish and Update % Complete 100%)
    e)  
    If Start date of the task has been rescheduled to a future date ( If Excel file start date is > that Ms project start date and excel file % complete is 0)
    Update the MS Project file and inset a lag to match the excel file start date.
    I would like to know whether this would be a feasible solutions and if some of you have implemented this kind of thing please share some code snippets.
    Thanks a lot

    Hi John, I've managed to progress further on the code and Split the records as per supervisor and create excel file and email  to supervisor.
    However I ran into 2 problems
    1) The code  works some time without any error and some times it stalls. I have managed to narrow it down to the sorting code block on the
    ExportTaskstobeUpdated mehod where it Selects the Active work book which has all the data based on the filter and Sorts according to Supervisor Name+ Resource Name
    I have made the error code Bold and Italic
    The error I'm getting is
    Run-time error '1004'
    Method'Range' of object'_Global' failed
    2) Currently I'm creating the Master Excel file which is generated by the
    ExportTaskstobeUpdated method and splitting them and creating all the splits + the Master  excel file to a hard coded locationwhich is C:GESProjectEmail folder
    When Saving it Prompts to Over wright the existing files , I don't need any prompts coming out for the user.
    I've tried using the Application.DisplayAlearts=False but it does not work for me.
    In order to overcome this , I created a routine to delete the files after the files have been emailed/Saved as draft but that too fails to delete the original Master excel file.
    Is there a way to generate the excel files on the fly and without saving can I attach it to the email ?
    Or would like to know your thoughts on a better way to handle this.
    Sub ExportTaskstoBeUpdated()
    'Start Excel and create a new workbook
    'Create column titles
    'Export data and the project title
    'Tidy up
    Dim xlApp As Excel.Application
    Dim xlRange As Excel.Range
    Dim Dept As Task
    Dim Check As String
    Dim Prime As String
    Dim PrimeEmail As String
    Dim OpeningParen, ClosingParen As Integer
    'Start Excel and create a new workbook
    Set xlApp = CreateObject("Excel.Application")
    xlApp.Visible = True
    xlApp.Workbooks.Add
    'Create column titles
    Set xlRange = xlApp.Range("A1")
    With xlRange
    '.Formula = "Master Schedule Report"
    .Font.Bold = True
    .Font.Size = 12
    .Select
    End With
    xlRange.Range("A1") = "Supervisor"
    xlRange.Range("B1") = "Resource Name"
    xlRange.Range("C1") = "UID"
    xlRange.Range("D1") = "Task Name"
    xlRange.Range("E1") = "Start Date"
    xlRange.Range("F1") = "Finish Date"
    xlRange.Range("G1") = "% Completed"
    xlRange.Range("H1") = "Project"
    xlRange.Range("I1") = "Supervisor Email"
    With xlRange.Range("A1:N1")
    .Font.Bold = True
    .HorizontalAlignment = xlHAlignCenter
    .VerticalAlignment = xlVAlignCenter
    .EntireColumn.AutoFit
    .Select
    End With
    'Export data and the project title
    Set xlRange = xlRange.Range("A2") 'Set cursor to the right spot in the worksheet
    ViewApply Name:="Task Sheet" 'Get the view that has the Text11 column to filter on
    OutlineShowAllTasks 'Any hidden tasks won't be selected, so be sure all tasks are showing
    FilterApply Name:=" Telstra - CHECK 5 - Unstatused Tasks" 'This custom filter selects "External"
    SelectTaskColumn ("Text2") 'Insures the For Each loop gets all of the filtered tasks, this may be redundant
    For Each Dept In ActiveSelection.Tasks 'Pulls data for each task into spreadsheet
    If Dept.Text4 <> "" Then ' If there is no Supervisor defined ignore the Task
    With xlRange
    .Range("A1") = Dept.Text4 ' Supervisor Name, which has a Lookup , where the description on the lookup is the Supervisor Email
    .Range("B1") = Dept.ResourceNames
    .Range("C1") = Dept.Text1
    .Range("D1") = Dept.Name
    .Range("E1") = Format(Dept.Start, "dd-mmm-yyyy")
    .Range("F1") = Format(Dept.Finish, "dd-mmm-yyyy")
    .Range("G1") = Dept.PercentComplete
    .Range("H1") = ActiveProject.Name
    'This below Code Developed by John Finds the lookup description value for a custom field value
    If Dept.Text4 <> "" Then 'This is not required now since its captured above
    Dim Found As Boolean
    Dim i As Integer, NumSup As Integer
    NumSup = ActiveProject.Resources.Count
    'Once you have that set up, now you can add this code to your macro to determine the value for the "I1" range.
    On Error Resume Next
    'cycle through each item in the value list to find the one selected for this task
    For i = 1 To NumSup
    'once the item is found exit the loop
    If CustomFieldValueListGetItem(pjCustomTaskText4, pjValueListValue, i) = _
    Dept.Text4 Then
    'the loop can exit for two reasons, one, the item has been found, two,
    ' the item was not found and an error occurred. We need to distinguish between the two
    If Err = 0 Then Found = True
    Exit For
    End If
    Next
    On Error GoTo 0 'this resets the err function
    'now that the corresponding email address is found, set the Excel range value
    If Found Then
    .Range("I1") = CustomFieldValueListGetItem(pjCustomTaskText4, pjValueListDescription, i)
    Else
    .Range("I1") = "No Email Defined"
    End If
    End If
    '=====================
    End With
    Set xlRange = xlRange.Offset(1, 0) 'Point to next row
    Else
    End If
    Next Dept
    'Tidy up
    FilterApply Name:="All Tasks"
    ViewApply Name:="Task Sheet"
    With xlRange
    .Range("A1").ColumnWidth = 30
    .Range("D1").ColumnWidth = 50
    .Range("E1").ColumnWidth = 20
    .Range("F1").ColumnWidth = 20
    .Range("G1").ColumnWidth = 20
    .Range("H1").ColumnWidth = 30
    End With
    'Sort the Active work book for Supervisor Name + Resource Name
    Range("A1:I1").Select
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("A2:A500") _
    , SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("B2:B500") _
    , SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("Sheet1").Sort
    .SetRange Range("A1:I500")
    .Header = xlYes
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
    End With
    Set xlApp = Nothing
    'Call Method to Split to seperate files and Email
    SplitIntoSeparateFiles
    'Call the Method to delete the excel files genearated by the above method
    Deletefiles
    End Sub
    Sub SplitIntoSeparateFiles()
    '* This method Split the Master excel file which is sorted by Supervisor Name + Resource Name
    Dim OutBook, MyWorkbook As Workbook
    Dim DataSheet As Worksheet, OutSheet As Worksheet
    Dim FilterRange As Range
    Dim UniqueNames As New Collection
    Dim LastRow As Long, LastCol As Long, _
    NameCol As Long, Index As Long
    Dim OutName, MasterOutName, SupervisorEmail As String
    'set references and variables up-front for ease-of-use
    'the current workbook is the one with the primary data, more workbooks will be created later
    Set MyWorkbook = ActiveWorkbook
    Set DataSheet = ActiveSheet
    NameCol = 1 ' This is supervisor Name which will be splitted
    LastRow = DataSheet.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    LastCol = DataSheet.Cells.Find("*", SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
    Set FilterRange = Range(DataSheet.Cells(1, NameCol), DataSheet.Cells(LastRow, LastCol))
    'loop through the name column and store unique names in a collection
    For Index = 2 To LastRow
    On Error Resume Next
    UniqueNames.Add Item:=DataSheet.Cells(Index, NameCol), Key:=DataSheet.Cells(Index, NameCol)
    On Error GoTo 0
    Next Index
    'iterate through the unique names collection, writing
    'to new workbooks and saving as the group name .xls
    Application.DisplayAlerts = False
    For Index = 1 To UniqueNames.Count
    Set OutBook = Workbooks.Add
    Set OutSheet = OutBook.Sheets(1)
    With FilterRange
    .AutoFilter Field:=NameCol, Criteria1:=UniqueNames(Index)
    .SpecialCells(xlCellTypeVisible).Copy OutSheet.Range("A1")
    End With
    OutName = "C:\GESProjectEmail" + "\" 'Path to Save the generated file
    SupervisorEmail = OutSheet.Range("I2") 'Supervisor Email
    MasterOutName = OutName & "Test" ' This is the First excel file generated by the ExportTasksto Be Updated Method
    OutName = OutName & UniqueNames(Index) & Trim(I2)
    Application.DisplayAlerts = False
    OutBook.SaveAs FileName:=OutName, FileFormat:=xlExcel8 'Create Excel files for each splitted files and save
    'Call Send Email method
    Send_Email_Current_Workbook (SupervisorEmail)
    OutBook.Close SaveChanges:=False
    Call ClearAllFilters(DataSheet)
    Next Index
    Application.DisplayAlerts = False
    ActiveWorkbook.SaveAs FileName:=MasterOutName, FileFormat:=xlExcel8
    ActiveWorkbook.Close SaveChanges:=False
    Application.DisplayAlerts = True
    End Sub
    Sub Send_Email_Current_Workbook(Email As String)
    Dim OutApp As Object
    Dim OutMail As Object
    Dim rng As Range
    Set OutApp = CreateObject("Outlook.Application")
    OutApp.Session.Logon
    Set OutMail = OutApp.CreateItem(0)
    On Error Resume Next
    With OutMail
    .To = Email
    .CC = ""
    .BCC = ""
    .Subject = "Project Status Update"
    .Body = "Please Update the attached file and email it back to the PM"
    .Attachments.Add ActiveWorkbook.FullName
    .Save
    End With
    On Error GoTo 0
    Set OutMail = Nothing
    Set OutApp = Nothing
    End Sub
    'safely clear all the filters on data sheet
    Sub ClearAllFilters(TargetSheet As Worksheet)
    With TargetSheet
    TargetSheet.AutoFilterMode = False
    If .FilterMode Then
    .ShowAllData
    End If
    End With
    End Sub
    Sub Deletefiles()
    ' This method is to delete the excel files once its saved and to avoid the DO you want to overigt message
    ' because Application.DisplayAlerts = False command still prompts the user to save
    On Error Resume Next
    Kill "C:\GESProjectEmail\*.xl*"
    On Error GoTo 0
    End Sub

Maybe you are looking for

  • ORACLE;PHP PEAR DB - DB ERROR

    Hello, I am vey very new to php with oracle. when i execuite the below script it gives the error: DB Error:DB bsckend not capable When i started using numRows() functions. Can any one help me:I googled the net and they say it is working in PEAR DB 1.

  • ... GX660 BSOD ....

    Hi there, I have my GX660 20 days by now... and it suddenly started to crash.... The error that appears is this one: Problem signature:   Problem Event Name:   BlueScreen   OS Version:   6.1.7601.2.1.0.256.1 Additional information about the problem:

  • Major Color Issue

    I am having a major color issue in 10.3.9. Issue #1: Setting Color Labels... even though the names of the colors are there, the colors are actually shades of blue and gold. Issue #2: Mac Icon... normally on the dock, it's 2 shades of BLUE.. however o

  • Placed images with mini bridge

    multiple image layouts where images are placed with mini bridge are not editable until the layout is saved, well still not, save and reopen and the images are not placed in the layout. deleated ps6 today, reinstalled, updated, purchased cc for ps....

  • Cant even save - crash

    DW 15.1.0.6982 will not respond for any save. After force quit, item IS saved. Do what? mac 10.10.2