09-11-2008 11:38 AM
Dear experts,
How can we extract characters from a given string
in this case.
The prgram fail to compile in *1 and *2.
How can i debug to get output.
data: pa_num(20) type c.
pa_num = '1245678.44'.
len = strlen( pa_num ).
FIND '.' in pa_num.
if sy-subrc = 0.
DECIMAL EXISTS.
i_broken-cnum = pa_num+(len-6)(3). *1
append i_broken.
else
NO DECIMAL EXISTS.
i_broken-cnum = pa_num+(len-3)(3). *2
append i_broken.
endif.
09-11-2008 11:43 AM
i_broken-cnum = pa_num+(len-6)(3). wont work.
you cannot do any arithmetic operations in operands. you gotta do it manually before.
like following:
len = len - 6.
i_broken-cnum = pa_num+(len)(3).
09-11-2008 11:40 AM
09-11-2008 11:43 AM
i_broken-cnum = pa_num+(len-6)(3). wont work.
you cannot do any arithmetic operations in operands. you gotta do it manually before.
like following:
len = len - 6.
i_broken-cnum = pa_num+(len)(3).
09-11-2008 11:44 AM
09-11-2008 11:46 AM
Hi,
write
i_brokencnum = pa_num+len(3).
len cant be in ().
Regards,
Surinder