mig28mx
12th February 2009, 19:20
Hello all,
It is possible to display items that belongs to different companies?
I´m developing a display session with the following data:
Company Item Stock
100 abcde 1
200 abcde 2
I was tried with, query extension on before program,
I was unable to display more than 1 company data.
I will appreciate any suggestion.
Thanks
zardoz
12th February 2009, 22:42
A report using display as device is a good solution. The display session cannot read different companies data...
Another solution (a little bit tricky, but it works) is to create a table containing the company number, the item code and other data you want to display, clear that table in the before.program section and load it by reading the data from different companies and then (finally) display the results.
mig28mx
13th February 2009, 00:23
Hello Zardoz,
Thank you very much for your input.
Yes your solution is ok.
Thank you in advance.
NirajKakodkar
13th February 2009, 05:44
Hello ,
We had a similar requirement .
The requirement was to create a display session to display the data of all the companies linked to a package comabination .
The code below worked for me in Baan 4C4 .
Hope it helps you .
|******************************************************************************
|* tiitm9501 0 VRC B40C c4 migr
|* Display Items
|* Niraj Kakodkar
|* 2008-09-28
|******************************************************************************
|* Main table tiitm001 Items, Form Type 2
|******************************************************************************
|*
|******************************************************************************
|****************************** declaration section ***************************
declaration:
table ttiitm001 | Items
table tttaad100 | Companies
domain ttaad.pacc tpac
domain ttaad.comp tcmp
extern domain tcmcs.str3 compn
extern domain tcitem o.item
extern domain tcdsca o.dsca
long comp_array(100)
long i
string q.string(2048)
#define TNAME "tiitm001"
#define COMP "._compnr"
#define EQUAL " = "
#define ORA " OR "
|****************************** form section **********************************
before.program:
tpac = curr.pacc$
get.companies()
create.query.string(i)
query.extension = q.string
|******************************************************************************
functions:
function get.companies()
{
i = 1
select ttaad100.comp
from ttaad100
where ttaad100._index2 = {:tpac}
and ttaad100._compnr = 0
selectdo
comp_array(i) = ttaad100.comp
i = i + 1
endselect
i = i - 1
}
function create.query.string(long i)
{
q.string = ""
while (i)
if isspace(q.string) then
q.string = ""
else
q.string = q.string & ORA
endif
q.string = q.string & TNAME & COMP & EQUAL & str$(comp_array(i))
i = i - 1
endwhile
q.string = strip$(q.string)
}
Any one have tried this in LN ?
Regards,
Niraj