View Single Post
Old 9th October 2017, 11:05
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Join Date: Sep 2012
Location: India
Posts: 2,365
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Please do not create new threads if one already exists. As already said and confirmed by Jaap, seq.puts() will add new line character automatically. You just need to pass the string you want to write to the file.

e.g. Lets write item code and description from tcibd001 to a file.

string filename(100)
long fp
string str(100)

filename = creat.tmp.file$( bse.tmp.dir$() ) |# Create temp file
fp =,"w+")                    |# Open temp file

select tcibd001.item, tcibd001.dsca
from tcibd001
         str = tcibd001.item & "," & tcibd001.dsca |# Item Code , Description
         seq.puts(str,fp)                                   |# Write to file

seq.close(fp)         |# Close file

This should create and write the item code and description with comma separator the the output file in bse\temp directory. Each item will be written to a new line.


Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote