Exporting fixed length records in a .txt format

Post Author: jnesbitt
CA Forum: Crystal Reports
How can I configure Crystal Report detail records so they can be exported in a fixed legth .txt record format?
Using Crystal Reports 9.2.3.884

Post Author: SKodidine
CA Forum: Crystal Reports
I have created CR detail records fixed length of 400 and then exported them to text.
This is how I did it, there might be other ways and I even though I created them in CR XI, it should be similar in CR 9.
Let us assume that your fixed length record needs to be 100 bytes long.  Create a formula with all the fields concatenated, that you would otherwise display in the details section.  Create a second formula that will use the space function to put trailing spaces.
Here is an example for a fixed length record of 400:
Here are my two fields in my record that have been concatenated.
Formula 1: RecordType & totext(BatchNumber,"0000000");
Formula 2: {@Formula1} & space(400 - length({@Formula1}));

Similar Messages

  • Adapter file receiver - file with fix length record

    Hi everybody,
    In the file adapter receiver, I want to create a fixed length record file .
    Each record need to have the same size.
    How is it possible, because I have a file which contains variable legnth depending of the lenght of message?
    exemple:
    <mess>
       <row>1234567</row>
       <row>123456789A</row>
    </mess>
    give the file
    1234567<CR>
    123456789A<CR>
    <CR> means carriage return
    and I want a file like
    1234567   <CR>
    123456789A<CR>
    with the same lenth of record (10 in the example).
    Can anyone help me, ,please?
    Kind regards.
    E. Koralewski

    Hi Eric,
    Create a value user defined function with one input argument a and name it is inputpad. Then add the following code:
    Imports:  java.*;
    while (a.length()<Integer.parseInt("10"))
         a= a +" " ;
    return String;
    Here I am assuming your fixed length for the field is 10. If it is more or less then change the number. Now in your mapping do all your logic and then in the final add this like:
    input ---> your logic --> inputpad udf --> target.
    Regards,
    ---Satish

  • File Adapter - Multiple fixed length records in the same file

    Hi
    I am developing a BPEL process that "Sync Read" a file. The file is a flat file comprising of multiple records and each record is of fixed length. There are no delimiters in the file. I got the xsd associated to this flat file and each element is defined with some fixed length and starting position. The xsd is valid.
    When I execute the BPEL Process, I get the following error - I verified the file structure and the position of the fields map correctly. Remember this is not an xml file just a plain text file. Can BPEL process such files or should I always provide an "xml" file?
    <bpelFault><faultType>0</faultType><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="detail"><detail>Start of root element expected.</detail></part><part name="summary"><summary>Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'SynchRead' failed due to: Error while translating. Translation exception. Error occured while translating content from file /tmp/inputDir/VDA1.txt ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. </summary></part><part name="code"><code>null</code></part></bindingFault></bpelFault>
    Thanks
    Shanthi

    hi,
    see you actually read a XML file and when you read it it is verified by a XSD the location of the XSD is in the XML file it self,
    <tns:abc xmlns:tns="http://xmlns.int.aaa.co.uk/xmlns/BPELXXX"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.int.aaa.co.uk/xmlns/BPELXXX *c:/aaa/bbb/ccc/XSD/abc.xsd*">
    if the file you are reading is valid then it is read, other wise not, I am not sure about sys read, but in empty BPEL process, if the XML is not validated with the XSD, then the XML is not read, I am still not sure what is the meaning of flat file, are you doing a opaque read?
    Yatan

  • BPC 7.5 NW -- Data Manager Export:  Fixed-Length Fields?

    Hi Experts,
    Client has a requirement that we export a batch of transaction data from BPC, which is generally no problem, but in this case they want to do it with Fixed-Length fields in the Export file.
    I've done a lot of BPC Data Manager Imports with Fixed-Length fields, and that function really works well.  But, has anyone tried to use the Export package with this option?  It doesn't seem to be working in my case yet.
    Any tips?
    Thanks so much, as always,
    Garrett
    =======================
    Update -- After going back to review documentation, it looks like the the *PAD() function is actually intended for export not really importing, which makes sense.  ...The SAP online help library says that it's meant for import, but I now believe that is a typo.
    Also, I've added the line "OUTPUTFORMAT = NORMAL" in my *OPTIONS section.  Anyone else manage to get export working on BPC 7.5 NW
    Edited by: Garrett Tedeman on Mar 3, 2011 1:37 PM

    Update -- This problem may now be resolved.
    I have been able to conduct test IMPORTs of 48,000, then 96,000 and then 1.7 million records.  All were fine.
    It turns out that that difference is that the text files were sorted by amount in the ones that failed.  They were sorted by GLAccount in column A for the ones that succeeded.
    Edit:  Yep, all files loaded normally when re-sorted by GLACCOUNT, etc. on the left-hand side.  Apparently, when you're doing a lot of records that might confuse the system or something
    Edited by: Garrett Tedeman on Nov 18, 2010 11:41 AM

  • Problem with added carrige returns in download of fixed length records.

    Hi,
    I'm hoping that someone can help me, I'm at a complete loss.
    I am downloading fixed length text records from our extranet via JSP. The problem is that 8 addtional carrige returns are being added to the records somewhere during this process, rendering the files useless. The following is the code I'm using
    <%
    FileInputStream fInputStream = null;
    String piccareD = "/usr/local/apache/tomcat/webapps/piccare/";
    String filePath = piccareD + "x/" + request.getRemoteUser() + "/dnload/";
    String fileName = request.getParameter("fileName");
    int ch;
    String dnloadFile = filePath + fileName;
    response.setContentType("application/octet-stream");
    response.setHeader("Content-Disposition", "attachment;filename=" + dnloadFile);
    Connection con = ConnectionServlet.getConnection();
    try
      fInputStream = new FileInputStream(dnloadFile);
      while ( (ch = fInputStream.read() ) != -1)
          out.write(ch);
      log.logEvent(con, LogElement.DNLOAD, fileName);
      log.setRetrieved(con, fileName, tStamp.getStamp());
      if( ! (fileName.indexOf("archive/") > -1) )
           String proc = "mv " + dnloadFile + " " + filePath + "archive/" + fileName;
           Process mv  = Runtime.getRuntime().exec( proc );
           Thread.sleep(100);
           int ec = mv.exitValue();
           mv.destroy();
           System.err.println( ec );
           if( ec != 0 )
    } catch (Exception e) {
            System.err.println(e.getMessage());
            log.logEvent(con, LogElement.DNLOAD_ERR, fileName);
    %>Any help is sincerely appreciated.
    Thank you!
    [email protected]

    You might try setting the buffer size to 0 for the jsp page and see if that helps.

  • Fixed Length records using SQL

    hi , using the following code in a file that generates an output file with a fixed length 300 character lines.
    SPOOL C:\PHONE_SAMPLE.OUT;
    SET HEADING OFF;
    SET PAGES 0;
    SET ECHO OFF;
    SELECT rpad(CONTACT_ID,15),rpad(PHONE1,15),rpad(PHONE2,15),rpad(PHONE3,15),rpad(PHONE4,15),rpad(PHONE5,15),rpad(PHONE6,15)
    ,rpad(CALLSEQ,6),rpad(NDCALLSEQ,6),rpad(LANG,3),rpad(FIRST,25),rpad(LAST,25),rpad(CONCODE,10),rpad(EMAIL,30),rpad(TXTMSG,20),rpad(WVEND,20),
    rpad(APPTSTART,14),rpad(APPTEND,14),rpad(APPTTYPE,10),rpad(APPTLOCTION,10),rpad(FILLER,1)||'\n'
    FROM PHONE_SAMPLE;
    SPOOL OFF;
    After I run this I get my data and the following below - my end of Character line, and then "22 rows selected" - How do I remove the 22 rows selected. and stop at \n. Any help appreciated.
    Is it a set command I am missing ?
    \n
    22 rows selected.

    Hi,
    SET FEEDBACK OFF
    And you don't need SET HEADING OFF when you have SET PAGES 0
    And you don't need to end SET commands with ';' since they are SQL*Plus commands
    Regards
    Peter

  • Creating Fixed Length from Database Records

    Hello Folks,
    I need to take records from a table and write a fixed length
    text file. What is the general procedure for doing this? Any
    special packages I need?
    TIA.
    Alex Wolff.

    The mechanisms for creating the text file are either to spool a query result from SQL*Plus or to use the UTL_FILE package to write from a PL/SQL procedure.
    To write fixed length records you would do well to convert every column to text. A sample select clause might be ...
    select to_char(my_number,'99999990.000')||
    to_char(my_date,'DD-MM-YYYY')||
    rpad(my_text,30) as fixed_output
    from ...
    I hope this covers your question.

  • Reg: DATASET of fixed length

    I want my dataset to consist of 128 byte fixed length records, with spaces padding out the record length to 128 bytes
    Can u help me how to code in ABAP programming or IS THERE ANY UNIX command for the same?

    Hi sreenivas,
    On the unix front , you can try 'awk' and 'sed' for formatting your input/output.
    Check man pages for the above mentioned command.
    Regards,
    Siddhesh

  • Java value objects to fixed-length flat file?

    I am searching for framework or third party API, which can convert a java bean to fixed length record.
    I want to automate this solution, using some mapping files. (Like hibernate API for java <----> xml conversions)
    if anybody can give me any url or suggest ways, i would appreciate that...
    thanks
    ashish

    But as business requirements change or new
    integration happens.. it is possible, You can count on it.
    java beans get
    more data elements.. so i want solution which is
    flexible easy to change or experiment ..during
    development and after being deployed. I would create two classes for representing the copybook layout. One for the whole thing and another for each element. Each field will have the length type and any special formatting rules. i.e. you will have mutiple types of field classes implementing the Field interface. Then put these in a LinkedHashMap and as you are adding them set another field which will be the offset from the beiginning of the record. The Record class will hold these Fields and other Records.
    Then create a schema text file format and load that in on startup. Then you buld the data like a you would a DOM model in your application.
    I wish someone had done that in our code instead of copying, pasting and editing this:
    int length = 10;
    int offset = 500;a bazillion times. That's real fun when you want to add fields. The damn methods aren't even in consecutive order.

  • Defaulting fixed length file fields to 'blank'

    Hi,
    I am currently working on an outbound interface which results in the construction of a fixed length record flat file. At the moment I am having to deal with each field in person to ensure that either a value,or a blank is mapped to the target field as each field is mandatory. Is there an easier way to do this such as using the 'default' setting in the data type definition with some special character to represent a blank so that I dont have to worry about missing values in my message.
    Regards,
    Pete

    Hi
    I have the same problem, and didn't find any way to default the fields.
    It helps to use the function "mapWithDefault", but you still have to deal with each field.
    Br,
    Elling

  • MFL Exception while parsing fixed length file

    Hello Folks,
    I am getting a MFLException when I run a fixed length file through a MFL Format tester.
    <MFLException>
    <ErrorMessage>Did not completely process all input data.</ErrorMessage>
    <Details>
    <Detail>
    <Name>ErrorCode</Name>
    <Value>-3</Value>
    </Detail>
    <Detail>
    <Name>DataOffset</Name>
    <Value>2720</Value>
    </Detail>
    </Details>
    </MFLException>
    Added a Filler to handle any new line characters at the EOF.
    Any ideas what's wrong with my MFL ?
    Cheers,
    Abhijeet

    Hi Atheek,
    Thanks for the response. I sent an email to you gmail id with MFL & sample message being used.
    Cheers,
    Abhijeet

  • Export to fixed length field format

    Sometimes we need to export records from our student system as fixed length text file to integrate with other software.
    Basically the report will only contains  rows of records, But we want to export it to fixed length field text file.
    And then automate the process.
    We also have Crystal enterprise server.  What is the easy and best way to accomplish this?
    Thanks

    Sorry.  Please ignore my last message.  It went into the wrong thread. 
    There is one huge problem with exporting to Fixed Length in 8.5.  The Fixed Length will truncate any trailing white space.  So if you have a could that's 5 characters long but the current value is only 3, it will only be 3 characters long. 
    To get around this, I've had to create a formula for each column in the report and check the lenght of the field and pad or truncated accordingly. 
    For example:
    If Length ({Table.FIELD1}) > 10 Then
         {Table.FIELD1} [1 to 10]
    Else {Table.FIELD1} & ReplicateString ("*", (10 - Length ({Table.FIELD1}));
    So this column should be 10 characters long.  If the field is longer than 10 characters it will truncate it to 10, otherwise it will pad the extra spaces with *.  You can't use spaces to pad because the export driver will truncate them so I decided * were the best choice because for my purposes I knew that character would never be used. 
    Good luck,
    Brian

  • Exporting Crystal .rpt to a fixed length text file

    Post Author: jnesbitt
    CA Forum: Exporting
    I am attempting to write a Crystal report that formats data to be exported to a fixed length text file. Each record will be made up of a number of fields with specific start locations and lengths. Is there any way to set the field start position and field length. I've been able to adjust the character per inch text export parameter to get close, but I can't update the paramete any longer.
    How can I reset the "Characters per inch" text export parameter?
    Version: Crystal 9.2

    Hi Jakob
    Take a look a this
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/edc2f3c2-0401-0010-8898-acd5b6a94353
    Regards
    DV

  • Export Data To Fixed Length File

    Hello,
    I have a requirement to export a couple of files that need to be in a fixed length format. 
    I've tried opening the dataset and writing the records passing the column that the records should appear:
        WRITE /, field1, 10 field2, etc...
    I've also tried to do it through SAP_CONVERT_TO_CSV_FORMAT and the text version as well.
    Is there a predefined function that will allow me to export as fixed length? 
    Thank you in advance

    Hi Jeff,
    Following is the code to do the same:
    DATA: file TYPE string VALUE `flights.dat`,
          wa   TYPE spfli.
    FIELD-SYMBOLS TYPE x.
    OPEN DATASET file FOR OUTPUT IN BINARY MODE.
    SELECT *
           FROM spfli
           INTO wa.
      ASSIGN wa TO CASTING.
      TRANSFER TO file.
    * TRANSFER LENGTH 200 to file.
    ENDSELECT.
    CLOSE DATASET file.
    Best regards,
    Prashant

  • Exporting to fixed length text using Crystal Enterprise 10

    Post Author: adamsueryan
    CA Forum: Deployment
    I would like to know if it is possible to export from Crystal Enterprise 10 to a fixed length text file similar to the text exporting option using Crystal Reports 8.5.  From Enterprise 10 I see you can export to Rich Text Format but that is not really the same.
    Adam

    Post Author: hamish_sco
    CA Forum: Exporting
    I normally use these settings, which work pretty well; Excel Format:  CustomOptions:  Column width based on - Detailsthen the following boxes ticked;Export Object FormattingMaintain Relative Object PositionMaintain Column AlignmentExport Page Header and Footer CheersHamish

Maybe you are looking for

  • Vendor posting with discount base larger than open items amount

    Hello, I'm trying to do the following post: Vendor (Debit) 500 u20AC Cost Account (Debit): 1250 u20AC Bank Account  (Credit) : 2000 u20AC VAT (Debit) 250 u20AC And I got the following warning message: "Items rel. to cash disc. Total 750 larger than o

  • Check Refunds Authorization

    Hi All, We have a requirement at our client place- We would like to issue checks to the business partners through automatic payment program FPY1. Clerk should be able to issue the check if the amount is les than $ 500 If the amount is greater than $

  • App update login doesn't work

    After updating my ipad to IOS 5.1, I can't log in to update my apps.  The login has my old apple id that I don't have a password for and I can't change the password either.  I can login to iTunes and buy musics, apps, etc using my current apple id.

  • Interpreting Predicate  and Filter information from the explain plan

    Can somebody help in understanding how does the predicate and filter operation effects the execution plan.or how can I conclude the predicate or filter operation chosen by optimizer is not optimized.

  • Oraxsl

    I'm new to xml and am trying to figure out how this whole thing works. I'm on a windows xp client v10.2.0.4 connecting to a windows 64bit database. According to the universal installer i have the sdk installed. However, when i try and invoke oraxsl i