2008 Feb 24 4:32 AM
Hi all,
I want to remove last 4 digits from my numerical no. how can i do this?
Plz help me.
2008 Feb 24 4:45 AM
lv_data type i,
lv_len type i.
lv_data = '1234567'.
lv_len = strln( lv_data ).
lv_data = lv_data+0( lv_len - 4).
write:/ lv_data.
output: 123.
2008 Feb 24 4:45 AM
lv_data type i,
lv_len type i.
lv_data = '1234567'.
lv_len = strln( lv_data ).
lv_data = lv_data+0( lv_len - 4).
write:/ lv_data.
output: 123.
2008 Feb 25 4:15 AM
hello,
you can try the following function module:
CONVERSION_EXIT_ALPHA_INPUT
where you can pass the input parameter as the field of the desired size and pass that in the output parameter.
2008 Feb 25 4:17 AM
hi
good
w_level_03 = strlen( W_STRING ).
lv_offset = w_level_03 - 4.
w_string2 = w_string +(lv_offset).
or
w_string2 = w_string +0(lv_offset).
Eg:-
str = "testing1234".
int offset = strlen( str ) - 4.
str = str+0(offset).
thanks
mrutyun^
2008 Feb 25 4:20 AM
Ankita,
v_num TYPE i,
v_len type i.
v_num = '123456756'.
v_len = strln( v_num ).
v_len = v_len - 4
v_num = v_num+0(v_len).
write:/ v_num.
2008 Feb 25 4:52 AM
Hi,
CONVERSION_EXIT_ALPHA_OUTPUT
This Function module is reverse of CONVERSION_EXIT_ALPHA_INPUT , it removes the zeroes which are to the left of the numeric string, converting that string left justified . For non-numeric (including alphanumeric) string it has no effect.
For Eg :
ABCD is converted as ABCD while outputting.
Try it
U'll get it
Rohini.