Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to extract characters from string

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.

Tags:
replied

Hi,

write

i_brokencnum = pa_num+len(3).

len cant be in ().

Regards,

Surinder

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question