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

convert char to dec/amount

Hi,

I need to move the data(1,334.25) to a decimal field....(1334.25)

If i move directly i am getting an exception.

Can you let me know if there is any FM to convert the char to num without removing decina

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    Posted on Jan 05, 2009 at 11:44 AM

    >

    > Hi,

    >

    > I need to move the data(1,334.25) to a decimal field....(1334.25)

    >

    > If i move directly i am getting an exception.

    >

    > Can you let me know if there is any FM to convert the char to num without removing decina

    Remove the comma thousand separator and it will work. If your user settings are set up to use a comma as the thousand separator, the comma should reappear when the value is displayed on screen.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 24, 2011 at 12:20 PM

    Hi Raj,

    Use this FM C14DG_CHAR_NUMBER_CONVERSION

    Regards,

    Praveen

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2009 at 11:40 AM

    try MOVE_CHAR_TO_NUM.

    кu03B1ятu03B9к

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Karthik,

      use fieldcat attribute "decimals_out", and set this to 0 for the field in question and no decimals will print.

       data: mychr(16) value '1334.25',
      mypac type p decimals 2.
      
      mypac = mychr.
      write mypac to mychr.
      

      Regards,

      Syf

      Edited by: syfulla shaik on Jan 5, 2009 5:21 PM

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2009 at 11:47 AM

    Hi,

    Check this:

    DATA N TYPE p decimals 2.

    DATA M(10) TYPE c VALUE '1334.254'.

    N = M .

    write:/ N,

    / M.

    Regards,

    Bhaskar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2009 at 11:51 AM

    Hi,

    Please use the following code, it will solve your problem.

    data: i(8) type c,

    o type p decimals 2.

    i = '1,334.25'.

    replace ALL OCCURRENCES OF ',' in i with space.

    *CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

    • EXPORTING

    • input = i

    • IMPORTING

    • OUTPUT = i

    • .

    move i to o.

    write o.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 23, 2013 at 04:38 PM

    Hello,

    i loaded Data from Data Services in BW.

    The generated DataSource deliver the DEC Attribute (AMOUNT) as CHAR, no DEC are supported by the Transfer Structure.

    The field AMOUNT it's like "453,26-" or "1.189,82-".

    When i load the data from PSA in DSO i become the error:

    "The argument ' 453,26-' cannot be interpre ted as a number"

    How can i transform the field into decimal?

    Thank you in advance for the response.

    Regards, Vjola

    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.