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

write field of length > 255 into file

Please see below code snippet, the codes was working fine untill i realised that if i have fields large than 255 chars in REC-RECORD, the record written will be truncated at 255 chars!

How shld i go abt it?

I tried to changed RECORD to type string, but TRANSFER complains that we can't use string.

  • DATA DECLARATION

DATA: BEGIN OF REC OCCURS 5000,

RECORD(1024),

END OF REC.

  • OPENING FILE FOR WRITING..

open dataset e_file for output in text mode encoding default.

lOOP AT REC.

transfer REC to e_file.

ENDLOOP.

close dataset e_file.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 14, 2005 at 07:37 AM

    hi, you may try to use X type.

    Split you long entry to be 255 size pieces.

    And by the way, you may also need to add new line code into your internal table.

    like this

    C_X1 TYPE X VALUE '0D',

    C_X2 TYPE X VALUE '0A',

    CONCATENATE C_X1 C_X2 INTO LC_ENTER.

    CONCATENATE XXX LC_ENTER INTO ....

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 14, 2005 at 06:43 AM

    The data is not truncated.The limit for the application server is 1032 bytes.Therefore though the data is written to the server it is not visible.That's all.Better split the data into lengths of 255 if you want them all to appear on the application server.

    Cheers

    Nishanth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 14, 2005 at 07:08 AM

    Hi yong,

    U diclare Xstring .

    hope this will helps u.

    Regards,

    Vijay

    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.