Join Problem ?

make

Member
Hi,
i filled a temp-table(BuJo) with the following code.
I need the First bestpos..... line to fill the bujo.belegnr. This is OK
and works fine.
But the code fills only the bujo table when the first bestpos......
condition matches.
I want to have the rest of mytable also in the bujo table.
Where is my mistake ?.

For each mytable,
first bestpos where bestpos.bestkseq = integer(replace(mytable.belegnr,".","")) NO-LOCK:
create bujo.
bujo.buchung = mytable.buchung.
bujo.art = mytable.art.
bujo.Lieferant = mytable.lieferant.
bujo.artikel_nr = mytable.artikel_nr.
bujo.Datum = mytable.datum.
bujo.Belegnr = string(bestpos.bestnr).
bujo.Glas = mytable.glas.
bujo.Durchm = mytable.durchm.
bujo.Et = mytable.et.
bujo.Farbe = mytable.farbe.
bujo.Sphaere = mytable.sphaere.
bujo.Torus = mytable.torus.
bujo.Addition = mytable.addition.
bujo.Richtung = mytable.richtung.
bujo.stueck = mytable.stueck.
end.


thanks for your help.

Make
 
Hi Make,

if you change it like this:

for each mytable no-lock :

create bujo.
assign bujo.... (all fields except Belgnr).

find first bestpos where ... no-lock no-error.
if available bestpos then
assign bujo.Belegnr = string(bestpos.bestnr).

end.

Now for every mytable a bujo record is created and if a bestpos record is found belgnr is filled with string(bestpos.bestnr).

Hope this helps.
 
Top