gettoritesh
14th June 2005, 07:40
Hi,
I am using Baan IV we have different logistic companies 920,930,940,etc...
I want to access the sales data ( or any other data) from 940 Company for all the companies...
PLz help me out to reslove this issue...
Thanks
Ritesh
beginer
14th June 2005, 07:52
Hi,
U can select the companies by setting the compnr as follows :-
Assuming u r running from 940 Company :-
select tdsls045.*
from tdsls045
where tdsls045._index1 inrange {:orno.f} and {:orno.t}
and tdsls045._compnr = 930
selectdo
endselect
This will fetch u the data from 930 company.
Another alternative is using switch to company()
Pass the company no. that u want to switch to in this function.
All the tables selected after this will fetch data from the new company & will continue in same comapy unless it is switched back to the original ( For that instance)
suribaan
14th June 2005, 23:39
If you have the group company you can select the list of companies and loop throught the records in each companies..
select tccom000.ncmp
from tccom000
where tccom000._compnr = {:gcmp}
selectdo
select tdsls045.*
from tdsls045
where tdsls045._index1 inrange {:orno.f} and {:orno.t}
and tdsls045._compnr = {:tccom000.ncmp}
selectdo
endselect
endselect