Skip to Content
author's profile photo Former Member
Former Member

convert the data type from character to currency

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 06:01 AM

    give the table name before wrbtr in the type declaration.

    - Guru

    Reward points for helpful answers

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 06:03 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.