Skip to Content
0
Former Member
Jul 31, 2008 at 07:42 PM

unaccessable variables

11 Views

Hi all,

I have a problem with the following code. If I hard code the variable orig_qty to 37 the variables caja1, caja2 and caja3 will be set and i can insert them in three different formulas like:

numberVar caja2 ;

caja2

but if i set the variable orig_qty to the sum of the columns the variables are not accesible in other formulas like above.

Is there any restrictions on how to use these table columns?

Any help will be appreciated.

Rolando

numberVar orig_qty := Sum ({OUTORDDTL.QTY_ALLOC}, {OUTORDDTL.ORD_NUM})

// numberVar orig_qty := 37;

numberVar caja1 := 0;

numberVar caja2 := 0;

numberVar caja3 := 0;

while orig_qty > 8 do

(

if orig_qty >= 14 then

caja1 := caja1 + truncate (orig_qty/14)

else

caja1 := caja1 + 1;

orig_qty := orig_qty - (caja1*14);

);

while orig_qty > 3 do

(

if orig_qty >= 8 then

caja2 := caja2 + truncate (orig_qty/8)

else

caja2 := caja2 + 1;

orig_qty := orig_qty - (caja2*8);

);

if orig_qty > 0 then

caja3 := 1;

caja1;