‎2013 Mar 11 2:05 PM
hello all,
I'm facing an issue with the transfer statement , i try to dump the content of a table into a file (in the sample code i'm trying only with one field).
The code is not generating any file in output, even if i have authorization to write in the directory to save the file generated.
The sample code is following:
TABLES:
/BIC/AZD_LOG0100.
DATA:
BEGIN OF w_hist,
Customer LIKE /BIC/AZD_LOG0100-/BIC/C_DO_ADV,
END OF w_hist,
i_hist LIKE TABLE OF w_hist.
DATA:
filename TYPE string.
DATA:
fdir TYPE string value '\temp\'.
SELECT /BIC/C_DO_ADV
FROM /BIC/AZD_LOG0100
INTO TABLE i_hist.
CHECK NOT i_hist[] is initial.
SORT i_hist by Customer.
CONCATENATE FDIR 'test.csv' INTO filename .
OPEN DATASET filename FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT i_hist INTO w_hist.
WRITE w_hist-Customer TO w_hist-Customer no-zero.
TRANSFER w_hist-Customer to filename.
ENDLOOP.
CLOSE DATASET filename.
if sy-subrc = 0.
write: 'OK'.
endif.
Thank you for help.
‎2013 Mar 11 2:18 PM
Hi,
Try using
TRANSFER w_hist to filename.
Also Comment WRITE w_hist-Customer TO w_hist-Customer no-zero.
just to test if above Transfer is working properly for time being..
Thanks,
Vikas.
‎2013 Apr 08 1:08 PM