‎2009 Jun 01 4:05 PM
Hi All,
I am having a file on the server. I have to append the contents to this file. I am using 'OPEN DATA SET......' and 'TRANSFER....' but the contents are not saving to the file.
Here is what my code looks like:
data: fpath type pfeflnamel.
data: begin of filedir occurs 10.
include structure salfldir.
data: end of filedir.
data: filedata(265) type c 'ABCDEFC'.
CALL FUNCTION 'RZL_READ_DIR_LOCAL'
EXPORTING
NAME = fpath
TABLES
FILE_TBL = filedir .
loop at it_filedir.
zfile_name = filedir-name.
endloop.
OPEN DATASET zfile_name FOR APPENDING IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC = 0.
TRANSFER filedata TO zFILE_name.
CLOSE DATASET zFILE_name.
ENDIF.
But this code is not appending the data to the file. Can anyone please let me know where ia m doing wrong.
Thanks in advance,
Karuna.
‎2009 Jun 01 6:05 PM
loop at it_filedir.
zfile_name = filedir-name.
endloop.
OPEN DATASET zfile_name FOR APPENDING MODE
zfile_name is the file path on application server. Once the file is opened loop at it_filedir and transfer it_filedir to zfile_name.
‎2009 Jun 01 6:05 PM
loop at it_filedir.
zfile_name = filedir-name.
endloop.
OPEN DATASET zfile_name FOR APPENDING MODE
zfile_name is the file path on application server. Once the file is opened loop at it_filedir and transfer it_filedir to zfile_name.