Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to query text UDF data?

I have a query that contains a text UDF, where I need to search for a string that the user enters, see example below:

SELECT t0.docnum, t0.cardname, t0.cntctcode, t0.docdate, t0.u_salescomments, t0.u_generalnotes, t0.u_salesrepcodes, t1.dscription, t1.price, t1.u_custpartno, t1.u_salescomments FROM OQUT t0, QUT1 t1 WHERE t0.docentry = t1.docentry AND t0.u_cr1flag = 'QUOTE' AND t1.dscription = [%0] OR t1.u_custpartno = [%1] OR t0.cardname = [%2] OR t0.cntctcode = [%3] OR t0.u_salesrepcodes = [%4] OR CONTAINS(t0.u_salescomments, '%%[%5]%%')

The issue is the last variable for u_salescomments, where I want to search for a user entered string in the text contained within this field.

Thanks

Former Member
Former Member replied

Try this one:

SELECT t0.docnum, t0.cardname, t0.cntctcode, t0.docdate, t0.u_salescomments, t0.u_generalnotes, 
t0.u_salesrepcodes, t1.dscription, t1.price, t1.u_custpartno, t1.u_salescomments
FROM dbo.OQUT t0
INNER JOIN  dbo.QUT1 t1 ON t0.docentry = t1.docentry 
WHERE t0.u_cr1flag = 'QUOTE' AND t1.dscription = [%0] OR t1.u_custpartno = [%1] OR t0.cardname = [%2] 
OR t0.cntctcode = [%3] OR t0.u_salesrepcodes = [%4] OR t0.u_salescomments like '%[%5]%'

Thanks

Gordon

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question