olanmalone
16th May 2006, 20:05
Hi,

I want to export data from baan but transform that data in one field based on a condition.
The condition would be someting like, if the substring of the field at position x = "y" then return the substring up to this position.

Do I need to add a new filed to the output Ascii file to contain the results of the function ?
Can I replace the current field (in its current position in the file (ie field 6) with the new value.

I have used exchange for exports but never with scripts so syntax would be realy helpful.

Any pointers welcome.

Thanks in advance,
O

mark_h
19th May 2006, 19:59
Well I have never used a condition script with export, but I am sure it is the same as import. Below is a sample import script, but I am sure I could use it in exporting.

table ttppdm600
table ttpcin045

domain tppdm.cprj ref.cprj

select tppdm600.agty
from tppdm600
where tppdm600._index1 = {:tpbcr901.cprj}
as set with 1 rows
selectdo
endselect

select tpcin045.cprj
from tpcin045
where tpcin045._index1 = {:tpbcr901.gcid,:tppdm600.agty}
as set with 1 rows
selectdo
endselect
ref.cprj = tpcin045.cprj

return(ref.cprj)

In your field relations you could place a field with a condition script. Then have that condition script return whatever string you want.

olanmalone
22nd May 2006, 11:22
Thanks Mark,

I give it a try.

Cheers,
Olan