Skip to Content

Transfer file string to Dataset

I have a program which transfers inbound IDOC file from local directory to the application server. I stored the file contents to an internal table with a single field type STRING. The file has a maximum of 541 chars per row. But when I transferred each row, only the first 256 chars were transferred to the file in the application server. How will I transfer the whole string?

Below is a snipet of the code:

DATA: gc_fname TYPE authb-filename.

DATA: BEGIN OF gt_file OCCURS 1000,

str TYPE STRING,

END OF gt_file.

OPEN DATASET gc_fname FOR OUTPUT IN TEXT MODE

ENCODING DEFAULT.

IF sy-subrc EQ 0.

LOOP AT gt_file.

TRANSFER gt_file-str TO gc_fname LENGTH 541.

ENDLOOP.

ENDIF.

CLOSE DATASET gc_fname.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 12:16 PM

    Hi,

    In the application server the lenght of each line is only 256 bytes.

    So it can max only 256 bytes.

    Better way is split your data and send only 256 characters each time.

    This is the only solution.

    Reward points if useful.

    Regards,

    sasi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2008 at 05:32 PM

    data type string always takes lenght from 0-255 = 256 chars,

    so, define str(600) type c.

    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.