I'm trying to write text to a local file (i.e. on my laptop) using the following code:
data: fname(60), text type string value 'la la la'.
fname = 'myfile.txt'.
OPEN DATASET fname FOR OUTPUT IN TEXT MODE encoding default.
TRANSFER text TO fname.
CLOSE DATASET fname.
write 'done'.
The program runs fine and "done" appears after execution. However I cannot find the text file "myfile.txt" on my PC (it's not in the SAP work directory).
Additional Info
I have gotten this working using the function module GUI_DOWNLOAD
, however I have to use the OPEN DATASET and TRANSFER statements as I'm writing this in a background program (to be called by a BSP using SUBMIT
).