Skip to Content

Change decimal point to a commain CSV output

Hi all,

I have an internal table that I use for creating an ALV and also creating a .CSV table using the FM SAP_CONVERT_TO_CSV_FORMAT . So far, so good. My problem begins when one of the itab’s columns is a negative number. In that case, the sign appears to the right of the number, which is something that Excel does not like.

Lo and behold, I created a char column with the proper sign position using the FM 'CLOI_PUT_SIGN_IN_FRONT'. Now my problem is that the column’s decimal separator goes from a comma (,) (the standard in my country) to a point (.)All the other numerical columns seem to be ok (they appear with a decimal comma).

Any ideas how to fix this (short of using REPLACE, which seems to me a very kludgy workaround)?

Thanks in advance,

Luis

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 08, 2017 at 03:15 PM

    FM 'CLOI_PUT_SIGN_IN_FRONT' ?????

    Format options in string templates!

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 08, 2017 at 06:57 AM

    Can you see a change after modifying your settings as mentioned in this Blog : link ...

    That could be an easy workaround, without additional coding ...

    Check SAP ONE Support Launchpad, there are numerous KBA's on ALV / Excel and handling Currency / Quentity / Decimals ...

    Add comment
    10|10000 characters needed characters exceeded

    • One work around (not the neatest, I believe, in terms of code) would be convertig to a char value with WRITE..USING and an EDIT MASK.

      What I find interesting is that if you convert your ALV to excel (which in fact is a CSV file) using SAP's export option (as opposed to using the FM) , this does not happens....

      Regards,

      Luis