Muhammad Ali
19th March 2008, 09:11
help....

when i run session read.main.table() it is not working, kindly help, see below script

thanks

Ali


declaration:

table ttdlra010 | IDno Data
table ttiitm001 |Item Master

| extern domain tdlra.leno leno.f
| extern domain tdlra.leno leno.t

extern domain tcdsca path,m.path

string txt_string1(100)
long fp1

string txt_string2(100)
long fp2

|****************************** form section **********************************

form.1:
init.form:
get.screen.defaults()

|****************************** choice section ********************************

choice.cont.process:
on.choice:
execute(print.data)

choice.print.data:
on.choice:
|if rprt_open() then

read.main.table()
message("Text File Is Ready.......")

| rprt_close()
| else
| choice.again()
| endif


|****************************** field section *********************************

| field.path:
| when.field.changes:
| path = path

|****************************** function section ******************************

functions:

function read.main.table()
{

|************************** Data Retrive From IDno

m.path=path&"tdlra010.txt"
message("test...... %s",m.path)
| fp1=seq.open("d:\baan4\phyinv\tdlra010.txt","w")
fp1=seq.open(m.path,"w")
select tdlra010.leno,tdlra010.item,tiitm001.cuni,tdlra010.stoc
from tdlra010, tiitm001
where tdlra010.item=tiitm001.item
order by tdlra010.leno
selectdo

txt_string1=str$(tdlra010.leno)&"|"&tdlra010.item&"|"&tiitm001.cuni&"|"&str$(tdlra010.stoc)&chr$(13)

seq.puts(txt_string1,fp1)

endselect

seq.close(fp1)

|************************** Data Retrive From Item Master
m.path=" "
m.path=path&"tiitm001.txt"
fp2=seq.open(m.path,"w")

select tiitm001.item,tiitm001.dsca,tiitm001.cuni,tiitm001.citg
from tiitm001
order by tiitm001.item

selectdo

txt_string2=tiitm001.item&"|"&tiitm001.dsca&"|"&tiitm001.cuni&"|"&tiitm001.citg&chr$(13)
seq.puts(txt_string2,fp2)

endselect
seq.close(fp2)
}

grzegorz
19th March 2008, 10:29
What's exactly wrong with read.main.table? A I understood, you press <continue> and nothing happens. If that's the problem, then check your form standard options. Options 23 (print) and 38 (continue) should be marked. Check also your session type, should be "Print" in your case.
BTW, I think you don't have to add chr$(13) at the end of your lines, function seq.puts does it for you.

csecgn
19th March 2008, 23:20
Do you have a report in your session? Which report is not important, it you just has been anyone defined. If not print.data will not be executed.
Or call your read.main.table() from cont.process directly.

hth

Regards
Christof