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

conversion of decimal number

hi,

how to convert a decimal number

suppose i want to convert 500.00- to 500.

plz help me in resolving this.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2008 at 08:08 AM

    Ramya,

    DATA : v_num type i.

    Move : decimal variable to v_num.

    Don't forget to reward if useful.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2008 at 08:13 AM

    Hi,

    Check the below logic:

    data: dec type bkpf-KZKRS,

    num type numc10,

    ch type char10.

    dec = '500.00'.

    write : / dec.

    num = dec.

    ch = num.

    shift ch left DELETING leading '0'.

    write : / ch.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2008 at 08:22 AM

    Hi Ramya,

    Try this.

    data : var type i,

    var1(3) type n.

    i = -500.

    var1 = var.

    Regards,

    Mohaiyuddin

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2008 at 08:33 AM

    Hi Ramya,

    You can use Field symbol with CASTING operator to convert decimal to Numeric Type (Intergers). You can try with other Numeric type also.

    data:wf_int type i,

    wf_dec(10) type x.

    field-symbols: <fs> type any.

    wf_dec = '28'.

    assign wf_dec to <fs> casting type i.

    wf_int = <fs>.

    write wf_int.

    kindly reward if helpful.

    cheers,

    Hema.

    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.