flebon
7th March 2013, 09:14
I have a text attached to a replanishement order.
The text is containing a string, which is a reference to a sales order.
I would like to search all replanishment orders which are containing a particular string in text field (a particular sales order), with a query.
The problem is that the text field content is the text number, and not the string itself.
Is it possible to select all replanishment orders where the text contains a particular string, please?
yogesh kapil
7th March 2013, 10:48
HI flebon,
Yes you can search by doing this.
select tdsls401.orno
from tdsls401
where tdsls401.txta(1; 10)="xyz"
selectdo
end select
hope this will help you...........
yogesh
mark_h
7th March 2013, 15:20
What we do to replace text like that is write the text to a file using text.read. At that point we execute something like sed to search and replace the text. Then we use text.rewrite to write the text back. So you can search the tools forum - where this point should be - for text functions and find examples.
flebon
8th March 2013, 09:04
thnaks a lot, I will try
regards
BaanInOhio
8th March 2013, 14:14
Can do it but don't expect good performance. It will require a 3gl or 4gl session since the text utilities probably won't work in easy SQL. You can't search text tables (tttxt010) directly since you don't know where the text breaks between tttxt010 records unless you are certain that the text always starts at the beginning of a record. The tttxt010 search isn't 100% but you can yse keywords that are set for the type of order/text to narrow the search down. Otherwise, you will have to read each order record, use text.to buf() or textfield.to.buf() to transfer the text referenced by the text number into a based two-dimensional string array, then search the array for the substring. Not pretty but it works.