‎2006 Nov 20 8:59 PM
Hi ,
Anyone please tell me the syntax.How can I take a string and remove its last 6 characters and put it into another variable?
Thanks
‎2006 Nov 20 9:04 PM
Hi
Data: v_string type string,
v_new_string type string,
v_len type i,
v_len1 type i.
v_string = '0123456789'.
Get full length
v_len = STRLEN( V_STRING ).
get the offset
V_len1 = v_len - 6.
Move the last 6 characters to another string
V_NEW_STRING = v_string+v_len1(6).
Hope this solves your problem.
Regards
Kathirvel
‎2006 Nov 20 9:04 PM
Hi
Data: v_string type string,
v_new_string type string,
v_len type i,
v_len1 type i.
v_string = '0123456789'.
Get full length
v_len = STRLEN( V_STRING ).
get the offset
V_len1 = v_len - 6.
Move the last 6 characters to another string
V_NEW_STRING = v_string+v_len1(6).
Hope this solves your problem.
Regards
Kathirvel
‎2006 Nov 20 9:30 PM
V_NEW_STRING = v_string+v_len1(6).
It show some error at this line
‎2006 Nov 20 9:32 PM
Please try this in that part
data: v_char(100) type c.
v_char = v_string.
v_new_string = v_char+v_len1(6).
Regards
Kathirvel
‎2006 Nov 20 9:33 PM
‎2006 Nov 20 9:36 PM
Try to check the declaration again, it should work fine.
Regards
Kathirvel
‎2006 Nov 20 9:40 PM
Hi Sri,
Please check this FM C147_STRING_SHIFT.
Regards,
Ferry Lianto