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

Conersion of CHARACTER to NUMERIC

Hi,

I have a character field with value<b> '123456' .... how do i convert it to numeric as a currency field ...1,23,456 rs</b>

plz help..

points will be rewareded

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Nov 30, 2007 at 12:48 PM

    Hi,

    Declare that variable as p with decimals 0.

    Data : lv_var type p decimals 0.

    Regards,

    prashant

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 12:48 PM

    Instead of trying to convert them to numbers and then performing substraction. I think U could make use of a FM which shall give U difference between two times.

    Try using FITP_GET_TIME_DIFFERENCE

    or L_TO_TIME_DIFF

    or LEINT_TIMECALC_DIFF

    or HR_PDC_CALCULATE_TIME_DIFF

    or HR_PDC_CALCULATE_TIME_DIFF.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 12:49 PM

    Hi

    Define another variable TYPE P and move value.

    DATA : var TYPE CHAR10 value '12345'.
    DATA : amount(10) TYPE p decimals 2.
    
    amount = var.
    
    WRITE :/ amount.
    

    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.