litrax
17th February 2009, 18:20
Can anyone help me with a problem concerning baan exchange?
I want to export some text fields but do NOT want to use the multiline text option of exchange. Cause in this functionality the text is exported like this:
field1|field2|field3
{\{txta 2
Common itemtext line 1
Common itemtext line 2
Common itemtext line 3
Common itemtext line 4
}\}

But I want to export it like this:
field1|field2|field3|Common itemtext line 1|Common itemtext line 2|Common itemtext line 3|Common itemtext line 4
Does anyone have a solution for this?

Thanks
Litrax

vinceco252
17th February 2009, 19:52
In theory you could write a condition script to return the actual text from tttxt010 based on the text number in the primary table you are exporting.

Vince

litrax
18th February 2009, 09:01
I have solved the problem in the following way:

Set the ASCII File Field to Alphanumeric. In the Field Relations (Export) I inserted this field with the following Condition Script:



#define DIM1 10
#define TRIM(...) shiftl$(strip$(...))

#include <bic_text>

domain tcmcs.long nr.lines
string text_arr_en(30, DIM1)
string text_arr_de(30, DIM1)
domain tcmcs.s999m text_line
long i

nr.lines = 0
i = 0

for i = 1 to DIM1
text_arr_en(1,i) = ""
endfor
for i = 1 to DIM1
text_arr_de(1,i) = ""
endfor

text_line = ""
i = 0

select tdipu001.txtp
from tdipu001
where tdipu001._index1 = {:tcibd001.item}
selectdo
nr.lines = text.to.buf("tdipu001.txtp", "2", DIM1, text_arr_en)
nr.lines = text.to.buf("tdipu001.txtp", "3", DIM1, text_arr_de)
endselect

text_line = concat$( "|", TRIM(text_arr_en(1,1)),
TRIM(text_arr_en(1,2)),
TRIM(text_arr_en(1,3)),
TRIM(text_arr_en(1,4)),
TRIM(text_arr_en(1,5)),
TRIM(text_arr_en(1,6)),
TRIM(text_arr_en(1,7)),
TRIM(text_arr_en(1,8)),
TRIM(text_arr_en(1,9)),
TRIM(text_arr_en(1,10)),
TRIM(text_arr_de(1,1)),
TRIM(text_arr_de(1,2)),
TRIM(text_arr_de(1,3)),
TRIM(text_arr_de(1,4)),
TRIM(text_arr_de(1,5)),
TRIM(text_arr_de(1,6)),
TRIM(text_arr_de(1,7)),
TRIM(text_arr_de(1,8)),
TRIM(text_arr_de(1,9)),
TRIM(text_arr_de(1,10)) )

return(text_line)