Temp table populating problem

tjsingh

Member
Hi

I have a temp-table defined in my program. I am populating this using data from various tables.

But i have come across a problem which causes the record to be overwritten.

I have data such as below

qty vardesc order kdelref
144,000 20001111 Shower gel 456785e 712499
13,000 20001111 Shower gel 456785e 712499


we have data in our system which is similar to the above. As you can see the record is identical apart from the quantity. So when i run my program it only shows 13,000 quantity record.

How can i get around this so that both fields are in my temp table?

here is my temp table

define temp-table tt-Deln
field tt-iCount as int
field tt-qtymoved like ostkmove.qty-moved
field tt-custitem like ovar.kcust-item
field tt-vardesc like ovar.vardesc
field tt-order like ostkmove.korder
field tt-delref like odelnote.kdnref
field tt-calloff like jpcalloff.kcallref
index tt-delref as primary tt-order tt-vardesc.

cheers

tj
 
Are you sure that you are actually creating two diff records in the temp table.just try doing a for each tt-deln where tt-delref = "" :
message "safddf".
end.

Just see how many records are getting picked up.
 
only finds 1 record for the 13,000 quantity

just need to make it unique and not overwrite existing details as the details are the same
 
You have two solutions i think:

1. estabilish a primary key in your data
2. add a field used as a counter.. such as starting from 1 when u begin, and increasing it when u insert in your table..

If i do not misunderstood the problem, this may solve your trouble..
 
How to you create the records?

As the temp-table does not have a index that is unique then it should not be a problem having two records with same order and description.
So I believe that the problem is where you create the records.
 
Back
Top