mmurphy2650
7th July 2011, 21:10
Hi Everyone,

The following code in Text Manager of the Query Data session (ttadv3580m00) generates a report for a range of Shipment Dates and a range of Items.

The field whinh431.item has a domain of tcitem, which is a segmented domain of Project Number (9 characters) and Item Number (38 characters).

Does anyone know how to reference the Item Number segment by itself?

I can change the code of
whinh431.item >= whinh431.item.f and
whinh431.item <= whinh431.item.t
to, for example,
whinh431.item(10;38) >= "0127757010" and
whinh431.item(10;38) <= "0500000010"
and it works ... but I want the user prompted for a range of Items without the Project Number segment.

I was thinking that I might be able to use something like:
whinh431.item >= whinh431.item.segment.2.f and
whinh431.item <= whinh431.item.segment.2.t
but that does not work.

select
whinh431.shpm, | Shipment
whinh431.pono, | Shipment Line
whinh431.item, | Item
tcibd001.dsca, | Item Description
whinh430.sdtt, | Shipment Date To
whinh431.qshp, | Quantity Shipped in Inventory Unit
whinh431.worg, | Order Origin
whinh431.worn, | Order
whinh430.stco, | Ship-to Code
tccom100.nama | BP Name
from
whinh430, | Shipments
whinh431, | Shipment Lines
tcibd001, | Items - General
tccom100 | Business Partners
where
whinh430.sdtt >= whinh430.sdtt.f and
whinh430.sdtt <= whinh430.sdtt.t and
whinh431.item >= whinh431.item.f and
whinh431.item <= whinh431.item.t and
whinh430.shpm = whinh431.shpm and
whinh431.item = tcibd001.item and
whinh430.stco = tccom100.bpid

Thanks,

Mike

bdittmar
7th July 2011, 21:32
Hi Everyone,

The following code in Text Manager of the Query Data session (ttadv3580m00) generates a report for a range of Shipment Dates and a range of Items.

The field whinh431.item has a domain of tcitem, which is a segmented domain of Project Number (9 characters) and Item Number (38 characters).

Does anyone know how to reference the Item Number segment by itself?

I can change the code of
whinh431.item >= whinh431.item.f and
whinh431.item <= whinh431.item.t
to, for example,
whinh431.item(10;38) >= "0127757010" and
whinh431.item(10;38) <= "0500000010"
and it works ... but I want the user prompted for a range of Items without the Project Number segment.

I was thinking that I might be able to use something like:
whinh431.item >= whinh431.item.segment.2.f and
whinh431.item <= whinh431.item.segment.2.t
but that does not work.

select
whinh431.shpm, | Shipment
whinh431.pono, | Shipment Line
whinh431.item, | Item
tcibd001.dsca, | Item Description
whinh430.sdtt, | Shipment Date To
whinh431.qshp, | Quantity Shipped in Inventory Unit
whinh431.worg, | Order Origin
whinh431.worn, | Order
whinh430.stco, | Ship-to Code
tccom100.nama | BP Name
from
whinh430, | Shipments
whinh431, | Shipment Lines
tcibd001, | Items - General
tccom100 | Business Partners
where
whinh430.sdtt >= whinh430.sdtt.f and
whinh430.sdtt <= whinh430.sdtt.t and
whinh431.item >= whinh431.item.f and
whinh431.item <= whinh431.item.t and
whinh430.shpm = whinh431.shpm and
whinh431.item = tcibd001.item and
whinh430.stco = tccom100.bpid

Thanks,

Mike

Hello Mike,

Try wherebind :

item.f and item.t are the form fields with domain tcitem (Segmented)

select ......
from ........
where whinh431._index1 inrange {:1 & :2}
and {:3 & :4}
and .... some additional if needed ......
wherebind (1, " ")
wherebind (2, item.f(10;38)
wherebind (3, " ")
wherebind (4, item.t(10;38)
selectdo .............

Regards

mark_h
7th July 2011, 23:53
Hello Mike,

Try wherebind :

item.f and item.t are the form fields with domain tcitem (Segmented)

select ......
from ........
where whinh431._index1 inrange {:1 & :2}
and {:3 & :4}
and .... some additional if needed ......
wherebind (1, " ")
wherebind (2, item.f(10;38)
wherebind (3, " ")
wherebind (4, item.t(10;38)
selectdo .............

Regards

I believe he is asking about easy sql and I am not sure where bind works in easy sql. Never really tried that.

mark_h
7th July 2011, 23:56
Shot in the dark - would whinh431.item.2.f work? The only reason I ask is I seem to recall something about that in the function server forum. I will do a quick search.

mark_h
8th July 2011, 00:01
Never mind it was whinh431.item.segment.2.f, but another WAG would be to try whinh431.item >= whinh431.item.f.segment.2.

mmurphy2650
8th July 2011, 13:36
Bernd and Mark,

Thanks for your suggestions.

I am using Easy SQL and Text Manager to generate the report and have tried a bunch of WAGs to get the range of Item Number segments only to display on the form. I'll try a few more ...

If that doesn't work, I'll customize a session to get what I need.

Thanks,

Mike