Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

convert the data type from character to currency

Former Member
0 Kudos

Hi every one,

please try this.

when i am executing this program, it is going to short dump.

pls anybody let me know asap..

report convert.

parameter : num1 type wrbtr.

data : num2(13) type c.

move num1 to num2.

replace all occurrences of '.' in num2 with ','.

write 😕 num2.

catch system-exceptions arithmetic_errors = 4.

move num2 to num1.

endcatch.

if sy-subrc eq 0.

write 😕 num1.

endif.

Regards,

neha

3 REPLIES 3

Former Member
0 Kudos

give the table name before wrbtr in the type declaration.

- Guru

Reward points for helpful answers

0 Kudos

use this FM HRCM_STRING_TO_AMOUNT_CONVERT

pass the string , thousand separator,decimal separator, if it is currecy pass currecy key WAERS.

Former Member
0 Kudos

Hi Madhavi/Neha

',' will be treated as CHARACTER, hence forcing a character to currency field will lead in a short dump.

You can use the value in CHAR variable to display/interface as long there are no manipulations/calculations done...

Hope this helps.

Regards

Eswar