Creating text file from table

Hi all
I have a table LFA1 with headers LIFNR, MANDT, NAME1, NAME2, ...., . That table contains data and I need to create text file that collects all headers with all data, where each field is separated by TAB.
thanks for your help.

Here is program for KNA1.
*"Table declarations...................................................
tables:
  kna1.                              " General Data in Customer Master
*"Selection screen elements............................................
select-options:
  s_kunnr for kna1-kunnr.            " Customer Number 1
*" Type declarations...................................................
types:
  begin of type_s_customer_details,
    name        like kna1-kunnr,
    address     like kna1-adrnr,
    title       like kna1-anred,
    createdon   like kna1-erdat,
    createdby   like kna1-ernam,
  end of type_s_customer_details.
Internal table to hold General Data in Customer Master data         *
data:
  t_customer_details type table
                       of type_s_customer_details
                     with header line.
                      START-OF-SELECTION EVENT                      *
start-of-selection.
  perform select.
*&      Form  select
This subroutine selects information from database and exports the    *
data into presentation layer                                         *
There are no interface parameters to be passed to this subroutine.  *
form select .
  select kunnr
          adrnr
          anred
          erdat
          ernam
     into table t_customer_details
     from kna1
    where kunnr in s_kunnr.
  if sy-subrc ne 0.
    write : / 'DATABASE SELECTION FAILED'.
  else.
    call function 'GUI_DOWNLOAD'
      exporting
  BIN_FILESIZE                    =
       filename                        = 'd:\customer_details.txt'
       filetype                        = 'ASC'
  APPEND                          = ' '
  WRITE_FIELD_SEPARATOR           = ' '
  HEADER                          = '00'
  TRUNC_TRAILING_BLANKS           = ' '
  WRITE_LF                        = 'X'
  COL_SELECT                      = ' '
  COL_SELECT_MASK                 = ' '
  DAT_MODE                        = ' '
  CONFIRM_OVERWRITE               = ' '
  NO_AUTH_CHECK                   = ' '
  CODEPAGE                        = ' '
  IGNORE_CERR                     = ABAP_TRUE
  REPLACEMENT                     = '#'
  WRITE_BOM                       = ' '
  TRUNC_TRAILING_BLANKS_EOL       = 'X'
IMPORTING
  FILELENGTH                      =
      tables
        data_tab                        = t_customer_details
  FIELDNAMES                      =
     exceptions
       file_write_error                = 1
       no_batch                        = 2
       gui_refuse_filetransfer         = 3
       invalid_type                    = 4
       no_authority                    = 5
       unknown_error                   = 6
       header_not_allowed              = 7
       separator_not_allowed           = 8
       filesize_not_allowed            = 9
       header_too_long                 = 10
       dp_error_create                 = 11
       dp_error_send                   = 12
       dp_error_write                  = 13
       unknown_dp_error                = 14
       access_denied                   = 15
       dp_out_of_memory                = 16
       disk_full                       = 17
       dp_timeout                      = 18
       file_not_found                  = 19
       dataprovider_exception          = 20
       control_flush_error             = 21
       others                          = 22
    if sy-subrc <> 0.
      write : / 'Upload Failed' , sy-subrc.
    else.
      write : / 'Upload Completed'.
    endif.
  endif.
endform.                               " SELECT

Similar Messages

  • Seeking simple example pl/sql to create text file from table data

    hello,
    I am hoping someone can provide very simple example of creating a file on my local harddrive using a pl/sql program. The basic steps are as follows:
    First, I store some text in a varchar2 variable like this:
    1. select sometext into otextvar from mytable where recordid = 1;
    Second, I want this text to become a file in my data directory:
    2. c:\data\sometext.txt
    The second step is where I need help.
    Any suggestions are greatly appreciated.

    Use this function
    It will create for you a file in your /home/oracle directory with sysdate name and will insert all table names in it
    CREATE OR REPLACE PROCEDURE my_proc AS
    CURSOR cursor1 IS
    SELECT table_name from all_tables;
    CURSOR cursor2 IS
    SELECT sysdate from dual;
    rec1 cursor1%ROWTYPE;
    rec2 cursor2%ROWTYPE;
    created_file_name VARCHAR2(100);
    file_name utl_file.file_type;
    BEGIN
    OPEN cursor2;
    LOOP
    FETCH cursor2 INTO rec2;
    EXIT WHEN cursor2%NOTFOUND;
    created_file_name:=rec2.sysdate;
    file_name := utl_file.fopen('/home/oracle', created_file_name,'W');
    OPEN cursor1;
    LOOP
    FETCH cursor1 INTO rec1;
    EXIT WHEN cursor1%NOTFOUND;
    utl_file.putf(file_name, '%s\n',rec1.TABLE_NAME);
    END LOOP;
    utl_file.fclose(file_name);
    END LOOP;
    END my_proc;
    SQL>exec my_proc;

  • Generating Text file from table using Shell script

    I am using KSH for generating and FTPing a text file from a table.
    While generating Text file I am not getting my Column names in orderly manner.
    q2="select COLUMN1||' '||COLUMN2||' '||COLUMN3 from table1;"
    set pagesize 0
    set head off
    set trimspool on
    set trimout on
    set colsep ' '
    set linesize 1500
    set trimspool on
    spool /ss/app11/oastss/reports/$file2
    select 'COLUMN1'||' '||'COLUMN2'||' '||'COLUMN3' from dual;
    $q2
    spool off;
    EOF
    I am getting the result some what like below in text file
    COLUMN1 COLUMN2 COLUMN3
    MALLIK_ACCT     17-SEP-11     908030482     
    MALLIK_ACCT     17-SEP-11     908266967     
    MALLIK_ACCT     17-SEP-11     909570766     
    I want the format like below
    COLUMN1........ COLUMN2 .... COLUMN3
    MALLIK_ACCT ...17-SEP-11 .... 908030482     
    MALLIK_ACCT ...17-SEP-11 .... 908266967     
    MALLIK_ACCT ...17-SEP-11 .... 909570766
    I put dots(.) for illustration purpose.
    column data length may icrease some times . it shoudl automatically adjust column and data so that they are in alignment. thanks in advance.

    Mallik wrote:
    Hi my question is to format the headers so that they will be in alignment with column data and readable.So you want to output a query as a fixed width format data file? How about this (rather than using scripts)...
    As sys user:
    CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
    GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
    /As myuser:
    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                         ,p_dir IN VARCHAR2
                                         ,p_header_file IN VARCHAR2
                                         ,p_data_file IN VARCHAR2 := NULL) IS
      v_finaltxt  VARCHAR2(4000);
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_fh        UTL_FILE.FILE_TYPE;
      v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
    BEGIN
      c := DBMS_SQL.OPEN_CURSOR;
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      d := DBMS_SQL.EXECUTE(c);
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
        END CASE;
      END LOOP;
      -- This part outputs the HEADER
      v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),rec_tab(j).col_max_len,' ');
          WHEN 2 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),rec_tab(j).col_max_len,' ');
          WHEN 12 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),greatest(19,length(rec_tab(j).col_name)),' ');
        END CASE;
      END LOOP;
      UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      IF NOT v_samefile THEN
        UTL_FILE.FCLOSE(v_fh);
      END IF;
      -- This part outputs the DATA
      IF NOT v_samefile THEN
        v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
      END IF;
      LOOP
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        EXIT WHEN v_ret = 0;
        v_finaltxt := NULL;
        FOR j in 1..col_cnt
        LOOP
          CASE rec_tab(j).col_type
            WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                        v_finaltxt := v_finaltxt||rpad(nvl(v_v_val,' '),rec_tab(j).col_max_len,' ');
            WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                        v_finaltxt := v_finaltxt||rpad(nvl(to_char(v_n_val,'fm99999999999999999999999999999999999999'),' '),rec_tab(j).col_max_len,' ');
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                        v_finaltxt := v_finaltxt||rpad(nvl(to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),' '),greatest(19,length(rec_tab(j).col_name)),' ');
          END CASE;
        END LOOP;
        UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      END LOOP;
      UTL_FILE.FCLOSE(v_fh);
      DBMS_SQL.CLOSE_CURSOR(c);
    END;This allows for the header row and the data to be written to seperate files if required.
    e.g.
    SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
    PL/SQL procedure successfully completed.Output.csv file contains:
    empno                 ename     job      mgr                   hiredate           sal                   comm                  deptno               
    7369                  SMITH     CLERK    7902                  17/12/1980 00:00:00800                                         20                   
    7499                  ALLEN     SALESMAN 7698                  20/02/1981 00:00:001600                  300                   30                   
    7521                  WARD      SALESMAN 7698                  22/02/1981 00:00:001250                  500                   30                   
    7566                  JONES     MANAGER  7839                  02/04/1981 00:00:002975                                        20                   
    7654                  MARTIN    SALESMAN 7698                  28/09/1981 00:00:001250                  1400                  30                   
    7698                  BLAKE     MANAGER  7839                  01/05/1981 00:00:002850                                        30                   
    7782                  CLARK     MANAGER  7839                  09/06/1981 00:00:002450                                        10                   
    7788                  SCOTT     ANALYST  7566                  19/04/1987 00:00:003000                                        20                   
    7839                  KING      PRESIDENT                      17/11/1981 00:00:005000                                        10                   
    7844                  TURNER    SALESMAN 7698                  08/09/1981 00:00:001500                  0                     30                   
    7876                  ADAMS     CLERK    7788                  23/05/1987 00:00:001100                                        20                   
    7900                  JAMES     CLERK    7698                  03/12/1981 00:00:00950                                         30                   
    7902                  FORD      ANALYST  7566                  03/12/1981 00:00:003000                                        20                   
    7934                  MILLER    CLERK    7782                  23/01/1982 00:00:001300                                        10                   
                   The procedure allows for the header and data to go to seperate files if required. Just specifying the "header" filename will put the header and data in the one file.
    Adapt to output different datatypes and styles are required (this is currently coded for VARCHAR2, NUMBER and DATE)

  • Problem in creating text file from report file

    Hello Everybody...
    I have problem in creating text file.
    I had set System Parameter as below
    DESTYPE : File
    MODE : Character
    DESNAME : gayu.txt
    And ruler setting
    Units : Character Cells
    Character Cell Size : Horiziontal = 7
    Vertiacle =12
    GridSpacing : 1
    no of snap points per grid spacing : 1
    but when i run report it will give error
    "REP_1219 M_2 or R_2 has no size -- length or width zero"
    so is there any solution of that
    or another way to convert report into text file?....

    Hi Folks,
    Please don't go after that Error as its a very deceptive one. Please don't go for altering your design Or changing the size of items in your layout.
    Similar errors I have come across in reports. I think its due to file transfer type. You might have transferred the file in Binary and your File Mode I am seeing it as CHAR.
    This normally happens while making the Report Format as "Text". Either you change that format which I think is possible in your case as your basic requirement is making a report output of CHAR type.
    Please check for this error in Metalink and proceed accordingly. I could fix similar errors when I changed Format type to PDF(from text).
    Regards
    Shibu

  • Create XML file from table data

    Dear All,
    with dataservice 4.0, I want to create an XML file from a table data.
    Table have a single column but more record, for example:
    0001000488;100;EUR;
    0001000489;200;EUR;
    0001000450;300;EUR;
    My desired XML output:
    <Data>
      0001000488;100;GBP;
      0001000489;200;EUR;
      0001000450;300;EUR;
    </Data>
    I try with a sample query but the sistem write only the last record in XML file:
    <Data>
      0001000450;300;EUR;
    </Data>
    Can everyone help me?
    Thank in advance.
    Simone

    Hello
    That is a very simple (also odd) XML document structure, and as such doesn't require use of the XML target.  It can be easily acheived by writing a normal file with a header and footer, which is acheived using a row_generation and a query to generate the hard coded open and close tags.
    Michael

  • Stored Proc to create .csv file from table

    Hi all,
    I have a table with 4 columns and 10 rows. Now I need a stored proc to create a .csv file from the table data. Here the scripts to create a table and insert the row's.
    Create table emp(emp_id number(10), emp_name varchar2(20), department varchar2(20), salary number(10));
    Insert into emp values ('1','AAAAA','SALES','10000');
    Insert into emp values ('2','BBBBB','MARKETING','8000');
    Insert into emp values ('3','CCCCC','SALES','12000');
    Insert into emp values ('4','DDDDD','FINANCE','10000');
    Insert into emp values ('5','EEEEE','SALES','11000');
    Insert into emp values ('6','FFFFF','MANAGER','90000');
    Insert into emp values ('7','GGGGG','SALES','12000');
    Insert into emp values ('8','HHHHH','FINANCE','14000');
    Insert into emp values ('9','IIIII','SALES','20000');
    Insert into emp values ('10','JJJJJ','FINANCE','21000');
    commit;
    Now I need a stored proc to create a .csv file in my local location. Please let me know If you need any other details....

    Some pointers:
    http://www.oracle-base.com/articles/9i/GeneratingCSVFiles.php
    http://tkyte.blogspot.com/2009/10/httpasktomoraclecomtkyteflat.html
    also, doing a search on this forum or http://asktom.oracle.com will give you many clues.
    .csv file in my local location.What is your 'local location'?
    A client machine? The database server machine?
    What database version are you using?
    (the result of: select * from v$version; )

  • Create text file from form data

    I need to create a form using dreamweaver and coldfusion. We
    do not have coldfusion server. just Dreamweaver 8. Until we decide
    what application server we will use, I need to create a text file
    each time a user submits data from a form and put the data into a
    text file. What would be the best way to handle this?

    if you do not have an application server like CF or PHP or
    ASP (or
    other) to process your form submissions, you should look for
    a perl/cgi
    script that can do it for you. i remember from awhile ago a
    script
    called bnbform from bignosebird.com ... it is used for
    emailing form
    submissions to a designated email address, but if i remember
    correctly
    it also stored form data in a text file....
    Azadi

  • Creating text file from SQL with adding counter in Filename.

    Hi,
    I have a requirement for creating the Tesxt files from Oracle DB which i can achieve by ODISQLUNLOAD.
    But tricky part is that i want have a file name+ counter such that Counter should start with 1 for the first file of the day, then 2,... and reset to 1 for every new date.
    e.g. file0001, file0002,file0003,file0004,.... file0100 and so on for one day.
    But when i will create a file on next day it should be created as again file0001, file0002,file0003,file0004,.... file0100 and so on.
    I may be able to achieve this using some variables but unable to think how could i achieve this.
    Any help would be appreciated.
    Thanks and Regards,
    Mahesh

    Hi Mahesh,
    If the files are loaded as one batch process, for instance, by executing a single package, you could perform a looping function and store the counter as a variable. It would be very similar to the blog post here: https://blogs.oracle.com/dataintegration/entry/using_variables_in_odi_creatin - but you would be using the #counter variable in your filename. Each day that the package is run, the counter starts at 1.
    Hope this will fit your needs.
    Enjoy!
    Michael R.

  • How to create xml file from original

    I have this complicated xml and I want to search through it and make a new xml with only element I find that match. what is the best way to do this? the file
    is about 6mb and I want to read the whole file easily..should i load to database table and create a file from table? I have found issues reading the file..
    - <ArrayOfJobClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    - <JobClass>
    - <Triggers>
    - <TriggerClass>
    <ExpireActionType>Delete</ExpireActionType>
    <ExpireType>DateTime</ExpireType>
    <TriggerType>TimeType</TriggerType>
    - <TTime>
    <TimeTriggerType>Custom</TimeTriggerType>
    <IntervalType>Daily</IntervalType>
    <SpecificType>Days</SpecificType>
    <FirstLastType>First</FirstLastType>
    <IntervalValue>1</IntervalValue>
    <FirstLastWeekDay>Monday</FirstLastWeekDay>
    <InitDate>2009-05-04T14:17:05.40625-07:00</InitDate>
    - <IntervalDays>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>

    You can load it in the database in an XMLType table (Object-Relational or Binary XML storage), use XQuery on the XML content and then write back the result to a file.
    Or, you might just use an external processor (XSLT or XQuery).
    If you want to stay in the Oracle world, you can use :
    - For XSLT : $ORACLE_HOME/bin/oraxsl (it's a wrapper for the java XSLT engine)
    - For XQuery : the java XQuery API
    Personally, I sometimes use the Saxon XSLT and XQuery processor, quite efficient.
    Here's a simplistic example with oraxsl utility :
    emp.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <emps>
      <emp id="7369">
        <name>SMITH</name>
        <job>CLERK</job>
        <salary>800</salary>
      </emp>
      <emp id="7499">
        <name>ALLEN</name>
        <job>SALESMAN</job>
        <salary>1600</salary>
      </emp>
      <emp id="7521">
        <name>WARD</name>
        <job>SALESMAN</job>
        <salary>1250</salary>
      </emp>
      <emp id="7566">
        <name>JONES</name>
        <job>MANAGER</job>
        <salary>2975</salary>
      </emp>
      <emp id="7654">
        <name>MARTIN</name>
        <job>SALESMAN</job>
        <salary>1250</salary>
      </emp>
    </emps>
    emp.xsl
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
    <xsl:template match="text()"/>
    <xsl:template match="emps/emp[job='SALESMAN']">
      <xsl:copy-of select="."/>
    </xsl:template>
    </xsl:stylesheet>Applying the transformation to search and extract all "salesmen" :
    D:\ORACLE\test>%ORACLE_HOME%\bin\oraxsl emp.xml emp.xsl result.xml
    D:\ORACLE\test>type result.xml
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <emp id="7499">
        <name>ALLEN</name>
        <job>SALESMAN</job>
        <salary>1600</salary>
      </emp><emp id="7521">
        <name>WARD</name>
        <job>SALESMAN</job>
        <salary>1250</salary>
      </emp><emp id="7654">
        <name>MARTIN</name>
        <job>SALESMAN</job>
        <salary>1250</salary>
      </emp>

  • Reading and writing to a text file from an Applet

    I'm a novice java programming with very little formal programming training. I've pieced together enough knowledge to do what I've wanted to do so far...
    However, I've been unable to figure out how to read and write to a text file from an Applet (I can do it from a normal java program just fine). Here is a simple example of what I'd like to do (you can also look at it on my website: www.stat.colostate.edu/~leach/test02/test02.html). I know that there is some problem with permission/security but I'm not smart enough to understand what the error messages are telling or understand the few books I have. If anyone can tell me how to get this applet to work, or direct me to some referrences that would help me out I'd really appreciate it.
    Thanks,
    Andy
    import java.applet.Applet;
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.io.*;
    public class test02 extends Applet {
    public Button B_go;
    public GridBagConstraints c;
    public void init() {
    this.setLayout(new GridBagLayout());
    c = new GridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    B_go = new Button("GO");
    c.gridx=1; c.gridy=0; c.gridwidth=1; c.gridheight=1;
    c.weightx = c.weighty = 0.0;
    B_go.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    print_stuff();
    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    this.add(B_go,c);
    public static void print_stuff() {
    try{
    File f = new File("test02.txt");
    PrintWriter out = new PrintWriter(new FileWriter(f));
    out.print("This is test02.txt");
    out.close();
    }catch(IOException e){**/}
    }

    I have almost the exact same problem, and I am in the same situation as you are with respects to the language.
    I am simply trying to create a file and output some garbage to it but my applet always spits back a security violation. I've tried eliminating the restrictions on the applet runner I use but I still get the error.
    My method:
    debug = new Label() ;
    debug.setLocation( 20, 20 ) ;
    debug.setSize( 500, 15 ) ;
    add( debug ) ;
    // output
    try
         OutputStream file = new FileOutputStream( new File( "" + getCodeBase() + "output.txt" ) ) ;
         byte[] buffer = { 1, 2, 3, 4, 5 } ;
         file.write( buffer ) ;
         file.close() ;
    } catch( Exception e )
         debug.setText( e.toString() ) ;
         Can anyone tell why this isnt working?

  • Producing text file from PL/SQL procedure (UTL_FILE)?

    Hi,
    I need to produce a text file from a PL/SQL procedure. My output should be a little over 38K records and my query has 70 fields. I'd like to separate the fields by pipe delimiters in the text file. I can either concatenate all 70 fields into one variable for each record or send all 70 fields over with a pipe, whichever is easier. It looks like I can't spool within PL/SQL but UTL_FILE might be an option from what I'm reading. Does anyone have any good, simple example(s) to produce a text file using this package in calling multiple fields from a LOOP? Our os is UNIX and db is Oracle 9i.
    Also, I've read that UTL_FILE has a record output of 1,023 bytes. Is this for each record line or the whole file size? I belive the max # of characters for each line wouldn't exceed 500 characters. The 38K rows I have for the data set would be well over 1MB. If this is the case, is there a work around to produce a larger text file?
    Any suggestions and/or examples would be greatly appreciated.
    Thanks,
    Eric

    Assuming the goal is to create a text file on the database server, you can use UTL_FILE here. Each line can be 1023 characters, but you can have as many lines as you'd like.
    Tom Kyte has an example here
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:235814350980
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • FAQ: Creating PDF Files from FrameMaker v.6 & earlier Documents -- Why you should not use "save as PDF"! -- Windows & MacOS Only!

    An issue that has come up over and over again on several FrameMaker and Acrobat/PDF email lists as well on the corresponding Adobe User-to-User forums is that of creation of PDF files. FrameMaker 5.5.6 and 6 have what looks like a convenient feature that is supposed to allow you to create PDF files via simply saving the document as a PDF file. I have gone on record as advising end-users not to use this approach for reliable creation of PDF files from FrameMaker documents under Windows and MacOS with FrameMaker 6 and earlier. Why do I most vociferously offer this advice and why doesn't the problem get fixed? And how SHOULD you create PDF files from FrameMaker?
    GOOD NEWS
    I will start with the good news. The "next major version" of FrameMaker will indeed have "save as PDF" re-implemented in a manner that it will be as reliable as printing to the "Acrobat Distiller" printer instance under Windows or the "Create Adobe PDF" desktop printer under MacOS. I am personally working with the FrameMaker development organization to make sure this really happens and is fully and properly tested and debugged! Furthermore, this next major revision of FrameMaker, unlike FrameMaker 6, will come with a Distiller installer that will properly install the "Acrobat Distiller" printer instance under Windows and the "Create Adobe PDF" desktop printer on the Macintosh (of course assuring that the latest PostScript driver is also automatically and correctly installed).
    DON'T USE "SAVE AS PDF"
    But what's wrong with "save as PDF" as currently implemented?
    The following are some of the SYMPTOMS reported over the last few years by FrameMaker users that were traced back to use of "save as PDF" under FrameMaker:
    (1) No PDF file is produced at all, possibly with a log file showing not-readily apparent PostScript errors during distillation.
    (2) The PDF file "loses" color in images. All or some images (raster, bitmap images, NOT vector artwork) appear in the PDF file in grayscale.
    (3) The resultant PDF file is on the wrong paper size, i.e., the document's logical page size does not match the output page size as seen in Acrobat or Acrobat Reader.
    (4) Some or all text in the resultant PDF file is blotchy looking or overly bold.
    (5) Some or all text in the resultant PDF file cannot be searched or indexed.
    (6) Some or all text in the resultant PDF file appears in Courier or in some other substitution font.
    (7) Interword or intercharacter spacing is a bit irregular in the resultant PDF file.
    (8) Content is missing in the margin areas of the page, i.e. you cannot do full-page bleeds.
    (9) Some or all page content is missing (other than margin areas).
    (10) Relatively inefficient PDF is generated.
    If this list by itself isn't enough for you, please note that some of these symptoms are very subtle and may escape attention when the PDF is first viewed or printed. Oftimes, it is when one attempts to manipulate the PDF file in Acrobat or repurpose its content or even view or print on a system other than the one on which the PDF file was created, that some of these symptoms make themselves obnoxiously visible (or invisible in some cases I won't make any bad jokes here about graphic examples!).
    It is important to understand that FrameMaker does NOT have its own native ability to create PDF. Any and all PDF created from FrameMaker documents is actually done by creating PostScript via the PostScript driver and having the Acrobat Distiller create PDF from that PostScript. The only exception to this is creation of PDF via the Acrobat PDFWriter driver, which is likewise not recommended (see below).
    In order for "save as PDF" to work correctly, FrameMaker must do the equivalent of calling Printer Setup and selecting the "Acrobat Distiller" printer instance under Windows or the "Create Adobe PDF" desktop printer under MacOS followed by setting the driver's options correctly for paper size, page range, etc., followed by sending the proper commands to the driver to create PostScript.
    Contrary to popular belief, PostScript as generated by the Windows and MacOS PostScript drivers is VERY device-dependent. The information in the PPD file associated with a printer driver instance provides critical parameters for generation of PostScript including:
    Whether the printer supports color (Acrobat Distiller does)
    What PostScript language level is supported (Acrobat Distiller 4.x and Acrobat Distiller 5.x are both PostScript language level 3)
    Whether native TrueType support is available (Acrobat supports native TrueType as Type 42 fonts)
    Available binary communications (Acrobat Distiller supports pure binary and ASCII, but NOT TCP, TBCP, or PJL)
    Resident fonts (Acrobat Distiller doesn't really have resident fonts)
    Available paper sizes and custom paper size availability (Acrobat Distiller supports a wide range of predefined sizes and continually variable "custom" sizes up to 200" by 200")
    Margins / printable areas (for PDF and the Acrobat Distiller, there are no margins in which imaging is not permitted)
    Device resolution (Acrobat Distiller can be set to any value from 72 to 4000 dpi; as a convenience, the Acrobat Distiller PPD provides a series of values for use by the driver. Since there is no inherent "resolution" of a PDF file, this parameter is used only for purposes of allowing PostScript programs that query for such a value to be satisfied and for the driver to be able to communicate this value to the operating system and/or application as required.)
    Paper handling (totally irrelevant to Acrobat Distiller if input or output tray selection via "setpagedevice" is found in the PostScript stream, it is ignored by Acrobat Distiller)
    Thus, if the wrong printer driver instance is selected (i.e., it isn't associated with the Acrobat Distiller PPD file) or that driver instance is improperly configured, improper PostScript will result and one or more of the symptoms described above can occur. As currently implemented, FrameMaker depending upon version will not necessarily choose the correct printer driver instance and/or correctly parameterize the print job via driver setup options. In fact, FrameMaker 5,5,6 might even try to generate PDF via calling a PCL driver, FAX driver, or even a non-PostScript inkjet printer!
    DON'T USE PDFWRITER
    The Acrobat PDFWriter is a relic of older versions of Acrobat. In fact, it is no longer installed by default in the "easy install" or the "typical install" of Acrobat 5. It hasn't really be updated since Acrobat 3 and only supports PDF 1.2. It is a GDI (Windows) / QuickDraw (MacOS) driver that directly generates PDF without any intermediary PostScript. Since it is not a PostScript printer driver, applications cannot pass through EPS graphics and/or PDFMark information (used for a wide variety of purposes by FrameMaker). For EPS graphics, most applications will send the low resolution TIFF (or PICT) EPS header in lieu of the PostScript text, if they send anything at all, to the driver. Forget about links, structure, or any other PDF "goodies." Expect that PDFWriter will fully "bite the dust" in the next major version of Acrobat.
    SO HOW DO I GENERATE PDF FILES FROM FRAMEMAKER 6 & EARLIER?
    The ONLY method that is really reliable for producing PDF files with FrameMaker 6 and earlier requires the generation of PostScript via a properly set printer driver instance associated with the Acrobat Distiller PPD and distillation of the resultant PostScript by Acrobat Distiller.
    Case 1: FrameMaker and the Full Acrobat 4.05 or Acrobat 5.0x Products
    PDF file from a "chapter" -- print directly to the Acrobat Distiller printer instance (Windows) or the Create Adobe PDF desktop printer (MacOS) already installed by Acrobat. If you check the "Acrobat data" option, then make sure to UNcheck the "print to file" option that gets set at the same time. As a result, the driver will automatically send the generated PostScript to the Distiller for you and delete the intermediate PostScript when done.
    PDF file from a "book" -- print directly to the Acrobat Distiller printer instance with the "print to file" option checked (Windows) or the Virtual Printer desktop printer (MacOS) associated with the Distiller PPD (see details below under Case 2/MacOS). You will need to manually process the resultant PostScript file through the Distiller (or use a "watched folder" arrangement).
    In both the above sub-cases, the default driver options generally will be OK, but check on paper size and communication protocol (Use pure binary, not ASCII, for optimal performance AND no CTRL-D characters under Windows. Make sure to set Level 3 only and Binary under MacOS. Font inclusion "All" for Acrobat 4.05 and "None" for Acrobat 5 under MacOS.). With Acrobat 4.05, make sure you preset the Distiller to use the joboptions you want. With Acrobat 5, you can set this on a job-by-job basis via the driver printer setup interface (or print dialog on MacOS).
    Case 2: FrameMaker 6 and the Bundled Acrobat 4.05 Distiller
    Windows -- Create a new printer driver instance using the latest version of the Adobe Universal PostScript Driver Installer, downloadable from Adobe's web site AND the Acrobat Distiller PPD file (located in the XTRAS subdirectory of the Distiller directory). This driver instance should be set to print to the local port named "FILE:". Name this driver instance as "Acrobat Distiller". The default driver options generally will be OK, but check on paper size and communication protocol (use pure binary, not ASCII, for optimal performance AND no CTRL-D characters). Make sure you preset the Distiller to use the joboptions you want. Print directly to this Acrobat Distiller printer instance. Make sure that the "print to file" option is checked. You will need to manually process the resultant PostScript file through the Distiller (or use a "watched folder" arrangement).
    MacOS -- Install the latest version of AdobePS 8.7.x, downloadable from Adobe's web site. In FrameMaker, go to Page Setup and select the "Virtual Printer" and go to the "Virtual Printer" window pane. Select the Acrobat Distiller PPD file (located in the XTRAS subfolder of the Distiller folder). Print directly to the "Virtual Printer" (Make sure to set Level 3 only, Binary, and font inclusion "All".). Make sure you preset the Distiller to use the joboptions you want. You will need to manually process the resultant PostScript file through the Distiller (or use a "watched folder" arrangement).
    Case 3: Acrobat 3
    Acrobat 3 is not officially supported for the latest OS versions and I personally would no longer recommend its use for generation of PDF files given that Acrobat 5.0.5 is the current version of Acrobat.
    - Dov

    You're asking a lot of ancient Acrobat to work with an Office that never existed when it was made. "Just updated my office suite" is a massive change, and Window 8 didn't exist at that time either...

  • Download text file from application server to client server.

    Hi all,
    I am facing a format issue while downloading text file from application server to the client machine.
    The issue is that, say I have 6 to 10 lines in my text file in application server. but when i store it on the hard drive,
    it shoes all the data in a single line. Where as i need to download data in same format as in application server.
    Awaiting for your responses.
    Regards,
    Jose

    Hi,
    If we want to upload file data from the application server to the internal table, there is no function module or class static method which we can use, we must wirte the code by ourselves.
    1. For the file data which has no seperator between field columns.
    PARAMETERS p_file  TYPE dxfile-filename.
    START-OF-SELECTION.
    OPEN DATASET p_file IN TEXT MODE ENCODING DEFAULT FOR INPUT.
      DO.
        READ DATASET p_file INTO gds_data.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        APPEND gds_data TO gdt_data.
      ENDDO.
    CLOSE DATASET p_file.2. For the file data which has tab separator between field columns.
    DATA: gds_field_split type gts_data.
    FIELD-SYMBOLS: <fs_field> TYPE gts_data.
    PARAMETERS p_file  TYPE dxfile-filename.
    START-OF-SELECTION.
    OPEN DATASET prf_file IN TEXT MODE ENCODING DEFAULT FOR INPUT.
      DO.
        READ DATASET p_file INTO gds_field.
        SPLIT gds_field  AT cl_abap_char_utilities=>horizontal_tab
             INTO TABLE gdt_field_split.
       LOOP AT gdt_field_split  into gds_field_split.
           gdf_index = gdf_index + 1.
           ASSIGN COMPONENT gdf_index OF STRUCTURE
                 gds_data to <fs_field>.
          IF sy-subrc = 0.
              <fs_field> = gds_field_split.
          ENDIF.
       ENDLOOP.
        APPEND gds_data TO gdt_data.
      ENDDO.
    CLOSE DATASET p_file.
    Thanks & regards,
    ShreeMohan

  • How to copy/send text file from FTPS to SAP ECC File Port

    Hi Frdns,
    I am working on one design, actually my requirement as follows
    I am receiving financial information document from Banks, which is in the form of BIA2 message format, it looks like text file. This information needs to be sending to SAP ECC system.
    I identified some approaches to full fill the requirement
    1)Using Conversion agent/or third party tools to convert BIA2 message in to XML, then using PI I will pick up the XML message, convert it in to IDoc.
    2)Without any conversion I will copy the same file (original BIA2 message) in to SAP ECC file port, in this case no conversion required, calling some program I will schedule it.
    I am looking forward t implement the second approach because it saves lot of money to my client.
    Now I am wondering using File adapter can i copy to SAP ECC File Port or I required ABAP proxy?
    What is the best approach to copy the BIA message text file from FTPS to SAP ECC File Port.??
    Regards,
    Raj

    Hi Raja,
    >>Now I am wondering using File adapter can i copy to SAP ECC File Port or I required ABAP proxy?
    Yes you can do this copy, the only restriction that can happen is the file size.. If you are sure that the fiel will be of few MB at the max then you can use the Configuration part alone and copy it to ECC folder. For doing this you need the following:
    1. Sender agreement (mention the sender interface as anything XYZ)
    2. Sender communication channel. Pick the file in binary mode
    3. Receiver determination (keep both the sender and receiver service as same)
    4. Interface Detemiantion (dont specify any mapping and keep the receiver interface name as XYZ)
    5. Create receiver agreement (with same service and interface)
    6. Use file adapter here
    Regards
    Suraj

  • Creating INDD file from INX and visa versa

    Hi
    My task is to create a inx file from indd file and that was easy. I just use
    var myDocument = app.open(File(sourceFileName));
    //save INX
    myDocument.exportFile(ExportFormat.INDESIGN_INTERCHANGE, File(destinationFilePath+".inx"));
    but my problem is that I now have a more that one INDD file and one INDB file and client ask me to make INX file from it.
    (I;m just a developer and I never use InDesigner application at all so is it possible? and how?
    and than I have to form INX file create INDD file , text file and all Linking files in Links folder.
    I found a
    var myDocument = app.open(File(sourceFileName));
    myDocument.packageForPrint(myLinkFolder, false, true, false, true, true, true, "", false);
    but problem is that I got only INDD file and for some reason the newly create INND file has a name undifined_1.indd (I found that this is a file name that script foud from INX file ?!?) LInks file is empty.
    Is it possible that he create package and put all eps file there !?!

    I'm a designer not a developer, so I'm not sure I'll be helping but<br />the normal behavior when opening an INX file is creates an untitled<br />.indd file.  This is is typical.  I'm not sure how you would<br />automatically rename back to what it was previously. Have you tried<br />packaging the indd file BEFORE you make the INX file?  Also InDesign<br />has the ability to embed the images in the file or link them to<br />external files. You might check to see if that is done, by checking<br />the links pallet.  Unfortunately I'm not following what you're<br />starting goal and end goal is.  I'll be helpless with the programming<br />end, but any questions regarding how InDesign would typically do it,<br />I'm happy to help with.<br /><br />Rosie<br />Trying to learn scripting by osmosis (tucks her laptop under her pillow)<br /><br />On Wed, Feb 18, 2009 at 4:31 AM, lpastor74 <[email protected]> wrote:<br />> A new discussion was started by lpastor74 in<br /><br />> but problem is that I got only INDD file and for some reason the newly<br />> create INND file has a name undifined_1.indd (I found that this is a file<br />> name that script foud from INX file ?!?) LInks file is empty.<br />><br />> Is it possible that he create package and put all eps file there !?!<br />><br />> ________________________________<br />> View/reply at Creating INDD file from INX and visa versa<br />> Replies by email are OK.<br />> Use the unsubscribe form to cancel your email subscription.<br />><br />>

Maybe you are looking for