rohan_rege
11th July 2003, 21:49
hi ,

i have a exchange scheme to output PO Lines.

The problem i am facing is that , i got to export the first 30 characters of the Text field tdpur041.txta using the same exchange scheme.


simply putting a condition to select the field ..only returns the Text Number and not the actual text.

Is there a way to get this done.

can anyone guide me on this ?

rgds
rohan

lbencic
11th July 2003, 22:25
Hi Rohan

You can find a Baan standard Quick Guide on the support site for working with Text and Exchange called:

Exchange - Multi-line Text

Edited: That guide is for Import of text, you want export, sorry.

I beleive when you specify the text field, you may be having 'long' as the field type. It should be multi-line text and I think it will spit out the actual text, not the number. Does that work?

rohan_rege
11th July 2003, 23:49
Hi Lisa,

i tried using the MultiLine Text agianst the field in the exchange Scheme.

it does output the Text instead of the Number , but it gives the output in the following format .


100001~50~PLA117~200-02-5186~48.5~4~ea~0~0~0~~0~4~~~~~~~
{\{dsca 2
Parts Orders deliver to c/s Attn: Victor Escbar
}\}

since the {\{dsca 2 is not to be outputted , and also only the first 30 char of the string has to be outputted , i am not sure how to do it.

rgds
rohan

lbencic
12th July 2003, 00:50
Ya, that's the format it gives.

I don't have exact example, but probably you can make a string field length 30, and fill it using Condition Logic based on the tttxt010 table and the text number you have in hand. Find your language, line 1, and get the first 30 characters. Hopefully the text you are trying for has the first 30 characters all on one line 1, otherwise you will have to read multiple lines, etc.

Another solution is on the receiving side. If you are running this through another Baan system, this is the right way to do it as it is expecting the text in that very format. If you are bringing it into another program, you can parse it through there and get what you need using ascii parsing.

If you are directly sending to excel or some other program without programing available, you probably have to go to the text table.

tools123
12th July 2003, 03:06
Is it possible for you to read the field before hand and manipulate
using string.* commands? (str.*?)

estotz
12th July 2003, 05:49
If you have a string that you want to export the easiest way is with the multiline format as everyone has mentioned, but since you only want to output the first 30 characters of the string, you need to define the variable as character type and write a condition.

In the condition of the exchange script use the "TEXT.TO.BUF" function to convert the text to a character string and extract the first 30 bytes as required.

rohan_rege
14th July 2003, 19:42
Thanks to estotz and all !!!

The text.to.buf () function worked !


I just attached a condition to the field in the exchange scheme
Here is the code i used to get what i wanted :

#include <bic_text>

string dsca.array(30,1)

long ret

dsca.array(1,1) = ""

ret =text.to.buf("tdpur041.txta", "2" , 1 , dsca.array)

dsca.array(1,1) = shiftl$(shiftr$(dsca.array(1,1)))


return(dsca.array(1 ,1;30))


regards
Rohan Rege

P.S : Thanks for everyones help once again