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

Transfer records to UNIX with different record length

Hi all,

I have the following problem. I have to transfer records to a UNIX file. The maximum length of a record is 2000. The records are TAB seperated. I also have records which have a length less then 2000. When i look at the file in Excel the last field is always very large. Isn't there a way to only transfer the real length of the record. I have tried to transfer the record in Binary an Text mode. I used the Length statement, but nothing worked for me.

Hope anyone can help me.

Greetings Maarten

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Dec 27, 2004 at 09:03 PM

    Hi Maarten,

    "Transfer" with "length" option should work. I am not sure what you passed as length to the "transfer" command. Did you used a fixed length of 2000 or did you actually found out the record length of each record and passed that value?

    Scenario 1.

    Here in this scenario, you will always have the last field set to maximum length.

    loop at itab.

    transfer itab-record to file length 2000.


    Scenario 2.

    In this second scenario, you should have your excel's last field set to the maximum occupied length of that field.

    loop at itab.

    v_len = strlen( itab-record ).

    transfer itab-record to file length v_len.


    Hope this helps.


    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.