Please see the thread http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3d28358411d1829f0000e829fbfe/content.htm
& please locate the lines in the coding
OPEN DATASET FNAME FOR OUTPUT.
OPEN DATASET FNAME FOR INPUT.
My question is what is the need for this OUTPUT statement?
(A hint of the answer is given in the explanation below in the link provided
But it is not clear to me)