10-11-2007 2:01 PM
hi,
may i know what function to use if having the below scenario.
i loop an internal table to move code to a variable. when the code in variable match with the code in the string then it is considered match.
my problem now is if the code in variable is ABC and in my string is ABCDDS then it is considered match as ABC is part of the string but in fact i have another code in the internal table which is ABCDDS.
i tried to use CP but cannot work. the code size is 10.
example
in internal table, there are code AAS, ABD, ABC, ABCDDS, ABCW
in the string, 56:091007JENNYUSD200,00<b>ABCDDS</b>PG607
thanks
10-11-2007 2:08 PM
so is it a problem to have 2 matches ??
you return a table with records that have matched and/or not I guess ??
kind regards
arthur
10-11-2007 2:17 PM
hi,
in the string the code is ABCDDS. while loop the code internal table, i use CP to do matching which is not accurrate.
as i said, in the code internal table there are various code: ABC and also ABCDDS. when loop on code ABC, if i use CP, it will consider match as ABC in the string but what i need is the code ABCDDS.
hope you can understand.
thx
10-11-2007 2:33 PM
so to you're internal table you add a length field.
put the length of the string for each field
sort you're table on the lenght of the string in reverse order
and if the first match comes it is for the longest fieldvalue that can occur and not for the smallest or undefined
kind regards
arthur