rendy@ecnet.com
5th August 2015, 07:21
Hi All,

This is my first time posting in this thread, so i'd like to apologize if my english is not good.
I would like to insert BOM components in the standard report of Purchase Order,
So i do write :

detail.10:
before.layout:

select tibom010.sitm:item.comp
from tibom010
where tibom010.mitm = {:tdpur401.item}
selectdo
endselect

and I insert item.comp in the detail field of the report layout.
But, the report only show 1 BOM component (RESIN) and actually there 2 BOM Components which are : RESIN and RESIN1.
I need to print both of those Components in the PO report.
Really appreciate your help.
Thanks in advance.

Best regards,
Rendy

mark_h
5th August 2015, 14:56
There are probably several ways to handle this - you could just add a text field long enough to hold the two components, but then it would not work for three or 4 components. So what I would probably do is add another layout - lets call it detail.11. Add the component on that layout. Then you could use the command layout.again to print all of the items. Search on layout.again I am sure there are better examples on the board than what I could come up. But basically you find the total count of items to be printed and then keep using layout.again until you printed them all.
Something like this:

detail.10:
before.layout:
select count(tibom010.sitm):total.items
from tibom010
where tibom010.mitm = {:tdpur401.item}
selectdo
endselect
printed.items = 0
hold.seq = 0

detail.11:
before.layout:
select tibom010.sitm:item.comp, tibom010.pono
from tibom010
where tibom010.mitm = {:tdpur401.item}
and tibom010.pono>:hold.seq
as set with 1 rows
selectdo
printed.items = printed.items +1
hold.seq = tibom010.pono
endselect
after.layout:
if printed.items<total.items then
layout.again()
endif

rendy@ecnet.com
6th August 2015, 05:02
Dear Mark,

It's work !!!
Thank you so much for your help.
:)

Best regards,
Rendy

bdittmar
6th August 2015, 13:03
Hello,
as Mark suggested,
use a seperate layout.
But what's with not valid bom positions ?
Extend your/Marks logic with the check of effectivity date.

Regards