bkkland
24th January 2006, 20:02
By using Exchange, can I import data by using existing data from other tables? How can I link the field that need to be update to another field from other table? Is it related to "Condition" that I have to write a script? :confused:


Please advise...THANK YOU~~~

gfasbender
25th January 2006, 19:52
Here's an example of an import field condition for a field called year that checks and returns data from a table based on another fields data (date):

table ttpppc001 |hours control period
long tdate

if year = 0 then
tdate = format.to.date(default.datef, int(date))
select tpppc001.*
from tpppc001
where tpppc001._index2 <= {:tdate}
order by tpppc001._index1 desc
as set with 1 rows
selectdo
return(tpppc001.year)
endselect
endif
return(year)

bkkland
26th January 2006, 23:41
**This is what I have....


table ttiitm001

select tiitm001.citg
from tiitm001
where tiitm001.item = item
selectdo
citg = tiitm001.citg
endselect
return(citg)


However, when I'm trying to import data. I have three tables in one batch (tdsls040, tdsls041 and tdsls045)

1. tdsls040 data is populated.

2. tdsls041 it's not working. When the import data is running for this batch line, it doesn't go any where...notthing being read but still giving you the hour glass...that means still running, correct? I wait for 3 minutes and nothing change until I have to click "exit" to close the window. When I checked the log file, only tdsls040 exists with record read and processed.
I thought it may be the "condition" so I took it out, but I still get the same result.
I defined the same thing for the sales order number.


3. tdsls045 it's never started because of #2.

Please advise what I'm doing wrong, what I'm I missing here.... :o :confused:


THANK YOU!!!!!!!!!!!!!!!

bkkland
27th January 2006, 18:21
I changed my coding but still not working....

table ttiitm001

if item = tiitm001.item then

select tiitm001.citg
from tiitm001
selectdo
citg = tiitm001.citg
return(citg)
endselect

endif

return(citg)

I'm not sure I have to wait longer because the table tiitm001 is big or it should not be a matter.

Please advise....THANK YOU~~~THANK YOU!!!

:o :(

mark_h
27th January 2006, 19:29
First have you declared item as a parameter? Second I would expect you condition code to look something like this:

table ttiitm001

select tiitm001.citg
from tiitm001
where tiitm001.item = :item
selectdo
return(tiitm001.citg)
selectempty
returm("")
endselect
return("")

Notice the ":" in front of the parameter item. Also depending on how item is loaded you may have to do something like this:

table ttiitm001
domain tcitem someitem

someitem = shiftl$(item)

select tiitm001.citg
from tiitm001
where tiitm001.item = :someitem
selectdo
return(tiitm001.citg)
selectempty
returm("")
endselect
return("")

These are just rough examples. Have you compiled it in debug mode? Make sure the item parameter actually is being pulled in.

bkkland
27th January 2006, 21:22
It's working now. BINGO!!!!!!!!!!!!!!!!!!!!!!!!!!!! :D

THANKS!!!