OPEN DATASET
is for creating server files.
Use the class:
CL_GUI_FRONTEND_SERVICES
for local file writing.
Note: CL_GUI_FRONTEND_SERVICES is not released for customer use until 7.02 (I think). It should still work fine on earlier versions, but if you are on an earlier version and are required to use released objects, the FMs GUI_UPLOAD or GUI_DOWNLOAD will work.