dromeo
28th August 2016, 21:35
Hi,

I hope that you can help me on the following. I'm working with INFOR 10.4 and I'm customizing a report (Inventory Transactions by Order) and adding a table (whltc100 - Items Lot) in order to read other information: Lot from Supplier & Certificate Code.

On the Report I added a script:

|******************************************************************************
|* whinr140001200
|* Inventory Transactions by Order
|******************************************************************************

|****************************** declaration section ***************************

declaration:

table t whltc100

before.program:
import("whltc100.clot",whinr100.clot)
import("whltc100.item",whinr100.item)

detail.1:
before.layout:

select DISTINCT whltc100.cert,
whltc100.ltbp
from whltc100
where whltc100.clot = {:whinr100.clot}
and whltc100.item = {:whinr100.item}
| GROUP BY whltc100.cert, whltc100.ltbp
| as set with 1 rows
selectdo
on.change.check(whinr100.clot) | this is a function I read on this FORUM
endselect


The problem is that when I run the report I get the first 3 rows duplicated (as shown in the picture). I tried almost everything I know: DISTINCT, GROUP BY, after the selectdo I gave a value to the variables, but nothing seems to work. It keeps showing me the first 3 rows duplicated.

How I could avoid this. I'm new in BAAN/INFOR programming so any advice is really much appreciated.

Thank you very much!!!

mark_h
29th August 2016, 14:47
It is not the report code causing the issue. The way I read this you have 3 transactions being passed to the report for that position. So those three transactions are what is causing that code to be called three times. The detail.1 before layout gets run for each detail record passed to the report. So that is not the issue. If you want only one detail record then you need to look at the main session itself. In this case looking at what fields I can see you might not want that - but you can decide on that.

dromeo
29th August 2016, 17:44
It is note the report code causing the issue. The way I read this you have 3 transactions being passed to the report for that position. So those three transactions are what is causing that code to be called three times. The detail.1 before layout gets run for each detail record passed to the report. So that is not the issue. If you want only one detail record then you need to look at the main session itself. In this case looking at what fields I can see you might not want that - but you can decide on that.

Hello Mark!

Thank you very much for your reply... I did some analysis and you're right! It's not the report code as I thought before. The system is creating 3 transactions because of the serial number of the END ITEM. The comparaison could be made with the session from Infor (in the picture) with the same Work Order and without the Serial Numbers only the Lots. The problem is that this Serial Number, although is received in WhS (being the SN for the END ITEM), is not possible that is being Issued for the Item itself...so it's ok to have a receipt but not an Issue.

Thank you very much!

Daniel Romeo