fdeivis
25th May 2012, 22:27
Hi,
Im trying to create baan txt from source, cause, im doing some kind of background process, that its creating purchases orders... and i need to creater txt for that purchase order, but its not working good. i created in tttxt010 /tttxt001 and tttxt002.... is there any other table that i have to insert this txt?
zardoz
28th May 2012, 12:04
Why to write directly in txt tables, when there are functions that add the text in correct way in the tttxt tables, from a ascii sequential file.
Look in the manual at the function:
text.write()
This function fills all the right txt tables.
mark_h
29th May 2012, 19:49
I agree with zardoz, but you can use one of the print tables sessions to get a list of the text tables. I know there is another one that needs to be updated, I just can't remember which one - maybe tttxt030(it seems to stick in my mind for some reason). You can check each of the tables to figure out which one.
ashu2814
4th June 2012, 09:22
Hi, You can check below code to write text to item -purchase table.
l.item = item
text.line = text to be written
this code will work for add and append multiple line text also.
l.item = " " & trim$(l.item)
text.line = ">" & trim$(text.line)
l.tmp.file3 = creat.tmp.file$(bse.tmp.dir$())
l.tmp.file2 = creat.tmp.file$(bse.tmp.dir$())
l.fp3 = seq.open( l.tmp.file3, "w" )
select tdipu001.txtp
from tdipu001
where tdipu001._index1 = {:l.item}
as set with 1 rows
selectdo
if tdipu001.txtp <> 0 then
g.ret = text.read("tdipu001.txtp", "2", kw1,kw2, kw3, kw4,l.tgroup, l.edit.opt,l.tmp.file2,0)
endif
l.fp2 = seq.open( l.tmp.file2, "r" )
while(seq.gets(l.line1,1000,l.fp2) = 0)
seq.puts(trim$(l.line1),l.fp3)
endwhile
seq.close(l.fp2)
endselect
seq.puts(trim$(text.line),l.fp3)
seq.close(l.fp3)
select tdipu001.txtp
from tdipu001 for update
where tdipu001._index1 = {:l.item}
as set with 1 rows
selectdo
db.retry.point()
if tdipu001.txtp <> 0 then
g.ret = text.rewrite("tdipu001.txtp", "2", "",
"", "", "", l.tgroup, l.edit.opt,
l.tmp.file3)
else
g.ret = text.write("tdipu001.txtp", "2", "",
"", "", "", l.tgroup, l.edit.opt,
l.tmp.file3)
endif
db.update(ttdipu001, db.retry)
commit.transaction()
endselect
Regards,