Skip to Content

Conversion problem

Hi all !

I'm a newbie in ABAP Programming and I have a problem ...

I want to convert a number (delete the '.' from '10.000,00' for example) in this format => 10000,00 ...

I've tried "WRITE ... NO-GROUPING" but it doesn't work ...

Can someone help me please ?

Thanks and sorry for this "bad" question ... :o)

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Nov 30, 2004 at 07:05 AM

    What is the data type of the variable which is holding

    10.000,00.

    NO-GROUPING will only work with type <b>i or p</b>

    Regards

    Raja

    Oops.. by the time i hit save Poornanand Mandalika

    has given a good explanation.

    Message was edited by: Durairaj Athavan Raja

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2004 at 06:55 AM

    Hi David,

    You almost got to the answer. Consider the following snippets of code and you'll know how close you were.

    ==============================================

    data pack type p decimals 2.

    data char(15) type c.

    pack = '100000.32'.

    • CASE I

    write pack.

    • CASE II

    write / pack no-grouping.

    • CASE III

    write pack to char.

    write / char.

    • CASE IV

    write pack to char no-grouping.

    write / char.

    The outputs will be as follows:

    100.000,32

    100000,32

    100.000,32

    100000,32

    =============================================

    So, if you just want to write the values to the list, use CASE II. If you want to convert the values as well, use CASE IV. Please note that WRITE...TO statement is used for type conversion, rather than to write a value to the list.

    Hope the explanation has been clear enough.

    Regards,

    Anand Mandalika.

    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.