Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer file string to Dataset

giancarla_aguilar
Participant
0 Kudos

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.

2 REPLIES 2

Former Member
0 Kudos

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

so, define str(600) type c.

Former Member
0 Kudos

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