‎2008 Feb 27 11:15 AM
In my sap directory(AL11) , /usr/sap/<sysid> is already mapped and im creating notepad file (txt) at run time at this location. I could see the file created with the specified name successfully. But if i want to move my notepad file to another subfolder under this <sysid>, im unable to create the txt file even though i assigned physical paths to logical path .
<P=DIR_INTERFACE>/<SYSID>/ZTEST/<FILENAME>
‎2008 Feb 27 11:49 AM
Hi,
First you read the file in output mode using Open dataset and Read dataset statement with the initial application server path.
Then write this data back to another file path by opening the file in Input mode and using Transfer statement.
Example.
open dataset <file1> mode output encding default.
if sy-subrc = 0.
do.
read dataset <file1> into wa_itab.
if sy-subrc = 0.
append wa_itab to itab.
else.
exit.
endif.
enddo.
open dataset <file2> mode input encding default.
if sy-subrc = 0.
loop at itab into wa_itab.
transfer wa_itab to <file2>.
endloop.
endif.
Regards.
‎2008 Feb 27 11:35 AM
‎2008 Feb 27 11:49 AM
Hi,
First you read the file in output mode using Open dataset and Read dataset statement with the initial application server path.
Then write this data back to another file path by opening the file in Input mode and using Transfer statement.
Example.
open dataset <file1> mode output encding default.
if sy-subrc = 0.
do.
read dataset <file1> into wa_itab.
if sy-subrc = 0.
append wa_itab to itab.
else.
exit.
endif.
enddo.
open dataset <file2> mode input encding default.
if sy-subrc = 0.
loop at itab into wa_itab.
transfer wa_itab to <file2>.
endloop.
endif.
Regards.
‎2010 Dec 07 5:26 AM