fp10erpln
24th July 2015, 07:32
Hi,

I want to write an SQL Query:

Example: Sales Order in entered today with Item A.
Here Item A is a manufactured Item.
Now i want Item A along with its Multilevel BOM with quantity.

bhushanchanda
24th July 2015, 08:33
Hi,

You will need to write the logic in your Report Script in your detail.layout section.

Main Query will be something like this -

select tdsls401.item,
tdsls401.odat,
from tdsls401,tcibd001
where tdsls401.odat inrange :tdsls401.odat.f and :tdsls401.odat.t
and tdsls401._index9 refers to tcibd001
and tcibd001.kitm = tckitm.manufacture


Now, you can add after.layout for your field tdsls401.item in your report layout with print condtion as print.lay = true and write -
In your report script-

declaration:
table ttibom010
extern domain tcbool print.lay

detail.1:
after.layout:
select tibom010.*
from tibom010
where tibom010._index1 = :tdsls401.item
selectdo
print.lay = true
r.s.after.detail.1()
print.lay = false
endselect

Make sure you make the field tdsls401.item as presorted in the layout.

Note, its not tested so you might need some corrections.

smusba
14th August 2015, 13:52
What is this function Bhushan?

bhushanchanda
14th August 2015, 14:17
Hi,

As said, it was not tested.

Here's an example.

Thread (http://www.baanboard.com/baanboard/showthread.php?t=68016)

JaapJD
14th August 2015, 14:23
I would recommend not to use this internal (generated) function. Use layout.again() instead. See report script of report tdsls440101000 for examples how to use it.

bhushanchanda
14th August 2015, 14:32
I would recommend not to use this internal (generated) function. Use layout.again() instead. See report script of report tdsls440101000 for examples how to use it.

Correct. Please follow the link which shows a solution handled using layout.again()