‎2007 Jul 07 8:22 AM
Can anybody tell me whether i can use arithmetic expression in the place of offset of string.
Example:
SELECT rfltempl FROM TBANK_RFL_TEMPLT
INTO v_flowidext
WHERE
langu = 'E'
AND
descr+<b>( strlen( descr )- 4 )(4)</b> = v_bpa.
It is throwing a syntax error.
My intention is to get the last 4 characters as a char string so that i can compare this aganist another character string in a where clause of a select statement.
In the above example last 4 characters of descr char string should be compared agaist v_bpa char string.
Please help me it's urgent .
‎2007 Jul 07 8:27 AM
Hi
Dont do like this. This will affect system performance. Instead of this why dont u do it in internal table.
Select the values from internal table and put it in a internal table and do the offset process... that will be good for performance.
Reward me if its helpful.
Ravi.
‎2007 Jul 07 8:27 AM
Hi
Dont do like this. This will affect system performance. Instead of this why dont u do it in internal table.
Select the values from internal table and put it in a internal table and do the offset process... that will be good for performance.
Reward me if its helpful.
Ravi.
‎2007 Jul 07 8:56 AM
hi thanks for ur reply.I have that solution with me. But i want to simplify the entire logic into a single select statement. Can you explain how the select statement causes performance issue? I think populating the data into internal table first and then processing the strings in a loop and then reading the internal table for the match will consume more time to execute. What do you say?
I am new to ABAP developement so please confirm me on using a arithmetic expression as an offset is permissible or not in ABAP.
‎2007 Jul 07 9:05 AM
Hi Ashok,
Welcome to SDN
Use another variable as:
X = strlen( descr ).
X = X-4.
descr = descr+X(4)
SELECT rfltempl FROM TBANK_RFL_TEMPLT
INTO v_flowidext
WHERE
langu = 'E'
AND
descr = v_bpa.Hope it solves your problem.
Reward if useful.
Thanks
Aneesh.
‎2007 Jul 07 9:13 AM
hi aneesh
You have not observed one thing descr is also a field of the table which is being queried in the select statement. I want to get the solution by using a single select statement. Thanks for your anticipation. Tell me can we do it using a single select statement.
‎2007 Jul 07 9:16 AM
‎2007 Jul 07 9:09 AM
do like this...
data : pat(5).
concatenate '%' v_bpa into pat.
SELECT rfltempl FROM TBANK_RFL_TEMPLT
INTO v_flowidext
WHERE
langu = 'E'
AND
descr like pat.
regards
shiba dutta