ltannous
29th September 2004, 20:58
I have a multi-occ + view+main session, and I want to view total inventory by warehouse.
I need the display to show the warehouse if the inventory is greater then 0
The diplay is now only showing the last warehouse found in tdilc001.
How can I write this display option?
The form IS NOT a horizontal form.

mark_h
29th September 2004, 23:50
I guess you could always call a quick function to check the quantity in the warehouse and if it is zero just execute the next.set option. If the main key field on the form is warehouse you could probably do this in the before.display section. Just the first thought that popped into my head - wow! two of these today.

Mark

maxime
30th September 2004, 06:55
Hi,

I am not familiar with the Baan IV table structure of that table tdilc001. Can you send that to me?

Maxime.

Hitesh Shah
30th September 2004, 10:14
The main table should either be tdilc101 or tdinv001 (not tdilc001). Depending on the
main table write query extension with stock on hand in the table.

Horizontal / vertical form should not make any difference.

ltannous
30th September 2004, 16:51
I tried to create this using tdinv001, but the field just repeats with the same warehouse number.

My session is not based on the ilc or inv tables, I just need to get data from these tables.
I created the following:

field.war:
before.display:
get.warehouse()


functions:

function get.warehouse()
{
select tdinv001.*
from tdinv001
where tdinv001.item = :timrp943.item
and tdinv001.stoc > 0
order by tdinv001._index2
selectdo
endselect
war = tdinv001.cwar
}

mark_h
30th September 2004, 17:37
From what you describe and what I am lead to believe from your code you do not have warehouse as part of the key for the maintable - just item. I would expect warehouse to already be populated and used in the get.warehouse() select. Is item the only field you have?

Mark

Hitesh Shah
1st October 2004, 07:40
Understand u wish to display the 1st warehouse with inventory. Use the following code.

field.war:
before.display:
get.warehouse()


functions:

function get.warehouse()
{
select tdinv001.*
from tdinv001
where tdinv001._index2 = {:timrp943.item}
and tdinv001.stoc > 0
as set with 1 rows
selectdo
war = tdinv001.cwar
selectempty
war = ""
endselect
}


If u want highest inventory then do the order by tdinv001.stoc desc .

ltannous
1st October 2004, 16:37
I want to display all the warehoues, and the total inventory in each ware house.
When I make the form field a multi-occurance, it just repeats the last warehouse with inventory greater than 0.
Is it possible to have my war value displayed multiple times on my screen to show all values:
This is what I hope to end up with

(warehouse)
(Inventory)

300 500 800
2000 2300 8900

Sorry if I have not made my self clear. Hopefully this helps

Hitesh Shah
1st October 2004, 16:55
Don't know the main table for this session. With tdinv001 as main table , code can be very simple . Assuming any other table to be main table , following code should work for this vertical multi-occ session.



domain tccwar hold.cwar
field.war:
before.display:
if actual.occ = 1 then
hold.cwar = ""
endif
get.warehouse()


functions:

function get.warehouse()
{
select tdinv001.*
from tdinv001
where tdinv001._index2 = {:timrp943.item}
and tdinv001.stoc > 0
and tdinv001.cwar > :hold.cwar
as set with 1 rows
selectdo
war = tdinv001.cwar
hold.cwar =war
selectempty
war = ""
tdinv001.cwar = 0
endselect
}

Hitesh Shah
1st October 2004, 19:11
This time the code will not work properly if there is no 1-1 or many - 1 correspondence between main table and tdinv001 (which i feel is not the case).

In such case u can either create an interactive session like tdsls4102s000 or create a subsession.

ltannous
1st October 2004, 21:21
Is it possible to get the tdinv001.stoc value now??
I tried this and it seems to work, however, the field displays the warehouse with inventories and after that displays zeros for every occurance on the screen

Exaple:

Warehouse 300 500
Inventory 1200 6000 0.000 0.000 0.000 0.000

How can I not show the 0.000

Hitesh Shah
2nd October 2004, 08:00
Dont know the relationship of ur main table and tdinv001 . If there is undefined or unpredictable relationship, then it will not come properly.

U can suppress 0 with following code


tdinv001.stoc:
after.display:
if tdinv001.stoc = 0 then
print.const(" ")
endif

ltannous
3rd October 2004, 06:48
Thanks again