Skip to Content
author's profile photo Former Member
Former Member

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 09, 2007 at 03:16 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 09, 2007 at 12:37 AM

    Hi Jeff,

    Can you expalin in more details as what is your exact requirement.

    Regards,

    Atish

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 09, 2007 at 03:19 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.