Save tektronix waveform into csv file

Hello,
I am trying to save the waveform that from tektronix oscilloscope into a csv file by using Write to the Spreadsheet.vi .
But only one data is in the spreadsheet? How should I do this?
Thanks,

tian66 wrote:
I also have some data coming from the multimeter and I would like to save them in one spreadsheet. Thats why I use the write to the spreadsheet.vi
Is that doable?
Thanks
In that case, you just want to get the Y component of the waveform, which is an array of the Y values.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • I need to monitor a transducer block parameter and save it to a CSV file.

    How can I monitor a transducer block parameter and save it to a CSV file?  The reason is that I need to do some long-term testing of an FFb device we are developing, and I need to read the primary output parameter of the transducer block (not the scheduled AI block) every second or two and save to a CSV file.
    I have tried to figure out a way to do that with FBUS Configurator, unsuccessfully, and I purchased FBUS Monitor, as that was recommended by an industry expert, but I have been unsuccessful at getting that to work as well.

    Hi Wpinson,
    Neither FBUS Configurator nor Monitor can meet your requirement. However, there are other approaches. NI-FBUS provides APIs for C, LabVIEW, VB and C#. You can use these APIs to read a parameter value of any block and use standard file IO functions to save the date into CSV file. The LabVIEW APIs are highly recommended because they are easy-to-use and LabVIEW also provides APIs for CSV file operations. You can build the application w/ LabVIEW in a short time.
    You can find the examples of the FBUS APIs in the following folders:
    1. C: C:\Program Files\National Instruments\NI-FBUS\MS Visual C\examples
    2. VB: C:\Program Files\National Instruments\NI-FBUS\MS Visual Basic\example
    3. C#: C:\Program Files\National Instruments\NI-FBUS\MS .NET\examples\CsharpExample
    4. LabVIEW: search "fieldbus" in the LabVIEW example finder.

  • How to get sql query data and write into csv file?

    I am writing to seek help, in how can I create bat. script which can execute the following logic:
    connection to the database
    run sql query
    create CSV file
    output query data, into CSV file
    save the CSV file
    osql
    -S 84.18.111.111
    -U adw
    -P rem
    -i "c:\query.sql"
    send ""
    sed -e 's/,\s\+/,/g' MCI_04Dec2014.csv > localNoSpaces.csv
    -o "c:\MCI_04Dec2014.csv"
    This what i have so far, and I am little struggling with the logic after creating CSV file. I am unable to get the above script to work, please advice further, where I may be going wrong. 
    Can you create if statement logic within window's script, to check for null parameters or data feeds?
    Any hints would be most appreciated. 

    Thank you for your reply. 
    Apology for posting the code irrelevant to the forum, as I am still novice scripting user.  
    My goal is to create window's script which can compute the above logic and send the final output file (csv), to FTP folder. 
    Can this logic be implemented via bat. script, if so, is there a example or tutorial i could follow, in order to achieve my task. 
    Any help would be much appreciated. 

  • Saving result from query into CSV file

    Hi folks,
    in our application we're generating pages source using general packages (like htp, owa_util, ...). and in this part I'm a really beginner.
    I want to modify source one of our page, I want to add functionality to enable save result from query (cursor) into CSV file, to enable user choose place where generated file will be created and also change file name.
    I searched this forum and I found procedure, that could be useful:
    procedure p_getcsv is
    cursor cur is
           select 'a1' col1, 'b1' col2, 'c1' col3 from dual
       union  select 'a2' col1, 'b2' col2, 'c2' col3 from dual
       union  select 'a3' col1, 'b3' col2, 'c3' col3 from dual;
       begin
            -- Set the MIME type
            owa_util.mime_header( 'application/octet', FALSE );
            -- Set the name of the file
            htp.p('Content-Disposition: attachment; filename="test.csv"');
            -- Close the HTTP Header
            owa_util.http_header_close;
            -- Loop through all rows in EMP
            for x in cur
            loop
                -- Print out a portion of a row,
                -- separated by commas and ended by a CR
                 htp.prn(x.col1||','|| x.col2||','||x.col3|| chr(13));
            end loop;        
       end;What peace of code should I add to procedure that is generating web page to enable calling this procedure and whole saving process?
    Can anybody help me with this?
    Many thanks,
    Tomas
    Message was edited by:
    Tomeo

    Hi Marc,
    thanks for reply, problem is that I'm not using APEX application, I'm just generating web page code straight using oracle general packages.
    But I found this solution (maybe some tunning will be good):
    In page where I want to display Download i have
      begin
             htp.anchor2 (
                           curl  =>  ... .p_getcsv'||'?term=2005&crn=123,
                           ctext => 'Download Class List'
             HTP.br;
          end;
    ...si I'm calling p_getcsv procedure:
      procedure p_getcsv( term  IN stvterm.stvterm_code%TYPE DEFAULT NULL,
                           crn   IN sirasgn.sirasgn_crn%TYPE DEFAULT NULL) is
       v_length      NUMBER;
       v_file_name   VARCHAR2 (2000);
       temp_blob  blob;
       line RAW(32767);
       begin
             DBMS_LOB.CREATETEMPORARY(temp_blob, TRUE);
             FOR i IN 1..6  LOOP
                line := UTL_RAW.CAST_TO_RAW(i||','||term||','||crn||',AAA,BBB,CCC'||chr(10));
                DBMS_LOB.WRITEAPPEND(temp_blob, LENGTH(UTL_RAW.CAST_TO_VARCHAR2(line)), line);
             END LOOP;
              v_file_name := 'ClassList.csv';
              v_length  := DBMS_LOB.getlength (temp_blob);
              -- set up HTTP header
                 -- use an NVL around the mime type and
                 -- if it is a null set it to application/octect
                 -- application/octect may launch a download window from windows
               OWA_UTIL.mime_header (NVL ('csv', 'application/octet'), FALSE);
               -- set the size so the browser knows how much to download
               HTP.p ('Content-length: ' || v_length);
               -- the filename will be used by the browser if the users does a save as
               HTP.p (   'Content-Disposition:  attachment; filename="'
                  || REPLACE (REPLACE (SUBSTR (v_file_name,
                                               INSTR (v_file_name, '/') + 1
                                       CHR (10),
                                       NULL
                              CHR (13),
                              NULL
                  || '"'
                 -- close the headers
                 OWA_UTIL.http_header_close;
                -- download the BLOB
                 WPG_DOCLOAD.download_file (temp_blob);
                 -- release temporary blob
                 dbms_lob.freetemporary(temp_blob);  
       end;Regards,
    Tomas

  • How export to csv work in safari browser? In my application export to csv open like a raw data in new tab. But other browsers working great!. Need to open in a csv file or save it as a csv file.

    How export to csv work in safari browser?
    In my application export to csv open like a raw data in new tab.
    But other browsers working great!.
    Need to open in a csv file or save it as a csv file.
    Please suggest me. Thank you in advance!.

    Hi Adrian,
    Why don't you try any another software for opening CSV files then Notepad ? According to my experience, you can use these softwares to open an CSV files and they are:-
    Microsoft Excel
    Open Office Calc
    Google Docs
    Also there is an additional tool available known as CSV viewer. You may try this, download it from here http://www.csvviewer.com/
    I've never used Notepad for opening CSV files, because sometimes it contains some symbols which are not not at all compatibile with Notepad.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Problem in converting table data into CSV file

    Hi All,
    In my Process i need to convert my error table data into csv file,my data is converted as csv file by using OdisqlUnload function,but the column headers are not converted,i use another procedure for converting column headers but iam getting below error ...
    com.sunopsis.sql.SnpsMissingParametersException: Missing parameter string.find, string.find
    SQL: import string import java.sql as sql import java.lang as lang import re sourceConnection = odiRef.getJDBCConnection("SRC") output_write=open('C:/Oracle/Middleware/Oracle_ODI2/oracledi/pro/PRO.txt','r+') myStmt = sourceConnection.createStatement() my_query = "select * FROM E$_LOCAL_F0911Z1" my_query=my_query.upper() if string.find(my_query, '*') > 0: myRs = myStmt.executeQuery(my_query) md=myRs.getMetaData() collect=[] i=1 while (i <= md.getColumnCount()): collect.append(md.getColumnName(i)) i += 1 header=','.join(map(string.strip, collect)) elif string.find(my_query,'||') > 0: header = my_query[7:string.find(my_query, 'FROM')].replace("||','||",',') else: header = my_query[7:string.find(my_query, 'FROM')] print header old=output_write.read() output_write.seek(0) output_write.write (header+'\n'+old) sourceConnection.close() output_write.close()
    And i used below code for converting.......
    import string
    import java.sql as sql
    import java.lang as lang
    import re
    sourceConnection = odiRef.getJDBCConnection("SRC")
    output_write=open('C:/Oracle/Middleware/Oracle_ODI2/oracledi/pro/PRO.txt','r+')
    myStmt = sourceConnection.createStatement()
    my_query = "select FROM E$_COMPANY"*
    *my_query=my_query.upper()*
    *if string.find(my_query, '*') > 0:*
    *myRs = myStmt.executeQuery(my_query)*
    *md=myRs.getMetaData()*
    *collect=[]*
    *i=1*
    *while (i <= md.getColumnCount()):*
    *collect.append(md.getColumnName(i))*
    *i += 1*
    *header=','.join(map(string.strip, collect))*
    *elif string.find(my_query,'||') > 0:*
    *header = my_query[7:string.find(my_query, 'FROM')].replace("||','||",',')*
    *else:*
    *header = my_query[7:string.find(my_query, 'FROM')]*
    *print header*
    *old=output_write.read()*
    *output_write.seek(0)*
    *output_write.write (header+'\n'+old)*
    *sourceConnection.close()*
    *output_write.close()*
    Any one can you help regarding this
    Edited by: 30021986 on Oct 1, 2012 6:04 PM

    This may not be an option for you but in pinch you may want to consider outputing your data to an MS Spreadsheet, then saving it as a CSV. It's somewhat of a cumbersome process, but it will get you by for now.
    You will need to change your content type to application/vnd.ms-excel.
    <% response.setContentType("application/vnd.ms-excel"); %>

  • CLR to get the SQL Server Data into .CSV File

    Hi,
    I transformed 10 columns 1000 rows from the source table to 1 column 1000 rows in the destination table by making the comma separated columns ( Just like ..
    Insert into DestinationTable
    SELECT col1+','+col2 ....
    FROM SourceTable
    Then I want to take this column into CSV file.
    I dont have the rights to command shell.
    I heard that we may use CLR procedure for this. Can someone throw light?

    using System;
    using System.IOM
    using System.Data;
    using System.Data.SqlClient;
    using System.Data.SqlTypes;
    using Microsoft.SqlServer.Server;
    public class ExportFileClass {
    [Microsoft.SqlServer.Server.SqlProcedure]
    public static void export_file()
    using (SqlConnection connection = new SqlConnection(
    "context connection=true"))
    connection.Open();
    // Operation to open file goes here.
    SqlCommand command = new SqlCommand("SELECT col FROM YourTable");
    // Consume result set and write rows.
    Build this from the command line:
    sn -k keypair.snk
    csc /target:library /keyfile:keypair.snk exportfile.cs
    Then run in SQL Server (assuming that the files are in C:\temp on the SQL
    Server machine:
    [sql]
    USE master
    go
    -- To be able to create an external-access assembly, we need to load
    -- the key, the assembly is signed with. The key needs a password, but we
    -- don't need to know the password.
    DECLARE @sql nvarchar(MAX),
            @password char(40)
    SELECT @password = convert(char(36), newid()) + 'Ab4?'
    SELECT @sql = 'CREATE ASYMMETRIC KEY slog_loopback FROM FILE = ' +
                  '''C:\temp\keypair.snk'' ' +
                  'ENCRYPTION BY PASSWORD = ''' + @password + ''''
    PRINT @sql
    EXEC(@sql)
    -- And then a login to carry the permission.
    CREATE LOGIN exportfile$asymkey FROM ASYMMETRIC KEY ExportFile
    GRANT EXTERNAL ACCESS ASSEMBLY TO exportfile$asymkey
    go
    -- Now we can go back to our regular database and create the assembly.
    USE youddatabase
    go
    CREATE ASSEMBLY ExportFile FROM 'C:\temp\exportfile.dll'
    WITH PERMISSION_SET = EXTERNAL_ACCESS
    go
    CREATE PROCEDURE ExportFile AS
    EXTERNAL NAME ExportFile.ExportFileClass.export_file
    [sql]
    It is likely that you will have to do ask your DBA to do things in the
    master database.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How to SAP data convert into csv file.

    hi,
    i have a one internal table , and i want to extract SAP data into csv file with filed separator ','(comma).
    Thanks

    you can use this coding for slove yours issue
    tables: vbak.
    Use type pool:
    TYPE-POOLS: TRUXS.
    parameters: p_erdat like vbak-erdat.
    DATA: COM TYPE C . For comma SEPERATOR
    data: begin of itab occurs 0,
          vbeln like vbak-vbeln,
          erdat like vbak-erdat,
          end of itab.
    DATA: ITAB1 TYPE TRUXS_T_TEXT_DATA OCCURS 0 .
    COM = ','.
    select vbeln
           erdat
           into table itab
           from vbak
           where erdat = p_erdat.
    FM:
    CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
    EXPORTING
       I_FIELD_SEPERATOR          = COM
      I_LINE_HEADER              =
      I_FILENAME                 =
      I_APPL_KEEP                = ' '
      TABLES
        I_TAB_SAP_DATA             =  ITAB
    CHANGING
       I_TAB_CONVERTED_DATA       = ITAB1
    EXCEPTIONS
      CONVERSION_FAILED          = 1
      OTHERS                     = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    FM:
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                  =
        FILENAME                      = 'C:\TEST.CSV'
       FILETYPE                       = 'ASC'

  • Import data from oracle database table into csv file

    Hi
    I have to import data from a table into a csv file. Could anyone suggest the best method to do it? My application is JSP as frontend and have put business logic in servlet.
    Thanks in advance.

    FastReader from wisdomforce will help you quickly export data into csv file. http://www.wisdomforce.com
    fastreader can be called and executed as an external process ( Runtime.exec(..) ) to extract data from Oracle tables into flat file

  • Export batch data into CSV file using SQL SP

    Hi,
    I have created WCF-Custom receive adapter to poll Sql SP (WITH xmlnamespaces(DEFAULT 'Namespace' and For XML PATH(''), Type) . Get the result properly in batch while polling and but getting error while converting into CSV by using map.
    Please can anyone give me some idea to export SQL data into CSV file using SP.

    How are you doing this.
    You would have got XML representation for the XML batch received from SQL
    You should have a flat-file schema representing the CSV file which you want to send.
    Map the received XML representation of data from SQL to flat-file schema
    have custom pipeline with flat-file assembler on the assembler stage of the send pipeline.
    In the send port use the map which convert received XML from SQL to flat file schema and use the above custom flat-file disassembler send port
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • To download data into csv file format

    Hi All
    I have to download data into csv file format. I use the FM
    GUI_DOWNLOAD and gave the filename text.csv. But data is stored in excel
    file in place of csv file.
    Can anyone tell me what should i do to load the data into csv file or any other function module should used?
    Regards

    see this sample code
    REPORT  YSG_MATSTK_REPT    LINE-SIZE 220
                               LINE-COUNT 50(5).
    *&                       DATA DECLARATION                              *
    TABLES: MARA,                      "GENERAL MASTER DATA
            MARC,                      "PLANT DATA FOR MATERIAL
            MARD,                      "STORAGE LOCATION DATA FOR MATERIAL
            MVKE,                      "SALES DATA FOR MATERIAL
            MAKT,                      "MATERIAL DESCRIPTION
            EKKO,                      "PURCHASING DOCUMENT HEADER
            EKPO,                      "PURCHASING DOCUMENT ITEM
            VBAK,                      "SALES DOCUMENT HEADER DATA
            VBAP.                      "SALES DOCUMENT ITEM DATA
    TYPE-POOLS : SLIS.
    DATA: VT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
          V_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
          V_LAYOUT TYPE SLIS_LAYOUT_ALV,
          BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
          BEGIN OF I_MARA OCCURS 0,
             MATNR LIKE MARA-MATNR,  "MATERIAL NUMBER
             MBRSH LIKE MARA-MBRSH,  "INDUSTRY SECTOR
             MEINS LIKE MARA-MEINS,  "BASE UNIT OF MEASURE
             MATKL LIKE MARA-MATKL,  "MATERIAL GROUP
          END OF I_MARA,
          BEGIN OF I_MARC OCCURS 0,
             MATNR LIKE MARC-MATNR,  "MATERIAL NUMBER
             WERKS LIKE MARC-WERKS,  "PLANT
             LVORM LIKE MARC-LVORM,  "FLAG MATERIAL FOR DELETION AT PLANT
                                     "LEVEL
             DISPO LIKE MARC-DISPO,  "MRP CONTROLLER
          END OF I_MARC,
          BEGIN OF I_MAKT OCCURS 0,
             MATNR LIKE MAKT-MATNR,  "MATERIAL NUMBER
             MAKTX LIKE MAKT-MAKTX,  "MATERIAL DESCRIPTION
             SPRAS LIKE MAKT-SPRAS,  "LANGUAGE KEY
          END OF I_MAKT,
          BEGIN OF I_MVKE OCCURS 0,
             MATNR LIKE MVKE-MATNR,  "MATERIAL NUMBER
             VKORG LIKE MVKE-VKORG,  "SALES ORGANIZATION
             VTWEG LIKE MVKE-VTWEG,  "DISTRIBUTION CHANNEL
          END OF I_MVKE,
          BEGIN OF I_MARD OCCURS 0,
            MATNR LIKE MARD-MATNR,  "MATERIAL NUMBER
            LGORT LIKE MARD-LGORT,  "STORAGE LOCATION
            LABST LIKE MARD-LABST,  "VALUATED STOCK WITH UNRESTRICTED USE
          END OF I_MARD,
          BEGIN OF I_EKPO OCCURS 0,
            EBELN LIKE EKPO-EBELN,  "PURCHASING DOCUMENT NUMBER
            EBELP LIKE EKPO-EBELP,  "ITEM NUMBER OF PURCHASING DOCUMENT
            MATNR LIKE EKPO-MATNR,  "MATERIAL NUMBER
          END OF I_EKPO,
          BEGIN OF I_VBAP OCCURS 0,
            VBELN LIKE VBAP-VBELN,  "SALES DOCUMENT
            POSNR LIKE VBAP-POSNR,  "SALES DOCUMENT ITEM
            MATNR LIKE VBAP-MATNR,  "MATERIAL NUMBER
          END OF I_VBAP,
          BEGIN OF I_OUT OCCURS 0,
            MATNR LIKE MARC-MATNR,
            WERKS LIKE MARC-WERKS,
            LVORM LIKE MARC-LVORM,
            DISPO LIKE MARC-DISPO,
            MBRSH LIKE MARA-MBRSH,
            MEINS LIKE MARA-MEINS,
            MATKL LIKE MARA-MATKL,
            VKORG LIKE MVKE-VKORG,
            VTWEG LIKE MVKE-VTWEG,
            SPRAS LIKE MAKT-SPRAS,
            MAKTX LIKE MAKT-MAKTX,
            LGORT LIKE MARD-LGORT,
            LABST LIKE MARD-LABST,
            EBELN LIKE EKPO-EBELN,
            EBELP LIKE EKPO-EBELP,
            VBELN LIKE VBAP-VBELN,
            POSNR LIKE VBAP-POSNR,
          END OF I_OUT,
          BEGIN OF I_HEADING OCCURS 0,
            TEXT1(20),
            TEXT2(20),
            TEXT3(20),
            TEXT4(20),
            TEXT5(20),
            TEXT6(20),
            TEXT7(20),
            TEXT8(20),
            TEXT9(20),
            TEXT10(20),
            TEXT11(40),
            TEXT12(20),
            TEXT13(20),
            TEXT14(20),
            TEXT15(20),
            TEXT16(20),
            TEXT17(20),
          END OF I_HEADING.
    *&                   S E L E C T I O N - S C R E E N                   *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-100.
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR. "OBLIGATORY.
    PARAMETERS: P_WERKS LIKE MARC-WERKS. "OBLIGATORY.
    SELECT-OPTIONS: S_LGORT FOR MARD-LGORT,
                    S_DISPO FOR MARC-DISPO,
                    S_EBELN FOR EKPO-EBELN .
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-101.
    PARAMETERS : RB1 RADIOBUTTON GROUP G1,
                 RB2 RADIOBUTTON GROUP G1,
                 RB3 RADIOBUTTON GROUP G1.
    SELECTION-SCREEN END OF BLOCK B2.
    *&                  I N I T I A L I Z A T I O N                      *
    *INITIALIZATION.
    *&             S T A R T - O F - S E L E C T I O N                     *
    START-OF-SELECTION.
      SELECT MATNR WERKS LVORM DISPO FROM MARC
      INTO CORRESPONDING FIELDS OF TABLE I_MARC
                          WHERE MATNR IN S_MATNR
                          AND DISPO IN S_DISPO
                          AND WERKS = P_WERKS.
      IF I_MARC[] IS INITIAL.
        WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MARC'.
        EXIT.
      ENDIF.
      PERFORM PURCHASEDATA_VALIDATION.
      PERFORM SALESDATA_VALIDATION.
      SELECT MATNR LGORT LABST FROM MARD INTO TABLE  I_MARD
                          FOR ALL ENTRIES IN I_MARC
                          WHERE MATNR = I_MARC-MATNR
                          AND WERKS EQ P_WERKS
                          AND LGORT IN S_LGORT.
      IF I_MARD[] IS INITIAL.
        WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MARD'.
        EXIT.
      ENDIF.
      SELECT MATNR VKORG VTWEG FROM MVKE INTO TABLE I_MVKE
                          FOR ALL ENTRIES IN I_MARC
                          WHERE MATNR = I_MARC-MATNR.
      IF I_MVKE[] IS INITIAL.
        WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MVKE'.
        EXIT.
      ENDIF.
      LOOP AT I_MARC.
        MOVE-CORRESPONDING I_MARC TO I_OUT.
        CLEAR MARC.
        SELECT SINGLE MATNR MBRSH MEINS MATKL FROM MARA
                          INTO CORRESPONDING FIELDS OF MARA
                          WHERE MATNR = I_OUT-MATNR.
        IF SY-SUBRC = 0.
          MOVE: MARA-MBRSH TO I_OUT-MBRSH,
                MARA-MEINS TO I_OUT-MEINS,
                MARA-MATKL TO I_OUT-MATKL.
        ELSE.
          CONTINUE.
        ENDIF.
        SELECT SINGLE MATNR MAKTX SPRAS FROM MAKT
                        INTO  CORRESPONDING FIELDS OF MAKT
                        WHERE  MATNR = I_OUT-MATNR.
        IF SY-SUBRC = 0.
          MOVE: MAKT-MAKTX TO I_OUT-MAKTX,
                MAKT-SPRAS TO I_OUT-SPRAS.
        ELSE.
          CONTINUE.
        ENDIF.
        LOOP AT I_EKPO WHERE MATNR =  I_MARC-MATNR.
          MOVE: I_EKPO-EBELN TO I_OUT-EBELN,
                I_EKPO-EBELP TO I_OUT-EBELP.
        ENDLOOP.
        LOOP AT I_VBAP WHERE MATNR =  I_MARC-MATNR.
          MOVE: I_VBAP-VBELN TO I_OUT-VBELN,
                I_VBAP-POSNR TO I_OUT-POSNR.
        ENDLOOP.
        LOOP AT I_MARD WHERE MATNR = I_MARC-MATNR.
          MOVE: I_MARD-LABST TO I_OUT-LABST,
                I_MARD-LGORT TO I_OUT-LGORT.
        ENDLOOP.
        LOOP AT I_MVKE WHERE MATNR = I_MARC-MATNR.
          MOVE: I_MVKE-VKORG TO I_OUT-VKORG,
                I_MVKE-VTWEG TO I_OUT-VTWEG.
        ENDLOOP.
        APPEND I_OUT.
        CLEAR I_OUT.
      ENDLOOP.
      PERFORM OPTIONS.
                         FORM  OPTIONS                                *
    FORM OPTIONS.
      IF RB2 = 'X'.
        PERFORM FIELDCAT.
        PERFORM OUTPUT.
      ELSE.
        IF RB1 = 'X'.
          PERFORM HEADINGS.
          PERFORM DLOAD.
        ELSE.
          IF RB3 = 'X'.
            PERFORM HEADINGS.
            PERFORM DLOAD.
            PERFORM FIELDCAT.
            PERFORM OUTPUT.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    "OPTIONS
                         FORM  HEADINGS                               *
    FORM HEADINGS.
      I_HEADING-TEXT1 = 'MATNR'.
      I_HEADING-TEXT2 = 'WERKS'.
      I_HEADING-TEXT3 = 'LVORM'.
      I_HEADING-TEXT4 = 'DISPO'.
      I_HEADING-TEXT5 = 'MBRSH'.
      I_HEADING-TEXT6 = 'MEINS'.
      I_HEADING-TEXT7 = 'MATKL'.
      I_HEADING-TEXT8 = 'VKORG'.
      I_HEADING-TEXT9 = 'VTWEG'.
      I_HEADING-TEXT10 = 'SPRAS'.
      I_HEADING-TEXT11 = 'MAKTX'.
      I_HEADING-TEXT12 = 'LGORT'.
      I_HEADING-TEXT13 = 'LABST'.
      I_HEADING-TEXT14 = 'EBELN'.
      I_HEADING-TEXT15 = 'EBELP'.
      I_HEADING-TEXT16 = 'VBELN'.
      I_HEADING-TEXT17 = 'POSNR'.
      APPEND I_HEADING.
    ENDFORM.                    "HEADINGS
                         FORM  DLOAD                                  *
    FORM DLOAD.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME              = 'C:\MATSTK.csv'
          FILETYPE              = 'DAT'
          WRITE_FIELD_SEPARATOR = 'X'
        TABLES
          DATA_TAB              = I_HEADING
        EXCEPTIONS
          FILE_WRITE_ERROR      = 1.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME              = 'C:\MATSTK.csv'
          FILETYPE              = 'DAT'
          APPEND                = 'X'
          WRITE_FIELD_SEPARATOR = 'X'
        TABLES
          DATA_TAB              = I_OUT.
    ENDFORM.                    "DLOAD
                              FORM  FIELDCAT                          *
    FORM FIELDCAT.
      V_FIELDCAT-COL_POS = '1'.
      V_FIELDCAT-FIELDNAME     = 'MATNR'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-HOTSPOT = 'X'.
      V_FIELDCAT-REF_FIELDNAME = 'MATNR'.
      V_FIELDCAT-REF_TABNAME   = 'MARC'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '2'.
      V_FIELDCAT-FIELDNAME     = 'WERKS'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'WERKS'.
      V_FIELDCAT-REF_TABNAME   = 'MARC'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '3'.
      V_FIELDCAT-FIELDNAME     = 'LVORM'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'LVORM'.
      V_FIELDCAT-REF_TABNAME   = 'MARC'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '4'.
      V_FIELDCAT-FIELDNAME     = 'DISPO'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'DISPO'.
      V_FIELDCAT-REF_TABNAME   = 'MARC'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '5'.
      V_FIELDCAT-FIELDNAME     = 'MBRSH'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'MBRSH'.
      V_FIELDCAT-REF_TABNAME   = 'MARA'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '6'.
      V_FIELDCAT-FIELDNAME     = 'MEINS'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'MEINS'.
      V_FIELDCAT-REF_TABNAME   = 'MARA'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '7'.
      V_FIELDCAT-FIELDNAME     = 'MATKL'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'MATKL'.
      V_FIELDCAT-REF_TABNAME   = 'MARA'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '8'.
      V_FIELDCAT-FIELDNAME     = 'VKORG'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'VKORG'.
      V_FIELDCAT-REF_TABNAME   = 'MVKE'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '9'.
      V_FIELDCAT-FIELDNAME     = 'VTWEG'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'VTWEG'.
      V_FIELDCAT-REF_TABNAME   = 'MVKE'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '10'.
      V_FIELDCAT-FIELDNAME     = 'SPRAS'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'SPRAS'.
      V_FIELDCAT-REF_TABNAME   = 'MAKT'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '11'.
      V_FIELDCAT-FIELDNAME     = 'MAKTX'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'MAKTX'.
      V_FIELDCAT-REF_TABNAME   = 'MAKT'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '12'.
      V_FIELDCAT-FIELDNAME     = 'LGORT'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'LGORT'.
    V_FIELDCAT-REF_TABNAME   = 'MARD'.
      V_FIELDCAT-SELTEXT_L = 'STRG LOCT'.
      V_FIELDCAT-OUTPUTLEN = 10.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '13'.
      V_FIELDCAT-FIELDNAME     = 'LABST'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-SELTEXT_M = 'STOCK'.
      V_FIELDCAT-OUTPUTLEN = 15.
    V_FIELDCAT-REF_FIELDNAME = 'LABST'.
    V_FIELDCAT-REF_TABNAME   = 'MARD'.
      V_FIELDCAT-DO_SUM = 'X'.
      V_LAYOUT-TOTALS_TEXT = 'TOTAL STOCK:'.
      V_FIELDCAT-HOTSPOT = 'X'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '14'.
      V_FIELDCAT-FIELDNAME     = 'EBELN'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-HOTSPOT = 'X'.
      V_FIELDCAT-REF_FIELDNAME = 'EBELN'.
      V_FIELDCAT-REF_TABNAME   = 'EKPO'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '15'.
      V_FIELDCAT-FIELDNAME     = 'EBELP'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'EBELP'.
      V_FIELDCAT-REF_TABNAME   = 'EKPO'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '16'.
      V_FIELDCAT-FIELDNAME     = 'VBELN'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-HOTSPOT = 'X'.
      V_FIELDCAT-REF_FIELDNAME = 'VBELN'.
      V_FIELDCAT-REF_TABNAME   = 'VBAP'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '17'.
      V_FIELDCAT-FIELDNAME     = 'POSNR'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'POSNR'.
      V_FIELDCAT-REF_TABNAME   = 'VBAP'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
    ENDFORM.                      "FIELDCAT
                              FORM  OUTPUT                            *
    FORM OUTPUT.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM      = SY-REPID
          I_CALLBACK_TOP_OF_PAGE  = 'TOP-OF-PAGE'
          I_GRID_TITLE = 'CLICK ON MATERIAL/PURDOC/SALESDOC FOR DETAILS'
          I_CALLBACK_USER_COMMAND = 'DISPLAYDETAILS'
          IS_LAYOUT               = V_LAYOUT
          IT_FIELDCAT             = VT_FIELDCAT1
        TABLES
          T_OUTTAB                = I_OUT.
      IF SY-SUBRC <> 0.
      ENDIF.
    ENDFORM.                    "OUTPUT
                            FORM  TOP-OF-PAGE                         *
    FORM TOP-OF-PAGE.
      DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
            WA_HEADER TYPE SLIS_LISTHEADER.
      WA_HEADER-TYP = 'H'.
      WA_HEADER-INFO = 'REPORT FOR : '.
      APPEND WA_HEADER TO T_HEADER.
      CLEAR WA_HEADER.
      WA_HEADER-TYP = 'S'.
      WA_HEADER-INFO = 'MATERIAL DETAILS'.
      APPEND WA_HEADER TO T_HEADER.
      CLEAR WA_HEADER.
      WA_HEADER-TYP = 'S'.
      WA_HEADER-INFO = 'PURCHASE ORDER DETAILS'.
      APPEND WA_HEADER TO T_HEADER.
      CLEAR WA_HEADER.
      WA_HEADER-TYP = 'S'.
      WA_HEADER-INFO = 'SALES ORDER DETAILS'.
      APPEND WA_HEADER TO T_HEADER.
      CLEAR WA_HEADER.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          I_LOGO             = 'GEAR'
          IT_LIST_COMMENTARY = T_HEADER.
    ENDFORM.                    "TOP-OF-PAGE
    *&                       FORM  DISPLAYDETAILS                          *
    FORM DISPLAYDETAILS USING UCOMM LIKE SY-UCOMM
          SELFIELD TYPE SLIS_SELFIELD.
      IF SELFIELD-FIELDNAME = 'EBELN'.
        IF UCOMM = '&IC1'.
          READ TABLE I_OUT INDEX SELFIELD-TABINDEX.
          PERFORM PORECDNG.
          CLEAR BDCDATA[].
        ENDIF.
      ELSE.
        IF SELFIELD-FIELDNAME = 'MATNR'.
          IF UCOMM = '&IC1'.
            READ TABLE I_OUT INDEX SELFIELD-TABINDEX.
            PERFORM MMRECDNG.
            CLEAR BDCDATA[].
          ENDIF.
        ELSE.
          IF SELFIELD-FIELDNAME = 'VBELN'.
            IF UCOMM = '&IC1'.
              READ TABLE I_OUT INDEX SELFIELD-TABINDEX.
              PERFORM SALESRECDNG.
              CLEAR BDCDATA[].
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    "DISPLAYDETAILS
                        FORM PORECDNG                                   *
    FORM PORECDNG.
      PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0105'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    'RM06E-BSTNR'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM BDC_FIELD       USING 'RM06E-BSTNR'
                                    I_OUT-EBELN.
      PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0120'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    'RM06E-BSTPO(01)'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '=AH'.
      PERFORM BDC_FIELD       USING 'RM06E-EBELP'
                                    I_OUT-EBELP.
      PERFORM BDC_FIELD       USING 'RM06E-TCSELFLAG(01)'
                                    'X'.
      PERFORM BDC_TRANSACTION USING 'ME23'.
    ENDFORM.                    "PORECDNG
                        FORM MMRECDNG                                   *
    FORM MMRECDNG.
      PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0060'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    'RMMG1-MATNR'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM BDC_FIELD       USING 'RMMG1-MATNR'
                                    I_OUT-MATNR.
      PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0070'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    'MSICHTAUSW-DYTXT(01)'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '=ENTR'.
      PERFORM BDC_FIELD       USING 'MSICHTAUSW-KZSEL(01)'
                                    'X'.
      PERFORM BDC_TRANSACTION USING 'MM03'.
    ENDFORM.                    "MMRECDNG
                        FORM SALESRECDNG                                *
    FORM SALESRECDNG.
      PERFORM BDC_DYNPRO      USING 'SAPMV45A' '0102'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    'VBAK-VBELN'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM BDC_FIELD       USING 'VBAK-VBELN'
                                    I_OUT-VBELN.
      PERFORM BDC_TRANSACTION USING 'VA03'.
    ENDFORM.                    "SALESRECDNG
                     FORM BDC_TRANSACTION                               *
    FORM BDC_TRANSACTION USING TCODE.
      CALL TRANSACTION TCODE USING BDCDATA MODE 'E'.
    ENDFORM.                    "BDC_TRANSACTION
                           FORM BDC_DYNPRO                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM = PROGRAM.
      BDCDATA-DYNPRO = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.                    "BDC_DYNPRO
                           INSERT FIELD                                  *
    FORM BDC_FIELD USING FNAM FVAL.
      CLEAR BDCDATA.
      BDCDATA-FNAM = FNAM.
      BDCDATA-FVAL = FVAL.
      APPEND BDCDATA.
    ENDFORM.                    "BDC_FIELD
    *&                  FORM  PURCHASEDATA_VALIDATION                      *
    FORM PURCHASEDATA_VALIDATION.
      SELECT EBELN EBELP MATNR
                 FROM EKPO
                 INTO TABLE I_EKPO
                 FOR ALL ENTRIES IN I_MARC
                 WHERE MATNR = I_MARC-MATNR
                 AND EBELN IN S_EBELN
                 AND WERKS EQ P_WERKS.
      IF I_EKPO[] IS INITIAL.
        WRITE:/ 'NO MATCHING DATA AVAILABLE FROM TABLE EKPO'.
        EXIT.
      ENDIF.
      DATA: T_EKPO LIKE I_EKPO OCCURS 0 WITH HEADER LINE.
      T_EKPO[] = I_EKPO[].
      REFRESH I_EKPO.
      FREE I_EKPO.
      LOOP AT T_EKPO.
        SELECT SINGLE EBELN FROM EKKO INTO EKPO-EBELN
        WHERE EBELN = T_EKPO-EBELN.
        IF SY-SUBRC = 0.
          MOVE-CORRESPONDING T_EKPO TO I_EKPO.
          APPEND I_EKPO.
          CLEAR I_EKPO.
        ELSE.
          CONTINUE.
        ENDIF.
      ENDLOOP.
      SORT I_EKPO.
    ENDFORM.                    "PURCHASEDATA_VALIDATION
    *&                  FORM  SALESDATA_VALIDATION                         *
    FORM SALESDATA_VALIDATION.
      SELECT VBELN POSNR MATNR
              FROM VBAP
              INTO CORRESPONDING FIELDS OF TABLE
              I_VBAP FOR ALL ENTRIES IN I_MARC
              WHERE MATNR = I_MARC-MATNR.
    IF I_VBAP[] IS INITIAL.
        WRITE:/ 'NO MATCHING DATA AVAILABLE FROM TABLE VBAP'.
        EXIT.
      ENDIF.
      DATA: T_VBAP LIKE I_VBAP OCCURS 0 WITH HEADER LINE.
      T_VBAP[] = I_VBAP[].
      REFRESH I_VBAP.
      FREE I_VBAP.
      LOOP AT T_VBAP.
        SELECT SINGLE VBELN FROM VBAK INTO VBAK-VBELN
        WHERE VBELN = T_VBAP-VBELN.
        IF SY-SUBRC = 0.
          MOVE-CORRESPONDING T_VBAP TO I_VBAP.
          APPEND I_VBAP.
          CLEAR I_VBAP.
        ELSE.
          CONTINUE.
        ENDIF.
      ENDLOOP.
      SORT I_VBAP.
    ENDFORM.                    "SALESDATA_VALIDATION
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • How do i save and access a csv file on my ipad when filling in a smartform. Currently only option goes to photos

    Trying to save a csv file on my ipad so I can auto populate into a SmartForm. It will only allow me to access photos when I hit the import button

    search the app store for PDF Writer. I've found a lot that will convert documents to PDF, but none yet that will write within the PDF. One thing you want to avoid are cloud based apps. Any of them that talk about editing on the cloud, etc, aren't going to be as standalone as you want.
    It's possible, if you can take your template PDF, turn it into a word document that you can edit, you can then convert that to PDF...kinda a workaround way to do what you want. And apps that convert to PDF are much easier to find

  • Labview to read and white into .csv file only

    I have a security question.
    Is it possible for labview to read/write into a .CSV file only and make it not applicable to the user?
    for instant, labview writes to file OUTPUT.CSV, 
    my current system, on windows xp, i can go to output.csv and use notepad/excel to read/write  and save output.csv data.
    i want to make it not accessible to write or modify output.csv (ONLY POSSIBLE IF DONE USING LABVIEW PROGRAM).
    how would i do something like that?
    thanks in advance.
    Best regards,
    Krispiekream

    I am not sure if you can do that.  What makes this file so important?  What does it do?
    Depending on the reason you want to do this there might be a different/better soloution.  Maybe save the file as binary and if it was opened it would not be easy to read.  Or save the file in a location that has nothing to do with LabVIEW?
    Under File I/O >> Advanced,  There is a VI called Access Rights that you might be able to use.

  • Download int table into csv file with each column in separate column in csv

    Hi All,
    I want to download the data in internal table to CSV file. but each column in the table should come as separate column in csv format.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                = GD_FILE
          FILETYPE                = 'ASC'
          WRITE_FIELD_SEPARATOR   = 'X'
        tables
          DATA_TAB                = I_LINES_NEW
        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 NE 0.
        WRITE: 'Error ', SY-SUBRC, 'returned from GUI_DOWNLOAD SAP OUTBOUND'.
        SKIP.
      ENDIF.
    with the above values passd , I am getting csv file but all the columns in one column separated by some square symbol.
    How to separate them into different columns.
    Thanks in advance
    rgds,
    Madhuri

    Below example might help you understand on dowloading CSV file:
    TYPE-POOLS: truxs.
    DATA: i_t001 TYPE STANDARD TABLE OF t001,
          i_data TYPE truxs_t_text_data.
    SELECT * FROM t001 INTO TABLE i_t001 UP TO 20 ROWS.
    CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
      EXPORTING
        i_field_seperator          = ','
    *   I_LINE_HEADER              =
    *   I_FILENAME                 =
    *   I_APPL_KEEP                = ' '
      TABLES
        i_tab_sap_data             = i_t001
    CHANGING
       i_tab_converted_data       = i_data
    EXCEPTIONS
       conversion_failed          = 1
       OTHERS                     = 2.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    DATA: file TYPE string VALUE 'C:\testing.csv'.
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
        filename                = file
      CHANGING
        data_tab                = i_data[]
      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
        not_supported_by_gui    = 22
        error_no_gui            = 23
        OTHERS                  = 24.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Regards
    Eswar

  • How to save excel report as CSV file with ActiveX

    Hi,
    I'm trying to save my excel test report as a CSV file using ActiveX and I'm having difficulty getting started.  I can't find an invoke node method that enables CSV file conversion. 
    Can anyone shed light on this?  See attached screenshot.
    Thanks
     

    As long as you are using the Report Generation Toolkit, there is no need to use ActiveX for the purpose of saving the Excel file -- Save Report will do that for you.  You can then export (as text) all of the Excel data and use the Write Spreadsheet File to make the .CSV file.  Here is how I would rewrite the final bits of your code --
    I cleaned up the wires around Excel Easy Table a bit.  You'll see I made a VI Icon for Replace Filename, which does (I think) a nicer job of self-documenting than showing its Label.  To make the filename, add the correct extension (.xlsx for Excel, .csv for CSV), use Build Path to combine Folder and Filename, and wire to Save Report.
    The next two functions add the Extract Everything and Write to Spreadsheet, using a Comma as a separator, which makes a CSV copy for you.
    Bob Schor

Maybe you are looking for

  • How do I get a complete backup of my iPhone?

    I am sure that somewhere this is answered completely...i just havent found it yet. I plugged my phone into iTunes, did a sync and backup, then restored my phone to original state, then tried to install everything from a backup. All of my apps are mis

  • Project Structure in SAP R/3 Replication Issues

    Hi All, I have some of the Issues while creating the Project Structure in cProjects. 1) The Project Structure getting generated in SAP R/3 is only mappped with WBS elements, why not Networks and Network Activies. e.g *cProjects                     SA

  • Printing Margins - Reset Safari Library?

    I am having a problem printing documents from safari, from only 1 of my accounts on my macbook. The guest account has no problems printing. The problem is the same regardless what printer I print to. When told to print safari will format the document

  • Looking for a good wireless server..

    I've tried Roadrunner's wireless service and it was horrible, does anybody know of any good wireless services?

  • Adobe is now Preview . . .

    I just upgraded to Tiger. Now the pdf's that are in the documents folder no longer show the Adobe icon, they show the Preview icon, and they will only open in Preview. Also if I try to "save as pdf" in the Print box, it opens Preview when it used to