01-31-2008 7:42 AM
how can i extract last 4 letters from i tab.
e.g.
xxxxINST
xxYYYY
xxINST
xxYYYY
xxxxxxINST
want ot extract rows with ending 'INST'...
Thanx,
01-31-2008 7:46 AM
hi,
get the string length of the the variable.
say the string length is 20
then
data: v_str(20) type c.
data: v_off(4) type c.
v_off = v_str+16(4).
v_off will have the last four chars
regards,
theja
01-31-2008 7:46 AM
hi,
get the string length of the the variable.
say the string length is 20
then
data: v_str(20) type c.
data: v_off(4) type c.
v_off = v_str+16(4).
v_off will have the last four chars
regards,
theja
01-31-2008 7:49 AM
use offset
in itab
first find length of the string using strlen
var = length-4
string+var(4).
Madhavi
01-31-2008 7:49 AM
HI,
data:str(20).
data:num(2) type n.
num = strlen( str ).
num = num - 4.
write:/ str+num.
rgds,
bharat
01-31-2008 7:55 AM
data : v_leng type i,
v_offset(2) type n,
v_reqired(4) type c.
v_leng = strlen(itab-field).
v_offset = v_leng - 4.
v_required = itab-field+v_offset(4).
Rgds,
Bujji
01-31-2008 7:55 AM
Hi,
Loop at itab.
condense itab-text.
len = strlen( itab-text ).
len = len - 4.
val = itab-text+len(4).
If val = 'INST'.
.......
do the required operation.
.....
endif.
Endloop.
Edited by: Ramesh Hirial on Jan 31, 2008 4:56 PM