02-10-2009 7:27 AM
I have a variable with C type for example lv_c = 'xxxx#'. Now I want to remove the last character of this variable value? which function do I use? and how do I do that. Thanks!
02-10-2009 7:35 AM
Hi,
data w_i type i.
w_i = strlen( lv_c ).
subtract 1 from w_i.
write : lv_c+0(w_i).
This is working.
02-10-2009 7:29 AM
02-10-2009 7:30 AM
Hi,
just use offsetting..
data
w_temp like lv_c.
lv_c = 'xxxx#'.
w_temp = lv_c+0(4).
write: w_temp.
output is like this:
XXXX
lv_c+0(4) means it takes the first(i.e.from starting) 4 characters.based on this u can omitt or select the characters..just mention the offset value...
Regards
Kiran
Edited by: Kiran Saka on Feb 10, 2009 8:31 AM
02-10-2009 7:30 AM
hi,
u can use n = strlen(lv_c) // u will get length of the string..
then lv_c = lv_c+0(n-1)... will fetch u the value except last character..
Rgds.,
subash
02-10-2009 7:33 AM
Hi,
here's the logic.
data: str type string value 'abcd#', len type i.
len = strlen( str ).
len = len - 1.
str = str+0(len).
write:/ str.
11-03-2021 5:59 AM
02-10-2009 7:33 AM
first find string length from function strlen
lv_len = strlen(lv_c)
lv_len = lv_len - 1
then make one more var of type lv_c lv_c1
lv_c1 = lv_c + 0(lv_len)
02-10-2009 7:35 AM
Hi,
data w_i type i.
w_i = strlen( lv_c ).
subtract 1 from w_i.
write : lv_c+0(w_i).
This is working.
02-10-2009 7:36 AM
Hi ,
You can use the following code It will solve the problem.-----
DATA : w_data(6) TYPE c VALUE 'ABCDEF'.
CONDENSE w_data NO-GAPS.
SHIFT w_data RIGHT .
WRITE w_data.
Regards
Pinaki
02-10-2009 7:40 AM
Hi
you can use
shift lv_c
condense lv_c
it should give you the remaining characters
Thanks
Viquar Iqbal
02-10-2009 7:43 AM
Dear,
It is a special character.
To remove the special characters use below FM,
CONVERT_STREAM_TO_ITF_TEXT
Thanks and Regards,
02-10-2009 7:46 AM
hi,
data:
w_str(5) type c value 'xxxx#'.
shift w_str by 1 places right.
write:/ w_str.
regards,
Mdi.Deeba
02-10-2009 7:46 AM
Hi Anthony ,
Kindly go through this link below:
http://help.sap.com/saphelp_nw70/helpdata/en/9f/db999535c111d1829f0000e829fbfe/content.htm
Hope it helps
Regrds
Mansi
02-10-2009 8:39 AM
Hi,
You can write this logic,
DATA: lv_len TYPE i.
lv_len = STRLEN( lv_c ).
SUBTRACT 1 FROM lv_len.
lv_c = lv_c+0(lv_len). "Here last character will be removed
Regards,
Manoj Kumar P