REETA1967
25th February 2003, 18:36
returing too many rows

hi,

i have to create a report which should contain the following details

cust_name project/sales order no position cust_item deli_qty sfc_orno1 stock1 sfc_orno2 stock2


here we are taking project no as sales order no.
we are generating production order no through PRP engine
Problem what i am facing is
i am not able to find out the relationship between sales orderno & position
no. (tdsls041) with sfc

here is novice's script

this should give only 21 records but displaying 63 records

thanx in advance

fosterjr
25th February 2003, 19:06
I would start by cleaning up the queries a little bit. In your function read.main.table() you have commented out tipcs020.cprj; however, you still have a reference listed in your where clause. Also a reference statement uses the following format: Table.field refers to table. You have table.field refers to table.field.

You don't have anything calling "get.item.stock" yet.

I would also include tdsls041.item in your index for get.item.stock.
Depending on how get.item.stock is called you could have multiple records returned from tipcs021.

Originally posted by REETA1967
returing too many rows

hi,

i have to create a report which should contain the following details

cust_name project/sales order no position cust_item deli_qty sfc_orno1 stock1 sfc_orno2 stock2


here we are taking project no as sales order no.
we are generating production order no through PRP engine
Problem what i am facing is
i am not able to find out the relationship between sales orderno & position
no. (tdsls041) with sfc

here is novice's script

this should give only 21 records but displaying 63 records

thanx in advance

REETA1967
26th February 2003, 04:48
i was trying diff combination , due to this function name was erased
i am sending the correct file

thanx

fosterjr
26th February 2003, 16:14
I think you may have to debug and step through the sql statements to track, but it seems that one of your sql calls is causing the multiple records. I don't think tdsls041 is the problem though.

I have attached a modified try1.txt My main concern was that you had included tipcs020 to pull the project number. However, you already have the project number in tdsls041.cprj and tdsls041.cprj is the field that you use for get.item.stock.

Originally posted by REETA1967
i was trying diff combination , due to this function name was erased
i am sending the correct file

thanx

kammie
27th February 2003, 15:26
Within function get.item.stock(), you are using only the projectcode to select the data; I suppose you should use also the itemcode here.

To me, the where clause in function get.item.stock() should be:

where tipcs021._index1 = {:tdsls041.cprj, :tdsls041.item }
and tipcs021.kitm = tcpuma.manufacture

fosterjr
27th February 2003, 16:17
I agree.

Originally posted by kammie
Within function get.item.stock(), you are using only the projectcode to select the data; I suppose you should use also the itemcode here.

To me, the where clause in function get.item.stock() should be:

where tipcs021._index1 = {:tdsls041.cprj, :tdsls041.item }
and tipcs021.kitm = tcpuma.manufacture

askajale
28th February 2003, 03:59
Another doubt is

Does all your Sales Order Items are Customised items? Or some sales orders are for normal items as well (Non Project code) which can result into wrong results as well.

-- Avinash