sivasankari
8th August 2009, 14:28
Hi all,
Is there a possibility to search items, PO etc based on the text attached to them in Baan 4c.
Please let me know your inputs.
Regards,
Sivasankari
zacharyg
8th August 2009, 18:27
Hello sivasankari,
I can't speak on behalf of others, but your requirement is not clear to me.
For that reason it's difficult to provide you assistance.
So please elaborate on your objective? Are you attempting to search for the existance of some substring?
mark_h
10th August 2009, 16:25
What we do in some cases is write the item text to file, then read the file back in looking for a certain string, replace the string - then write the file back to the item text. I suppose in your case you could write the text to file, then scan it for the string. I think there is command that does that - I just can not recall what it is. If I get a chance I will look for it.
NPRao
10th August 2009, 20:35
I suppose in your case you could write the text to file, then scan it for the string. I think there is command that does that - I just can not recall what it is. If I get a chance I will look for it.
Refer to the links for the usage of 'pattern.in.file' function -
Removing Duplicate Data from Text file... (http://www.baanboard.com/baanboard/showthread.php?t=33557&highlight=pattern.in.file)
exchange (http://www.baanboard.com/baanboard/showthread.php?t=43904&highlight=pattern.in.file)
Maximum number of records to be inserted with 1 commit (http://www.baanboard.com/baanboard/showthread.php?t=14992&highlight=pattern.in.file)
sivasankari
12th August 2009, 14:56
Dear all,
Thanks for your inputs. I would like to know the way to filter items, Purchase Orders based on the text attached to them. Currently we can filter them based on the fields provided by default. In case I need to add text also to that, how do we do that ?
As anyone tried this before.
Thanks for your support.
Regards,
Sivasankari
norwim
12th August 2009, 18:00
Hi there,
as text in Baan is stored merely as a number which points to a table containing the texts (tttxt010 in Baan 4c),you can't specify a string to be searched for in a select statement.
There is another table (tttxt002 in Baan 4c) which contains searchkeys pointing to the textnumbers, but you have to check whether the textparts that you want to search for have been specified as key value here (in the program that did the insert).
If not, you'd have to read all records of the file you search in, read the text(s) attached to each and grep for the search string in it :-( not really practical, leave alone fast.
What I'd do in your situation would be
a)write a program in Baan that writes each text to a file in the form item:Text.
b)create a script that concatinates these files to one big textfile.
c)create a job that starts these 2 (a+b) to be run each night
d)The big textfile can be easily searched with 'grep', so from your Baansession you can call a simple script which returns all item numbers where the searchpattern was found.
Sounds more tricky than it is.
hth
Norbert
Hitesh Shah
13th August 2009, 07:36
IF searching items or PO is the only goal , tttxt1430m000 for the right kind of keyword 1 (say Item text G for item master general text) , can get u some quick search based on inclusion of certain string pattern in the text.
fosterjr
2nd September 2009, 05:46
If I understand correctly, you want to find all POs or Items that has text containing specific text (for example, any item that has text attached containing the word "pink").
If this is the case, you could do a search on tttxt010 for the particular substring, find the text number and then search the appropriate tables for that text number. I will warn you that this method will be very slow as it will result in full table scans unless you can work your way back through the keywords as Hitesh mentioned. I believe that the table tttxt130 has the keywords.
Hitesh Shah
2nd September 2009, 15:53
Advantage of search on tttxt010 will be that u will be able to use wild card characters using like operator (only through dynmic query ) . e.g. U can write case insensitive search for 'pink' as '.*[Pp][Ii][Nn][Kk].*' . This may not be the case while searching through tttxt1430m000 .