try this
Upload the file into an internal table, and then use the below lines to upload
OPEN DATASET gv_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc EQ 0.
LOOP AT gt_final INTO gs_final.
TRANSFER gs_final-tline TO gv_file.
CLEAR gs_final.
ENDLOOP.
ELSE.
"Error Message
ENDIF.
CLOSE DATASET gv_file.
Thanks
Rajesh