SLChen
17th June 2004, 11:50
I wrote a report with report script.That report print the inventory of a warehouse.
I have encountered this issue twice.
1.When I find the following data in tdinv001: item 000-0016,000-0017,000-0018,and I print the report I writed with sql query with report scripts,the system results in lost connection with bshell.
2.When I maintain report layout,entering “output expression” which is “tdinv001.stoc <>0 “,item 000-0019 too has a problem.
But when I add a statement into the report scripts,the system just occurs the error on item 000-0016,000-0017,000-0018.Why??

To the first situation,i Noted:the item(000-0016,000-0017,000-0018) 's inventory unit(tiitm001.cuni:pcs) is different from its purchase unit(tiitm001.cupp:set).

the report script is:
|*********************************************************
|* tdsqlslchenkuc VRC 3.1O b huss
|* print the current stoc
|* bsp
|* 04-05-27 [11:17]
|*********************************************************
declaration:
extern domain tcamnt e_factor
detail.1:
before.layout:
if tiitm001.cupp <> tiitm001.cuni then
select tiitm003.conv:e_factor
from tiitm003
where tiitm003.item=:tdinv001.item and tiitm003.cuni="pcs"
selectdo
factor=e_factor
endselect
else
factor=1
endif
if tdinv001.stoc=0 then
lattr.print = false
endif
|*******the end of the script.***************

Pls see the where clause,
where tiitm003.item=:tdinv001.item and tiitm003.cuni="pcs" (i write 'tiitm003.cuni="pcs" because the majority of our items has its purchase unit and purchase price unit which is pcs),
but when i change it to :where tiitm003.item=:tdinv001.item and tiitm003.cuni=:tiitm001.cupp,the report works fine.
So,I guess the "lost connection with bshell' is a database error.this error result from not correct sql statement or any others.

But to the second situation,I havenot given a proper explanation.