pegaga1979
17th January 2019, 05:18
Hi Gurus,

I'm having issue when print inventory balance whereby, if the warehouse never has transactions, it follow data at above the line.
For example:
Item whse Qty
A W1 123
A W2 0
B W2 111

so result in report:
Item W1 W2
A 123 0
B 123 111

and my coding is:

select whwmd215.*
from whwmd215
where whwmd215.item=:tibom010.sitm

selectdo
if strip$(whwmd215.cwar) = "PHNRC" then
cwara.qhnd = whwmd215.qhnd

else if strip$(whwmd215.cwar) = "PHN01" then
cwarb.qhnd = whwmd215.qhnd

else if strip$(whwmd215.cwar) = "PHNCS" then
cwarc.qhnd = whwmd215.qhnd

endif
endif
endif

selectempty
if strip$(whwmd215.cwar) = "PHNRC" then
cwara.qhnd = "0"

else if strip$(whwmd215.cwar) = "PHN01" then
cwarb.qhnd = "0"

else if strip$(whwmd215.cwar) = "PHNCS" then
cwarc.qhnd = "0"

endif
endif
endif

endselect


Need your assistance where i'm doing wrong.
Your guidance is highly appreciated.

Thank you.

Ajesh
17th January 2019, 09:02
You haven't initialized cwar*.qhnd . Just before you enter the query initialize it

cwara.qhnd = 0
cwarb.qhnd = 0
cwarc.qhnd = 0

pegaga1979
21st January 2019, 02:43
You haven't initialized cwar*.qhnd . Just before you enter the query initialize it

cwara.qhnd = 0
cwarb.qhnd = 0
cwarc.qhnd = 0


Hi Ajesh,
Actually i have initialize it before program.

before.program:
cwarc.qhnd=0
cwara.qhnd=0
cwarb.qhnd=0


and yet the data is wrong. it not print as "0" but follow the number at above line because it not has any transaction at that warehouse.

pegaga1979
21st January 2019, 04:35
hi, now it is running ok.

i have put initialize at wrong section :)
I have amend and try put in section detail and it is working fine.

Thank you for the support and idea :)


detail.1:
before.layout:

cwarc.qhnd=0
cwara.qhnd=0
cwarb.qhnd=0