01-08-2008 5:18 AM
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.
01-08-2008 5:59 AM
data : lv_str type string. "add
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.
move : gt_file-str+0(255) to lv_str. "add
TRANSFER lv_strTO gc_fname. "Modify
move : gt_file-str+255(255) to lv_str. "add
TRANSFER lv_strTO gc_fname. "add
ENDLOOP.
ENDIF.
CLOSE DATASET gc_fname.
01-08-2008 1:09 PM
Hi,
The maximum length allowed for the transfer of data is 256 only for each line.
If you want to send additional data split and send it in two lines.
bye
sasi