Export Screen to Flat Text file

Hello,
I'm very new in SAP and need to modify a little program.
I would like to export the current screen in a flat text file.
The file must be stored on the SAP server ( /usr/sap/data/bel) so not on my local harddrive.
I searched and found found functions like WS_download and GUI_download, but I'm not sure how to use them. Can somebody help me please?
Curent Code of my report:
REPORT ZAT_CLRDEP01.
Tables declaration
tables : vbrp,bkpf,bseg.
Data declaration
data: begin of itab1 occurs 0,
          vbeln like vbrp-vbeln,
          arktx like vbrp-arktx,
          belnr like bkpf-belnr,
      end of itab1.
data: begin of itab2 occurs 0,
          vbeln like vbrp-vbeln,
          arktx like vbrp-arktx,
          belnr like bkpf-belnr,
      end of itab2.
data: begin of itab3 occurs 0,
          kunnr like bseg-kunnr,
          name1 like kna1-name1,
          vbeln like vbrp-vbeln,
          zfbdt like bseg-zfbdt,
          belnr like bkpf-belnr,
          augcp like bseg-augcp,
          augbl like bseg-augbl,
          arktx like vbrp-arktx,
      end of itab3.
data: begin of itab4 occurs 0,
          kunnr like bseg-kunnr,
          name1 like kna1-name1,
          vbeln like vbrp-vbeln,
          zfbdt like bseg-zfbdt,
          augcp like bseg-augcp,
          augbl like bseg-augbl,
          arktx like vbrp-arktx,
          pswbt like bseg-pswbt,
      end of itab4.
data: vbeln_tst like vbrp-vbeln.
Selections
parameters accgrp like vbrp-ktgrm default '03' obligatory.
parameters compcde like bkpf-bukrs default 'LOI' obligatory.
select-options: billdoc for vbrp-vbeln.
select-options: customer for bseg-kunnr.
select-options: fiscyear for bkpf-gjahr.
select-options: reldate for bseg-augcp.
select-options amount for bseg-pswbt.
INITIALIZATION.
  fiscyear-low = sy-datum(4).
  fiscyear-high = sy-datum(4).
  append fiscyear.
  reldate-high = sy-datum.
  append reldate.
  amount-low = '100'.
  amount-high = '2000'.
  append amount.
START-OF-SELECTION.
  refresh: itab1,itab2,itab3,itab4.
  clear  : itab1,itab2,itab3,itab4.
  clear: vbeln_tst.
  select * into corresponding fields of table itab1
    from vbrp inner join bkpf
    on    vbrpmandt = bkpfmandt
      and vbrpvbeln = bkpfxblnr
    where vbrp~ktgrm = accgrp
      and bkpf~bukrs = compcde
      and bkpf~gjahr = fiscyear.
  loop at itab1.
    if itab1-vbeln ne vbeln_tst.
      move itab1-belnr to itab2-belnr.
      move itab1-vbeln to itab2-vbeln.
      move itab1-arktx to itab2-arktx.
      append itab2.
    endif.
    vbeln_tst = itab1-vbeln.
  endloop.
  loop at itab2.
    select * from bseg
                  where bukrs = compcde
                    and belnr = itab2-belnr
                    and gjahr = fiscyear
                    and buzei = '001'
                    and augcp in reldate
                    and augbl ne ''
                    and vbeln in billdoc
                    and kunnr in customer.
      if sy-subrc = 0.
        move itab2-belnr to itab3-belnr.
        move bseg-kunnr to itab3-kunnr.
        select single name1 from kna1
                      into itab3-name1
             where kunnr = itab3-kunnr.
        move itab2-vbeln to itab3-vbeln.
        move bseg-zfbdt to itab3-zfbdt.
        move bseg-augcp to itab3-augcp.
        move bseg-augbl to itab3-augbl.
        move itab2-arktx to itab3-arktx.
        append itab3.
      endif.
    endselect.
  endloop.
  loop at itab3.
    select * from bseg
                where bukrs = compcde
                  and belnr = itab3-belnr
                  and gjahr = fiscyear
                  and hkont = '0000488600'
                  and pswbt in amount.
      if sy-subrc = 0.
        move itab3-kunnr to itab4-kunnr.
        move itab3-name1 to itab4-name1.
        move itab3-vbeln to itab4-vbeln.
        move itab3-zfbdt to itab4-zfbdt.
        move itab3-augcp to itab4-augcp.
        move itab3-augbl to itab4-augbl.
        move itab3-arktx to itab4-arktx.
        move bseg-pswbt to itab4-pswbt.
        append itab4.
      endif.
    endselect.
  endloop.
END-OF-SELECTION.
  sort itab4 by kunnr.
  loop at itab4.
    at first.
      write:/ '   customer                    ','billing doc.',
      'Billing date',' Release date','Release doc.',
     '            material                         ','G/L amount'.
    endat.
    write:/ itab4-name1.
    write at 36 itab4-vbeln.
    write at 47 itab4-zfbdt.
    write at 61 itab4-augcp.
    write at 74 itab4-augbl.
    write at 88 itab4-arktx.
    write at 127 itab4-pswbt.
  endloop.
Thanks in advance!
Kindly regards,
Nico

Hello,
Thanks for your help and fast reaction, I added the 'open dataset' but probably made some minor error:
I'm getting  field "result" (name of my text file) is unknown. It is neither in one of the specified tables or defined by a 'DATA' statement
Currently have following code:
Objet du programme :                                                 *
      Recherche de documents de facturation SD sur base de           *
      l' "account assignment group" de l'article                     *
      Stocker ces valeurs dans une table interne afin                *
      de retrouver les pièces comptables correspondantes.            *
      Afficher le N° du document de facturation, celui de la         *
      pièce comptable, la date de release du release document.       *
REPORT ZAT_CLRDEP01.
Tables declaration
tables : vbrp,bkpf,bseg.
Data declaration
data: begin of itab1 occurs 0,
          vbeln like vbrp-vbeln,
          arktx like vbrp-arktx,
          belnr like bkpf-belnr,
      end of itab1.
data: begin of itab2 occurs 0,
          vbeln like vbrp-vbeln,
          arktx like vbrp-arktx,
          belnr like bkpf-belnr,
      end of itab2.
data: begin of itab3 occurs 0,
          kunnr like bseg-kunnr,
          name1 like kna1-name1,
          vbeln like vbrp-vbeln,
          zfbdt like bseg-zfbdt,
          belnr like bkpf-belnr,
          augcp like bseg-augcp,
          augbl like bseg-augbl,
          arktx like vbrp-arktx,
      end of itab3.
data: begin of itab4 occurs 0,
          kunnr like bseg-kunnr,
          name1 like kna1-name1,
          vbeln like vbrp-vbeln,
          zfbdt like bseg-zfbdt,
          augcp like bseg-augcp,
          augbl like bseg-augbl,
          arktx like vbrp-arktx,
          pswbt like bseg-pswbt,
      end of itab4.
data: vbeln_tst like vbrp-vbeln.
Selections
parameters accgrp like vbrp-ktgrm default '03' obligatory.
parameters compcde like bkpf-bukrs default 'LOI' obligatory.
select-options: billdoc for vbrp-vbeln.
select-options: customer for bseg-kunnr.
select-options: fiscyear for bkpf-gjahr.
select-options: reldate for bseg-augcp.
select-options amount for bseg-pswbt.
INITIALIZATION.
  fiscyear-low = sy-datum(4).
  fiscyear-high = sy-datum(4).
  append fiscyear.
  reldate-high = sy-datum.
  append reldate.
  amount-low = '100'.
  amount-high = '2000'.
  append amount.
START-OF-SELECTION.
  refresh: itab1,itab2,itab3,itab4.
  clear  : itab1,itab2,itab3,itab4.
  clear: vbeln_tst.
  select * into corresponding fields of table itab1
    from vbrp inner join bkpf
    on    vbrp~mandt = bkpf~mandt
      and vbrp~vbeln = bkpf~xblnr
    where vbrp~ktgrm = accgrp
      and bkpf~bukrs = compcde
      and bkpf~gjahr = fiscyear.
  loop at itab1.
    if itab1-vbeln ne vbeln_tst.
      move itab1-belnr to itab2-belnr.
      move itab1-vbeln to itab2-vbeln.
      move itab1-arktx to itab2-arktx.
      append itab2.
    endif.
    vbeln_tst = itab1-vbeln.
  endloop.
  loop at itab2.
    select * from bseg
                  where bukrs = compcde
                    and belnr = itab2-belnr
                    and gjahr = fiscyear
                    and buzei = '001'
                    and augcp in reldate
                    and augbl ne ''
                    and vbeln in billdoc
                    and kunnr in customer.
      if sy-subrc = 0.
        move itab2-belnr to itab3-belnr.
        move bseg-kunnr to itab3-kunnr.
        select single name1 from kna1
                      into itab3-name1
             where kunnr = itab3-kunnr.
        move itab2-vbeln to itab3-vbeln.
        move bseg-zfbdt to itab3-zfbdt.
        move bseg-augcp to itab3-augcp.
        move bseg-augbl to itab3-augbl.
        move itab2-arktx to itab3-arktx.
        append itab3.
      endif.
    endselect.
  endloop.
  loop at itab3.
    select * from bseg
                where bukrs = compcde
                  and belnr = itab3-belnr
                  and gjahr = fiscyear
                  and hkont = '0000488600'
                  and pswbt in amount.
      if sy-subrc = 0.
        move itab3-kunnr to itab4-kunnr.
        move itab3-name1 to itab4-name1.
        move itab3-vbeln to itab4-vbeln.
        move itab3-zfbdt to itab4-zfbdt.
        move itab3-augcp to itab4-augcp.
        move itab3-augbl to itab4-augbl.
        move itab3-arktx to itab4-arktx.
        move bseg-pswbt to itab4-pswbt.
        append itab4.
      endif.
    endselect.
  endloop.
END-OF-SELECTION.
  sort itab4 by kunnr.
EXPORT OUTPUT TO FLAT TEXT FILE :                                    *
open dataset result for output in text mode.
if sy-subrc = 0.
loop at itab4.
at first.
write:/ ' customer ','billing doc.',
'Billing date',' Release date','Release doc.',
' material ','G/L amount'.
endat.
write:/ itab4-name1.
write at 36 itab4-vbeln.
write at 47 itab4-zfbdt.
write at 61 itab4-augcp.
write at 74 itab4-augbl.
write at 88 itab4-arktx.
write at 127 itab4-pswbt.
transfer itab4 to result.
endloop.
close dataset result.
endif.
Thank you!
Regards,
Nico

Similar Messages

  • Data getting truncated while exporting report to a text file in crystal 10?

    Hi All,
    I am using crystal 10.When exporting report to a text file ,a dialog prompts asking for Character perinch with a default value 9.If I change the value from 9 to 16 i am getting the correct data(that means character per inch value is 16) and it update "CharPerInch" value in registry under following location to 16.
    HKEY_CURRENT_USER\Software\Crystal Decisions\10.0\Crystal Reports\Export\Text
    The dialog asked for character per inch also has option to select not to prompt again and i also selected that in first go.
    When i export the report again in text format it didn't prompt for number of character per inch but the data gets truncated.
    What i believe is even though it updates entry in registry and reads, it is not using the same value for export. It never consider the value that is in registry, if the check box is not selected then it is using the value entered in the dialog and if the check box is selected then in the next run it uses the default value as 9.
    Can anyone suggest me how to override this problem ? Is there any other setting place in registry where i can enter the number of character per inch.I don't want to crystal to prompt always for character per inch.

    Hi Venkateswaran,
    The other option to avoid truncation of the data could be
    Right click the text filed
    Click on Format Text to open the Format Editor
    On Common tab check the text box for Can Grow.
    This will prevent the data from truncating in preview as well as while exporting to text.
    Otherwise you will have to set the characters per inch to 16 each time. I donu2019t see changing the registry value causing any difference here.
    Regards,
    Aditya Joshi

  • SQL Loader-How to insert -ve & date values from flat text file into coloumn

    Question: How to insert -ve & date values from flat text file into coloumns in a table.
    Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
    How to load such values in columns of database using SQL Loader?
    Please guide.

    Question: How to insert -ve & date values from flat text file into coloumns in a table.
    Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
    How to load such values in columns of database using SQL Loader?
    Please guide. Try something like
    someDate    DATE 'DDMMYYYY'
    someNumber1      "TO_NUMBER ('s99999999.00')"
    someNumber2      "TO_NUMBER ('99999999.00s')"Good luck,
    Eric Kamradt

  • How to export structure DB to text file

    I want to export structure DB to text file for report to my manager.
    example: any objects(tables, indexs, constraints) and He need DDL command ("create table" command etc.)
    How to do this?

    Varies by database version.
    I would investigate DBMS_METADATA as described in the PL/SQL Packages and Types Reference manual and demoed in the Utilities guide at http://www.oracle.com/pls/db102/portal.portal_db?selected=3

  • Trying to Export Details Column as Text Files

    In the bin, where all the information is columned regarding (on the right hand side) regarding duration/in/out... and all the other information...
    Is there a way to export only that information as a text file of any sort? I have a feature film's length worth of footage, and I'm trying to create a list of all the available shots we have for the crew, what master tape they were captured from, their in and out points, and all that...
    (As opposed to print screening the whole thing...)
    Any help would be just fantastic and save me an incredible amount of time (or confirm I have to spend an incredible amount of time)
    Thanks.

    Export "batch list" will give you a tab delimited text file that can be imported in to a spread sheet. Hide or add columns in the browser for further control.

  • Exporting table data into text files

    I got a request to export the data from about 85 tables into 85 text files. I assume that they will want a header row and some delimiter character. This is a process that must run every night by a sql job.
    Obviously I want it to be flexible. Tables could be addede and removed and columns could be added and removed. There will probably be a control table that has the list of tables to export.
    Looked at bcp - but seems that it is command line only?
    SSIS package?
    What other options are there?

    Wanted to post my solution. Ended up using bcp in a PowerShell Script. I was unable to use bcp in SQL because it requires xp_cmdshell and that is not allowed at many of our client sites. So wrote a Powershell script that executes bcp. The ps script
    loops through a table that contains a row for each table/view to export along with many values and switches for the table/view export: export path, include column headers, enclose each field in double quotes, double up embedded double quotes, how to format
    dates, what to return for NULL integers - basically the stuff that is not flexible in bcp. To get this flexibility I created a SQL proc that takes these values as input and creates a view. Then the PS bcp does a SELECT on the view. Many of my tables are
    very wide and bcp has a limit of 4000/8000. Some of my SELECT statements ended up being GT 35k in length. So using a view got around this size limitation.
    Anyway, the view creation and bcp download is really fast. It can download about 4 gb of data in 20 minutes. It can download it faster the 7z can zip it.
    Below is the SQL proc to format the SELECT statement to create the view for bcp (or some other utility like SQLCMD, Invoke-SQLCMD) or SQL query by "SELECT * from v_ExportData". the proc can be used from SQL or PS, or anything that can call a SQL
    Proc and then read a SQL view.
    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ExportTablesCreateView]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[ExportTablesCreateView]
    GO
    CREATE PROCEDURE [dbo].[ExportTablesCreateView]
    ExportTablesCreateView
    Description:
    Read in a tablename or viewname with parameters and create a view v_ExportTable of the
    data. The view will typically be read by bcp to download SQL table data to flat files.
    bcp does not have the options to include column headers, include fields in double quotes,
    format dates or use '0' for integer NULLS. Also, bcp has a limit of varhar 4000 and
    wider tables could not be directly called by bcp. So create the v_ExportTable and have
    bcp SELECT v_ExportTable instead of the original table or view.
    Parameters:
    @pTableName VARCHAR(128) - table or view to create v_ExportTable from
    @pColumnHeader INT =1 - include column headers in the first row
    @pDoubleQuoteFields INT = 1 - put double quotes " around all column values including column headers
    @pDouble_EmbeddedDoubleQuotes INT = 1 - This is usually used with @pDoubleQuoteFields INT = 1. 'ab"c"d would be 'ab""c""d.
    @pNumNULLValue VARCHAR(1) = '0' - NULL number data types will export this value instead of bcp default of ''
    @pDateTimeFormat INT = 121 - DateTime data types will use this format value
    Example:
    EXEC ExportTablesCreateView 'custname', 1, 1, 1, '0', 121
    @pTableName VARCHAR(128),
    @pColumnHeader INT = 1,
    @pDoubleQuoteFields INT = 1,
    @pDouble_EmbeddedDoubleQuotes INT = 1,
    @pNumNULLValue VARCHAR(1) = '0',
    @pDateTimeFormat INT = 121
    AS
    BEGIN
    DECLARE @columnname varchar(128)
    DECLARE @columnsize int
    DECLARE @data_type varchar(128)
    DECLARE @HeaderRow nvarchar(max)
    DECLARE @ColumnSelect nvarchar(max)
    DECLARE @SQLSelect nvarchar(max)
    DECLARE @SQLCommand nvarchar(max)
    DECLARE @ReturnCode INT
    DECLARE @Note VARCHAR(500)
    DECLARE db_cursor CURSOR FOR
    SELECT COLUMN_NAME, ISNULL(Character_maximum_length,0), Data_type
    FROM [INFORMATION_SCHEMA].[COLUMNS]
    WHERE TABLE_NAME = @pTableName AND TABLE_SCHEMA='dbo'
    OPEN db_cursor
    FETCH NEXT FROM db_cursor INTO @ColumnName, @ColumnSize, @Data_type
    SET @HeaderRow = ''
    SET @ColumnSelect = ''
    -- Loop through each of the @pTableColumns to build the SELECT Statement
    WHILE @@FETCH_STATUS = 0
    BEGIN
    BEGIN TRY
    -- Put double quotes around each field - example "MARIA","SHARAPOVA"
    IF @pDoubleQuoteFields = 1
    BEGIN
    -- Include column headers in the first row - example "FirstName","LastName"
    IF @pColumnHeader = 1
    SET @HeaderRow = @HeaderRow + '''"' + @ColumnName + '"'' as ''' + @columnname + ''','
    -- Unsupported Export data type returns "" - example "",
    IF @Data_Type in ('image', 'varbinary', 'binary', 'timestamp', 'cursor', 'hierarchyid', 'sql_variant', 'xml', 'table', 'spatial Types')
    SET @ColumnSelect = @ColumnSelect + '''""'' as [' + @ColumnName + '],'
    -- Format DateTime data types according to input parameter
    ELSE IF @Data_Type in ('datetime', 'smalldatetime', 'datetime2', 'date', 'datetimeoffset')
    -- example - CASE when [aaa] IS NULL THEN '""' ELSE QUOTENAME(CONVERT(VARCHAR,[aaa], 121), CHAR(34)) END AS [aaa],
    SET @ColumnSelect = @ColumnSelect + 'CASE WHEN [' + @columnname + '] IS NULL THEN ''""'' ELSE QUOTENAME(CONVERT(VARCHAR,[' + @columnname + '],' + CONVERT(VARCHAR,@pDateTimeFormat) + '), CHAR(34)) END AS [' + @ColumnName + '],'
    -- SET Numeric data types with NULL value according to input parameter
    ELSE IF @Data_Type in ('bigint', 'numeric', 'bit', 'smallint', 'decimal', 'smallmoney', 'int', 'tinyint', 'money', 'float', 'real')
    -- example - CASE when [aaa] IS NULL THEN '"0"' ELSE QUOTENAME([aaa], CHAR(34)) END AS [aaa],
    SET @ColumnSelect = @ColumnSelect + 'CASE WHEN [' + @columnname + '] IS NULL THEN ''"' + @pNumNULLValue + '"'' ELSE QUOTENAME([' + @columnname + '], CHAR(34)) END AS [' + @ColumnName + '],'
    ELSE
    -- Double embedded double quotes - example "abc"d"ed" to "abc""d""ed". Only applicible for character data types.
    IF @pDouble_EmbeddedDoubleQuotes = 1
    BEGIN
    -- example - CASE when [aaa] IS NULL THEN '""' ELSE '"' + REPLACE([aaa],'"','""') + '"' END AS [aaa],
    SET @ColumnSelect = @ColumnSelect + 'CASE WHEN [' + @ColumnName + '] IS NULL THEN ''""'' ELSE ''"'' + REPLACE([' + @ColumnName + '],''"'',''""'') + ''"'' END AS [' + @ColumnName + '],'
    END
    -- DO NOT PUT Double embedded double quotes - example "abc"d"ed" unchanged to "abc"d"ed"
    ELSE
    BEGIN
    -- example - CASE when [aaa] IS NULL THEN '""' ELSE '"' + [aaa] + '"' END AS [aaa],
    SET @ColumnSelect = @ColumnSelect + 'CASE WHEN [' + @ColumnName + '] IS NULL THEN ''""'' ELSE ''"'' + [' + @ColumnName + '] + ''"'' END AS [' + @ColumnName + '],'
    END
    END
    -- DO NOT PUT double quotes around each field - example MARIA,SHARAPOVA
    ELSE
    BEGIN
    -- Include column headers in the first row - example "FirstName","LastName"
    IF @pColumnHeader = 1
    SET @HeaderRow = @HeaderRow + '''' + @ColumnName + ''' as ''' + @columnname + ''','
    -- Unsupported Export data type returns '' - example '',
    IF @Data_Type in ('image', 'varbinary', 'binary', 'timestamp', 'cursor', 'hierarchyid', 'sql_variant', 'xml', 'table', 'spatial Types')
    SET @ColumnSelect = @ColumnSelect + ''''' as [' + @ColumnName + '],'
    -- Format DateTime data types according to input parameter
    ELSE IF @Data_Type in ('datetime', 'smalldatetime', 'datetime2','date', 'datetimeoffset')
    -- example - CASE when [aaa] IS NULL THEN '''' ELSE CONVERT(VARCHAR,[aaa], 121) END AS [aaa],
    SET @ColumnSelect = @ColumnSelect + 'CASE WHEN [' + @columnname + '] IS NULL THEN '''' ELSE CONVERT(VARCHAR,[' + @columnname + '],' + CONVERT(VARCHAR,@pDateTimeFormat) + ') END AS [' + @ColumnName + '],'
    -- SET Numeric data types with NULL value according to input parameter
    ELSE IF @Data_Type in ('bigint', 'numeric', 'bit', 'smallint', 'decimal', 'smallmoney', 'int', 'tinyint', 'money', 'float', 'real')
    -- example - CASE when [aaa] IS NULL THEN '"0"' ELSE CONVERT(VARCHAR, [aaa]) END AS [aaa],
    SET @ColumnSelect = @ColumnSelect + 'CASE WHEN [' + @columnname + '] IS NULL THEN ''' + @pNumNULLValue + ''' ELSE CONVERT(VARCHAR,[' + @columnname + ']) END AS [' + @ColumnName + '],'
    ELSE
    BEGIN
    -- Double embedded double quotes - example "abc"d"ed" to "abc""d""ed". Only applicible for character data types.
    IF @pDouble_EmbeddedDoubleQuotes = 1
    -- example - CASE when [aaa] IS NULL THEN '' ELSE CONVERT(VARCHAR,REPLACE([aaa],'"','""')) END AS [aaa],
    SET @ColumnSelect = @ColumnSelect + 'CASE WHEN [' + @columnname + '] IS NULL THEN '''' ELSE CONVERT(VARCHAR,REPLACE([' + @columnname + '],''"'',''""'')) END AS [' + @ColumnName + '],'
    ELSE
    -- example - CASE when [aaa] IS NULL THEN '' ELSE CONVERT(VARCHAR,[aaa]) END AS [aaa],
    SET @ColumnSelect = @ColumnSelect + 'CASE WHEN [' + @columnname + '] IS NULL THEN '''' ELSE CONVERT(VARCHAR,[' + @columnname + ']) END AS [' + @ColumnName + '],'
    END
    END
    FETCH NEXT FROM db_cursor INTO @ColumnName, @ColumnSize, @Data_Type
    END TRY
    BEGIN CATCH
    RETURN (1)
    END CATCH
    END
    CLOSE db_cursor
    DEALLOCATE db_cursor
    BEGIN TRY
    -- remove last comma
    IF @pColumnHeader = 1
    SET @HeaderRow = SUBSTRING(@HeaderRow , 1, LEN(@HeaderRow ) - 1)
    SET @ColumnSelect = SUBSTRING(@ColumnSelect, 1, LEN(@ColumnSelect) - 1)
    -- Put on the finishing touches on the SELECT
    IF @pColumnHeader = 1
    SET @SQLSelect = 'SELECT ' + @HeaderRow + ' UNION ALL ' +
    'SELECT ' + @ColumnSelect + ' FROM [' + @pTableName + ']'
    ELSE
    SET @SQLSelect = 'SELECT ' + @ColumnSelect + ' FROM [' + @pTableName + ']'
    ---- diagnostics
    ---- PRINT truncates at 4k or 8k, not sure, my tables have many colummns
    --PRINT @SQLSelect
    --DECLARE @END varchar(max) = RIGHT(@SQLSelect, 3000)
    --PRINT @end
    --EXECUTE sp_executesql @SQLSelect
    -- drop view if exists -- using view because some tables are very wide. one of my tables had a 33k select statement
    SET @SQLCommand = '
    IF EXISTS (SELECT * FROM SYS.views WHERE name = ''v_ExportTable'')
    BEGIN
    DROP VIEW v_ExportTable
    END'
    EXECUTE @ReturnCode = sp_executesql @SQLCommand
    IF @returncode = 1
    BEGIN
    RETURN (1)
    END
    -- create the view
    SET @SQLCommand = '
    CREATE VIEW v_ExportTable AS ' + @SQLSelect
    -- diagnostics
    --print @sqlcommand
    EXECUTE @ReturnCode = sp_executesql @SQLCommand
    IF @returncode = 1
    BEGIN
    RETURN (1)
    END
    END TRY
    BEGIN CATCH
    RETURN (1)
    END CATCH
    RETURN (0)
    END -- CREATE PROCEDURE [dbo].[ExportTablesCreateView]
    GO

  • How do I export Address Book to text file?

    I want to create a separate database for my professional contacts using Excel or Filemaker.  Right now I have them all in Address Book.  If I could just export my database as a tab-delimited text file.

    The AB file
    ~/Library/Application Support/AddressBook/AddressBook-v22.abcddb
    is a SQLite3 database. You can extract data with
    http://menial.co.uk/software/base/
    or Firefox SQLite manager

  • Export address book group text file?

    Hi,
    I need to get a group of addresses to a friend who can not use the vcard format. I need to do it in a text file format, but don't see any way in address book to do that.
    Can you help?
    Meg

    The vcards are actually text files - you can read them with BBEdit or Text Editor.
    One way to achieve what you want is clumsy but may be workable, depending on the number in the group and what your friend plans to do with them. In Address Book, select the group and go to File/Print. Choose the List style, select the fields to be included and then click the PDF button and save the group as a PDF. Send the PDF to your friend. Friend can open it, click the "Select Text" tool, select the data and copy it off to whatever is to receive it.
    Another more standard way would be to run applescript to pull the data you need into a comma-separated or tab-separated data file which can be imported into spreadsheet or address book programs. Several versions of such scripts have been posted here recently, or there are various importer/exporter scripts available on the internet.
    AK

  • Creating mails with attachments from flat text files

    Hello XI community-
    we need to send emails containing attachments via the email adapter. The input comes from a flat ascii file.
    The source file contains the message body, receiver and one or more lines that have to be converted into one or more (text) attachments.
    As far as I know, the mail adapter can create attachments only from SOAP attachments.
    Does anybody know a way to create SOAP attachments from the message payload?
    Cheers,
    Linus

    Hello,
    See these weblogs to do it :
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    https://www.sdn.sap.com/sdn/weblogs.sdn?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    Regards,
    Chris

  • Data management - Export Data on a text file and work on Excel/Acces

    Hello,
    When i use the Data Export tool in order to retreive all Accounts data, the CRM creates a txt file with more than 255 columns (number of record type by account). Then I can't import them in a new Access database because Access import tool do not accepts too many columns. So, i try to open it in Excel by import text file. However, some Accounts have a comment in a large text field and, when Excel converted the text file, datas are shifted compared with the column headers because of this specific "comments" record type.
    Is someone knows whether it's possible to reduce the number of record type exported by selecting specific ones or knows a process to import on Excel/Access which resolved this problem of position ?
    Regards,
    Guillaume

    Guillaume, you can create a historical account report and specify the fields you want and then download to Excel. Also, if you use the export utility which provides a CSV file format with more than 255 columns, delete the columns you do not want to get it under 255 and then convert to Excel.

  • Export table data in text file

    hi,
    i am using oracle 8.0.7 , i want to export a table data in to text file, thanks in advance
    Noman ul haq

    2 options:
    1) Spool the query results into a file using SQL*PLUS
    2) If you can use the Oracle Server, look at the UTL_FILE package. This writes files, but ONLY to the Oracle server. It will NOT write out to your client machine. Your DBA will need to add an entry to allow for the UTL_FILE package to write out to the directory you choose.
    Hope that helps - the documentation should have detailed usage of UTL_FILE package. Or search on this site b/c this is a common question - see it at least 3 times a week.

  • Exporting historical data to text file with MAX misses columns of data?

    I am using Labview 7.1 with DSC module 7.1 and wants to export data to either excel format or .txt.
    I have tried this with the historical data export in MAX, and also programmatically with the "write traces to spreadsheet file.vi" available in the DSC module. All my tags in my tag engine file (*.scf) are defined to log data and events. Both the update tag engine deadband and the update database are set to 0 %.
    My exported excel or text file seems reasonalbe except that some columns of data are missing. I dont understand
    why data from these tags are not in the exported files since they have the same setup in the (.scf) as other tags which are okay exported?
    All defined tags can be seen using the NI hypertrend or MAX. Also the ones that are not correctly exported to file.
    Appreciate comments on this.
    Best regards,
    Ingvald Bardsen

    I am using LV and DSC 7.1 with PCI-6251 and max 4.2. In fact, just one column of values does not make sense. In attachment, follows the excel exported file. The last of column called ...V-002 that is the problem. I put probes for checking values but them shows correct. When the file is exported that to show values wrong.
    The problem of missing values in column i solved putting 0% in field of deadband.
    thank you for your help
    Attachments:
    qui, 2 de ago de 2007 - 132736.xls ‏21 KB

  • Exporting marker notes to text file in FCE

    Hello all--
    Hope this isn't too basic, but can't seem to find an answer. I'm going through videos of interviews and using markers to set interesting quotes, translation points, etc. In these markers, I'm using the comments and name to highlight the thing being said. Is there a way to export these comments, along with the time they're said to a plain ol' text file? Or at least is there a way to get them into one using FCE 3.5.1?
    thanks,
    chris

    Chris,
    Not that I know of. You can't even Copy/Paste.
    Al

  • How to export waveform data into text file

    Hi..
        I am trying to export my waveform graph data into write spreadsheet file. When running the proram, I am getting graph values (values in a matrix) when checking with the probe. But once I save it to a text file, the values recorded are just zeros. I have attached the text file along with this. Could anyone please tell me why the graph data is not recorded in the spreadsheet? I have extracted the Y component of the graph and then wired it to the write to spreadsheet function. It seems like the labview is getting the data.. but now the problem is how to get the data out of labview?

    Please find the attched image of the whole program. I tried running the program after removing the array to matrix but still I am not able to export the graph values to spreadsheet. The program as a whole is working as I am able to display the oscilloscope graph into the waveform graph but I am not able to export the values. When I tried using probes, I am getting differnet matrix values till the end of the connection given to 'write to spreadsheet' but not able to export the values. The second image shows the write to spreadsheet file inside the while loop as i thought it will reduce the memory.. but it is still not working...
    Attachments:
    Scanner complete program.jpg ‏713 KB
    full scanner program 2.jpg ‏664 KB

  • How to export bulk data in text file

    Dear,
    We have an requirement to get data from GL CONTAINING below tables, but it's taking lot of time, could you share the best way to get data in text file as quick as possiable.
    from gl_je_headers_v,gl_je_lines,GL_JE_CATEGORIES
    ,gl_code_combinations_v
    where gl_je_headers_v.je_header_id = gl_je_lines.je_header_id
    AND GL_JE_CATEGORIES.je_category_name = gl_je_headers_v.je_category
    and gl_code_combinations_v.CODE_COMBINATION_ID =
    gl_je_lines.code_combination_id
    and gl_code_combinations_v.CHART_OF_ACCOUNTS_ID = 50349
    AND gl_je_headers_v.PERIOD_NAME = 'SEP-2012'

    it's based on formatting data in text file
    you can use utl_file but it's row by row process your data
    you can try spool
    as example
    spool c:\tmp\myfile.txt
    select *
    from emp;
    spool off;or try export for example in sql developer

Maybe you are looking for